lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <MN2PR12MB4488F91151FA17018306F92AF7110@MN2PR12MB4488.namprd12.prod.outlook.com>
Date:   Tue, 3 Nov 2020 14:50:40 +0000
From:   "Deucher, Alexander" <Alexander.Deucher@....com>
To:     Greg KH <gregkh@...uxfoundation.org>,
        "Koenig, Christian" <Christian.Koenig@....com>
CC:     Alex Deucher <alexdeucher@...il.com>,
        Deepak R Varma <mh12gx2825@...il.com>,
        David Airlie <airlied@...ux.ie>,
        LKML <linux-kernel@...r.kernel.org>,
        Maling list - DRI developers 
        <dri-devel@...ts.freedesktop.org>,
        Melissa Wen <melissa.srw@...il.com>,
        amd-gfx list <amd-gfx@...ts.freedesktop.org>,
        Daniel Vetter <daniel@...ll.ch>,
        Daniel Vetter <daniel.vetter@...ll.ch>
Subject: RE: [PATCH] drm/amdgpu: do not initialise global variables to 0 or
 NULL

[AMD Public Use]

> -----Original Message-----
> From: Greg KH <gregkh@...uxfoundation.org>
> Sent: Tuesday, November 3, 2020 1:53 AM
> To: Koenig, Christian <Christian.Koenig@....com>
> Cc: Alex Deucher <alexdeucher@...il.com>; Deepak R Varma
> <mh12gx2825@...il.com>; David Airlie <airlied@...ux.ie>; LKML <linux-
> kernel@...r.kernel.org>; Maling list - DRI developers <dri-
> devel@...ts.freedesktop.org>; Melissa Wen <melissa.srw@...il.com>;
> amd-gfx list <amd-gfx@...ts.freedesktop.org>; Daniel Vetter
> <daniel@...ll.ch>; Daniel Vetter <daniel.vetter@...ll.ch>; Deucher,
> Alexander <Alexander.Deucher@....com>
> Subject: Re: [PATCH] drm/amdgpu: do not initialise global variables to 0 or
> NULL
> 
> On Mon, Nov 02, 2020 at 09:06:21PM +0100, Christian König wrote:
> > Am 02.11.20 um 20:43 schrieb Alex Deucher:
> > > 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.
> >
> > Agree with Alex.
> >
> > Especially for the module parameters we should have a explicit init
> > value for documentation purposes, even when it is 0.
> 
> Why is this one tiny driver somehow special compared to the entire rest of
> the kernel?  (hint, it isn't...)
> 
> Please follow the normal coding style rules, there's no reason to ignore them
> unless you like to constantly reject patches like this that get sent to you.
> 

I'll apply the patch, but as a data point, this is the first time I've gotten a patch to make this change.  I get several bug reports or patches every year to explicitly set values to global variables because users assume they are not initialized.  So it will always be a trade off as to which patches you want to NACK.

Alex

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ