Re: [PATCH] HID: intel-thc-hid: Intel-quickspi: Fix some error codes

From: Mark Pearson

Date: Thu Apr 23 2026 - 11:42:00 EST



On Thu, Apr 23, 2026, at 11:12 AM, Dan Carpenter wrote:
> On Thu, Apr 23, 2026 at 10:51:10AM -0400, Mark Pearson wrote:
>> Hi Dan,
>>
>> On Thu, Apr 23, 2026, at 3:10 AM, Dan Carpenter wrote:
>> > dev_err_once(qsdev->dev, "RESET_RESPONSE body expected len = %u,
>> > actual = %u\n",
>> > read_len, actual_read_len);
>> > - return ret;
>> > + return ret ?: -EINVAL;
>> > }
>> >
>> > input_rep_type = FIELD_GET(HIDSPI_IN_REP_BDY_HDR_REP_TYPE, reset_response);
>> > --
>> > 2.53.0
>>
>> I think this would be throwing away other possible different return values from thc_tic_pio_read?
>> You'd be losing the -EINTR,-EBUSY, -ETIMEDOUT conditions that might be useful to the upper layers.
>>
>> Should that block be split into two separate error conditions?
>
> It doesn't throw away any error codes. Writing "return ret ?: -EINVAL;"
> is a short hand for "return ret ? ret : -EINVAL;".
>
Yeah, you're right - read it to fast. Sorry!

Reviewed-by: Mark Pearson <mpearson-lenovo@xxxxxxxxx>