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.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 4DFDEC00A89 for ; Mon, 2 Nov 2020 20:10:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E6EF622268 for ; Mon, 2 Nov 2020 20:10:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604347820; bh=URXjsVEknTXcprxYlN0AN65VL/Q3nRcgZdYVADBLdzw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=GdzWzeAlGKw3/inX5yRmC9mBtazE97vPqVpdcNkCjJcZCw73NlYSs3DupuIRhV3F7 te3yTnrhpnGaWqqKdSRtFM6Aybfsm1lYiKsGpA+utNqQRiRVRs6uVb0ahTDf9q05Sx zkQTkXA/OsRC4+0aCHGLBUkze8Qfy9vuDAqxPTFQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727137AbgKBUKT (ORCPT ); Mon, 2 Nov 2020 15:10:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:51844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726723AbgKBUJr (ORCPT ); Mon, 2 Nov 2020 15:09:47 -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 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 Cc: Deepak R Varma , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , David Airlie , Daniel Vetter , amd-gfx list , Maling list - DRI developers , LKML , Melissa Wen , Daniel Vetter 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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