Received: by 2002:a05:6622:f08:0:0:0:0 with SMTP id l8csp4274352ivc; Tue, 3 Nov 2020 07:35:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJyPrjbMH+74kDnUN1J9SPIblxp3lMvC3t6Y6tXo1LIjpk/iVb7S0lnO9ga8hqB8+j7sr8TQ X-Received: by 2002:a17:906:13d6:: with SMTP id g22mr12359589ejc.240.1604417699734; Tue, 03 Nov 2020 07:34:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604417699; cv=none; d=google.com; s=arc-20160816; b=GjVNmrYTswM/abBVO4Ph9MpJ1FybJl+KQj/YiYjfW9T9tjeicVpBY/MY4fqy+19LZ2 4oaqgF1to18wH3KSh222cXEV3BBOOsTfSLzUg1/kRvdWC2PB2eqZGO/I3FMWdNhqxcW1 fMqJrcgrOyXwgWBgn4zQKJy4z/WNXENUTcTRla9e4yo/Vnf4TvBMUL1FE3aBmY61l+0R GrVYL/7JeR1JLA8bMIjHTyA8j+aGJ+ZMPfvh8t7Xr4F/f4Wem6e+f3sr875OfAP1ax1w UldCoW/qoPpR2+GeibIM1EJr1bUcAS8Gsu4yWdrrLQyWcADeiLPzTooZbiDRGuxxuMT/ 51/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hpo8h1KFElN5bzUzHFMELgEr0zy4s7tcgS9hl3mLHRI=; b=kYFT2gB63lrE4ahkB3vVxkmrYxVgdc8bahazbiz2i/LvszrHDAJTuB2BnqfXfjyfAF uNiuW00t35GBkUN43whoakxbNWKubh7ka4JmdF2s0hGL0oeWT6HNpKRNhd1SG3PZI/5T m7Y6dkLOoyiJpeg4Z+uBn14DZmh8N+MUxVV49eNIKqSodLfN36xP0ID9oNSe4qxDNWfd qFNNhGc8BKAxKjJBQRQWo6co8tigSaN1qhqV6cO3nzc5YtN4zCCMzOo+ljAMHcINjU4E X0mzNkIZYTmQoSehwfod7BNQbnitI1hRFJBQMF29BfeQoUOHb+kZiP4TrvdHWoDJtuN8 3bpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=y5L54ijl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a11si6634498ejb.159.2020.11.03.07.34.35; Tue, 03 Nov 2020 07:34:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=y5L54ijl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728095AbgKCPdQ (ORCPT + 99 others); Tue, 3 Nov 2020 10:33:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:36898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726581AbgKCPdP (ORCPT ); Tue, 3 Nov 2020 10:33:15 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 498D820735; Tue, 3 Nov 2020 15:33:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604417594; bh=W571NPcDIE5ZXTV/zMmJykXxM0qZYlkoHanLbG2nw84=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=y5L54ijl1bqs8JZb6DcGz/lO1YgExP6G6NybEcPB+sixrb+cWycBsL9TswlWNukSi tLqeNWfqpLtPZG9m/Cuj96MhweqpAseCwLrhU4KtrmVFRKCHyu+RuoeY2gzCSeoJ6s /TKSJFxHuRliMLwfp9anZkiBE8ztwtSE/kizOM9Y= Date: Tue, 3 Nov 2020 16:34:07 +0100 From: Greg KH To: "Deucher, Alexander" Cc: "Koenig, Christian" , Alex Deucher , Deepak R Varma , David Airlie , LKML , Maling list - DRI developers , Melissa Wen , amd-gfx list , Daniel Vetter , Daniel Vetter Subject: Re: [PATCH] drm/amdgpu: do not initialise global variables to 0 or NULL Message-ID: <20201103153407.GB3267686@kroah.com> References: <20201102184147.GA42288@localhost> <20201103065324.GD75930@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 03, 2020 at 02:50:40PM +0000, Deucher, Alexander wrote: > [AMD Public Use] > > > -----Original Message----- > > From: Greg KH > > Sent: Tuesday, November 3, 2020 1:53 AM > > To: Koenig, Christian > > Cc: Alex Deucher ; Deepak R Varma > > ; David Airlie ; LKML > kernel@vger.kernel.org>; Maling list - DRI developers > devel@lists.freedesktop.org>; Melissa Wen ; > > amd-gfx list ; Daniel Vetter > > ; Daniel Vetter ; Deucher, > > Alexander > > 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 > > 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. Are you all not running your patches through checkpatch.pl to tell you simple things like this? If no, I suggest you start doing that :) thanks, greg k-h