Re: [PATCH] ravb: Use common error handling code in ravb_probe()

From: SF Markus Elfring
Date: Sun Oct 29 2017 - 07:51:27 EST


>> @@ -2069,10 +2069,9 @@ static int ravb_probe(struct platform_device *pdev)
>> irq = platform_get_irq_byname(pdev, "ch22");
>> else
>> irq = platform_get_irq(pdev, 0);
>> - if (irq < 0) {
>> - error = irq;
>> - goto out_release;
>> - }
>> + if (irq < 0)
>> + goto failure_indication;
>
> IMHO, it's really confusing that "irq" contains the error code, not "error".
> Especially when jumping to a meaningless label named "failure_indication"
> ("irq_failure" would be more intuitive).

Thanks for your constructive feedback.


> So I prefer the original code, regardless of the label name.

Can another attempt make sense to concentrate the setting of a variable
at the end of this function with more pleasing identifiers?

Regards,
Markus