Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2050137rdf; Mon, 6 Nov 2023 03:23:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IH4iGW99tTwHfD/ps9vNE5a1yP4DHHzdfvXTJreIVyy8B+cGD+QFQsamCSoSecnTkRMbjC6 X-Received: by 2002:a05:6a20:3d01:b0:15e:2d9f:cae0 with SMTP id y1-20020a056a203d0100b0015e2d9fcae0mr28833627pzi.10.1699269822561; Mon, 06 Nov 2023 03:23:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699269822; cv=none; d=google.com; s=arc-20160816; b=LJfQg2GLdpyPllwQxoFPVaRhJaGIQpF4f7m2X8LDnx7ubz/il7ywoku7imyWsEpZD5 hQxYiPJR3Az7JCBqyvTVgpM8S0VkTYY3JaGcQTzagXzXHSDBvEzbqRHQ4EHbBaBfFkf6 HjEZeOnrEADrDBj6yHfYL7yhBc9M4evsfwc3EUmDwiCbjK0ggo1f1i15xaUfIKxGRvmq /hKi2CfE7pGoFFwtd4o/egDiKzaAg51CK+E92eTsHYSTw5RjDfnyfaPvdEK1zqIcpd8K EBDtyd4mDAododcmiMJnBzHV8kOq0QAcZrxLvN5goy28tn/SM6FxWnqY1yJpLaUN4UdW s48w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from:dkim-signature; bh=RXlWNPNcqGSQr6nZmZTh6bwCc9snz2sSPsJjcSNjLi8=; fh=/IX2vlqHLDqr096G+m9D8KwubAsWWa/RJOUOIPKgl78=; b=Kf4UXqImC7uG46BJJvRZw2a5rKt3OOHz+FzVesJglD7sbI2eqaTlpySz36JbXDKs02 1FNy3cwPu7J784fBBJIxXOVB9q042ZIXULzaDgyFIM5qddA0NuL2OQqcQ9nMeazXBIQS veAwooRsBgKukAdYqwpHd3LNCAo7E4pQd61HqRkZzkUY6yuuik1zYIp5K6EfDi7qh4wZ WwYwY0qiQCYSMIR+8R5WWbPIew4xa3zb6glGC9hTSpUgmmMaavo5q7bjwCNoS5U2MQo4 JtBttdB9j9aLzMtyQWQWmz0eOwralzh11fN78xG3Qn5Z2sMqqJCzy3zpfLLgytBi1LYn azjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OZ230BlH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id k20-20020a056a00135400b006bd20945b23si8083131pfu.37.2023.11.06.03.23.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 03:23:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OZ230BlH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 048F08047508; Mon, 6 Nov 2023 03:23:40 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230018AbjKFLX0 (ORCPT + 99 others); Mon, 6 Nov 2023 06:23:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbjKFLXZ (ORCPT ); Mon, 6 Nov 2023 06:23:25 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7601BBB for ; Mon, 6 Nov 2023 03:23:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699269802; x=1730805802; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=mHD5i5vDa1OTKSAAbvoZP2HSropGa5tKX66nmBUNaYk=; b=OZ230BlHYihfIpX7OHqE6UVevqcB8WkfUqi1QWVX1yXWp+msxzEHrQu7 xZZC3UV1nm+ZJgsTKlmLlubi7tZHVOb4tlxi0RkUnFtc44AduZpg9Co4/ YM1A5+pz/NVrDj8UTLm3lYWHqm4+jCchwJhiSNxxahabxt3oHCRalOPfl sSvEwmIr0UQ/D+DHSJKeEx1Pi16Y9dFnyPc4oEUAnnTvkMC3oiWFMkLpE K6XjaHAhYtbEdO0IETZP9VmgYuiuPTyFmmksw6RbU7EB5OzZLkDfecwwq RoIaGfVTX7JrIw6MLSYVWNFcpGldlL8NMr/UbHiP/81K0YKEh0ILAgXko A==; X-IronPort-AV: E=McAfee;i="6600,9927,10885"; a="393150985" X-IronPort-AV: E=Sophos;i="6.03,281,1694761200"; d="scan'208";a="393150985" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 03:23:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,281,1694761200"; d="scan'208";a="3597494" Received: from lpilolli-mobl.ger.corp.intel.com (HELO localhost) ([10.252.36.222]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 03:23:17 -0800 From: Jani Nikula To: Abhinav Singh , alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch Cc: Abhinav Singh , linux-kernel-mentees@lists.linuxfoundation.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drivers: gpu: Fix warning using plain integer as NULL In-Reply-To: <20231103155013.332367-1-singhabhinav9051571833@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20231103155013.332367-1-singhabhinav9051571833@gmail.com> Date: Mon, 06 Nov 2023 13:23:14 +0200 Message-ID: <87sf5jyvkt.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 06 Nov 2023 03:23:40 -0800 (PST) On Fri, 03 Nov 2023, Abhinav Singh wrote: > sparse static analysis tools generate a warning with this message > "Using plain integer as NULL pointer". In this case this warning is > being shown because we are trying to intialize a pointer to NULL using > integer value 0. > > Signed-off-by: Abhinav Singh > --- > drivers/gpu/drm/radeon/clearstate_evergreen.h | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/radeon/clearstate_evergreen.h b/drivers/gpu/drm/radeon/clearstate_evergreen.h > index 63a1ffbb3ced..3b645558f133 100644 > --- a/drivers/gpu/drm/radeon/clearstate_evergreen.h > +++ b/drivers/gpu/drm/radeon/clearstate_evergreen.h > @@ -1049,7 +1049,7 @@ static const struct cs_extent_def SECT_CONTEXT_defs[] = > {SECT_CONTEXT_def_5, 0x0000a29e, 5 }, > {SECT_CONTEXT_def_6, 0x0000a2a5, 56 }, > {SECT_CONTEXT_def_7, 0x0000a2de, 290 }, > - { 0, 0, 0 } > + { NULL, 0, 0 } Random drive-by comment: I'd just use {} as the sentinel. BR, Jani. > }; > static const u32 SECT_CLEAR_def_1[] = > { > @@ -1060,7 +1060,7 @@ static const u32 SECT_CLEAR_def_1[] = > static const struct cs_extent_def SECT_CLEAR_defs[] = > { > {SECT_CLEAR_def_1, 0x0000ffc0, 3 }, > - { 0, 0, 0 } > + { NULL, 0, 0 } > }; > static const u32 SECT_CTRLCONST_def_1[] = > { > @@ -1070,11 +1070,11 @@ static const u32 SECT_CTRLCONST_def_1[] = > static const struct cs_extent_def SECT_CTRLCONST_defs[] = > { > {SECT_CTRLCONST_def_1, 0x0000f3fc, 2 }, > - { 0, 0, 0 } > + { NULL, 0, 0 } > }; > static const struct cs_section_def evergreen_cs_data[] = { > { SECT_CONTEXT_defs, SECT_CONTEXT }, > { SECT_CLEAR_defs, SECT_CLEAR }, > { SECT_CTRLCONST_defs, SECT_CTRLCONST }, > - { 0, SECT_NONE } > + { NULL, SECT_NONE } > }; > -- > 2.39.2 > -- Jani Nikula, Intel