Re: [PATCH] x86: fix error paths in microcode_init()

From: Jan Beulich
Date: Fri Dec 02 2011 - 10:33:39 EST


>>> On 02.12.11 at 16:24, Borislav Petkov <bp@xxxxxxxxx> wrote:
> On Fri, Dec 02, 2011 at 08:45:09PM +0530, Srivatsa S. Bhat wrote:
>> Your patch fixes the issue more properly than mine, but adding your part
>> on top of my patch makes the code look better. For example,
>> platform_device_unregister() wouldn't need to be called twice; and we
>> can use the quite popular way of handling error path via goto statements,
>> which makes the code flow much more comprehensible and intuitive.
>
> Yes,
>
> goto labels is the proper way for spelling error handling in the kernel
> so I could very well take your patch Jan, instead, if you change it to
> use goto labels for the error path as Srivatsa's patch does it. That is,
> in case Ingo hasn't pulled yet.

Sorry, no, I won't introduce new labels in functions not already using
some (I'm already feeling guilty enough each time I end up doing so
when a function already is coded that way, to limit the impact of a
particular change). This is just bad programming style in my opinion, no
matter what other developers may think on this subject.

Jan

--
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/