Re: [PATCH 07/18] Input: cap11xx - simplify function return logic

From: Javier Martinez Canillas
Date: Fri Oct 02 2015 - 14:17:54 EST


Hello Dmitry,

On 10/02/2015 08:09 PM, Dmitry Torokhov wrote:

[snip]

>>
>> - error = devm_request_threaded_irq(dev, irq, NULL, cap11xx_thread_func,
>> - IRQF_ONESHOT, dev_name(dev), priv);
>> - if (error)
>> - return error;
>> -
>> - return 0;
>> + return devm_request_threaded_irq(dev, irq, NULL, cap11xx_thread_func,
>> + IRQF_ONESHOT, dev_name(dev), priv);
>> }
>
> For cases where we have multiple of potentially failing actions:
>
> error = action1();
> if (error)
> return error;
>
> error = action2();
> if (error)
> return error;
>
> error = action3();
> if (error)
> return error;
>
> return 0;
>
> I prefer not to compress the last action check to "return action3()".
>

Fair enough, I don't mind if you drop those patches then.
Thanks a lot for your feedback.

> Thanks.
>

Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/