Re: [PATCH 2/2] driver core: fix statics initilisation

From: Willy Wolff
Date: Mon Apr 15 2019 - 11:29:05 EST


Thank you for your review.

I follow https://kernelnewbies.org/FirstKernelPatch to write this patch.
It's not stated that checkpatch.pl is for new patches only. Moreover,
https://kernelnewbies.org/FirstKernelPatch#Running_checkpatch.pl suggest to
run over the entire file.

Also, uninitialised static global variable are initialised to 0 by default.
Thus, initialising driver_deferred_probe_enable to false (which is 0) is
redundant.

As my knowledge, initialised global goes to .data section, and uninitialised
goes to .bss.

What does it mean for the kernel? Is this still hold?
Are performance or memory footprint of the kernel be affected?
Please, clarify my knowledge of C and kernel developement if I'm wrong.

I think checkpatch.pl should mention that information as a reminder.

Best Regards,
Willy

On Mon, Apr 15, 2019 at 10:12:43AM +0200, Rafael J. Wysocki wrote:
> On Fri, Apr 12, 2019 at 5:48 PM Willy Wolff <willy.mh.wolff.ml@xxxxxxxxx> wrote:
> >
> > perl scripts/checkpatch.pl -f drivers/base/dd.c got red here:
>
> Please note that checkpatch.pl is for new patches. Running it against
> the existing code base is questionable and so the results of that.