On Mon, Nov 02, 2020 at 09:48:25PM +0100, Christian König wrote:
Am 03.11.20 um 07:53 schrieb Greg KH:Again, no, that's not what we have been doing in the kernel for the past
On Mon, Nov 02, 2020 at 09:06:21PM +0100, Christian König wrote:And it certainly shouldn't :)
Am 02.11.20 um 20:43 schrieb Alex Deucher:Why is this one tiny driver somehow special compared to the entire rest
On Mon, Nov 2, 2020 at 1:42 PM Deepak R Varma <mh12gx2825@xxxxxxxxx> wrote:Agree with Alex.
Initializing global variable to 0 or NULL is not necessary and shouldI agree that this is technically correct, but a lot of people don't
be avoided. Issue reported by checkpatch script as:
ERROR: do not initialise globals to 0 (or NULL).
seem to know that so we get a lot of comments about this code for the
variables that are not explicitly set. Seems less confusing to
initialize them even if it not necessary. I don't have a particularly
strong opinion on it however.
Especially for the module parameters we should have a explicit init value
for documentation purposes, even when it is 0.
of the kernel? (hint, it isn't...)
Please follow the normal coding style rules, there's no reason to ignoreYeah, that's a rather good point.
them unless you like to constantly reject patches like this that get
sent to you.
Not a particular strong opinion on this either, but when something global is
set to 0 people usually do this to emphases that it is important that it is
zero.
20+ years. If you do not set it to anything, we all know it is
important for it to be set to 0. Otherwise we would explicitly set it
to something else. And if we don't care, then that too doesn't matter
so we let it be 0 by not initializing it, it doesn't matter.
I think this very change is what started the whole "kernel janitor"
movement all those years ago, because it was easily proven that this
simple change saved both time and memory.
This shouldn't even be an argument we are having anymore...
thanks,
greg k-h