[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201102201040.GA2433494@kroah.com>
Date: Mon, 2 Nov 2020 21:10:40 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Alex Deucher <alexdeucher@...il.com>
Cc: Deepak R Varma <mh12gx2825@...il.com>,
Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
amd-gfx list <amd-gfx@...ts.freedesktop.org>,
Maling list - DRI developers
<dri-devel@...ts.freedesktop.org>,
LKML <linux-kernel@...r.kernel.org>,
Melissa Wen <melissa.srw@...il.com>,
Daniel Vetter <daniel.vetter@...ll.ch>
Subject: Re: [PATCH] drm/amdgpu: do not initialise global variables to 0 or
NULL
On Mon, Nov 02, 2020 at 02:43:45PM -0500, Alex Deucher wrote:
> On Mon, Nov 2, 2020 at 1:42 PM Deepak R Varma <mh12gx2825@...il.com> wrote:
> >
> > Initializing global variable to 0 or NULL is not necessary and should
> > be avoided. Issue reported by checkpatch script as:
> > ERROR: do not initialise globals to 0 (or NULL).
>
> I agree that this is technically correct, but a lot of people don't
> 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.
The kernel coding style is to do it this way. You even save space and
time by doing it as well :)
thanks,
greg k-h
Powered by blists - more mailing lists