From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3624BC2D0A3 for ; Mon, 2 Nov 2020 20:17:44 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BD784206F1 for ; Mon, 2 Nov 2020 20:17:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="V44X/eBh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD784206F1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3EC806E2ED; Mon, 2 Nov 2020 20:17:43 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7FB0F6E321; Mon, 2 Nov 2020 20:09:46 +0000 (UTC) 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 9D39120870; Mon, 2 Nov 2020 20:09:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604347786; bh=URXjsVEknTXcprxYlN0AN65VL/Q3nRcgZdYVADBLdzw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V44X/eBh88ZcoQr0DgPwJTJa/lBENDAbD5oS9b0exdEEWilQIWEgQhwo5FTyLMMX2 +3WXD0T6quL9vrn5IytNAeZ5GZoD1tuoXn+U1QA9xjXlHPo9XR5/Zm7je3nmxxB4f6 MhwPXtf7y5xT4Pk/Zwh5sbZ28GuIxGEfNLe3S8G8= Date: Mon, 2 Nov 2020 21:10:40 +0100 From: Greg KH To: Alex Deucher Subject: Re: [PATCH] drm/amdgpu: do not initialise global variables to 0 or NULL Message-ID: <20201102201040.GA2433494@kroah.com> References: <20201102184147.GA42288@localhost> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailman-Approved-At: Mon, 02 Nov 2020 20:17:41 +0000 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Deepak R Varma , David Airlie , Daniel Vetter , LKML , amd-gfx list , Melissa Wen , Maling list - DRI developers , Daniel Vetter , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" 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 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 _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx