Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1676362pxb; Wed, 9 Feb 2022 01:55:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJztQ4lA4pr0cTc2ZXxFOSMFo09RIrxbtpxLMqwtVTAl/3o7epJWjW7Ze7578S19pjzwIeis X-Received: by 2002:a17:90b:4d12:: with SMTP id mw18mr1657269pjb.104.1644400552721; Wed, 09 Feb 2022 01:55:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1644400552; cv=pass; d=google.com; s=arc-20160816; b=GDjTOakiVvwm6La2FnErzHCPGKW/A0OXq54ZUxoAP5iwBPw3BxugB8PdBXxImu2TyR TNepe3Harr47/0u4g9zl6ypVQyvgqFwv9qjjDRauSvF4nIEHioIVCejrDxZKeN1Hozem iw1Tip6IS7hmREc6ibLG74IGlFyzlPPuZOTQnwXlw3vwSKNBShH11L9OA6R/0EsCh80g wQ7j68i7M0iliGk10F8p1s+VhrVCMYRpM/1z/lmQ6QrN/1CYJfUOEdwF42ePyNER01lx tob/YXacckjWTyU97YieXUKjOYPirirpTSyNhsIJ0fUY/Tdrc0Et+HQO5SCsJIBp36J2 v56g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :msip_labels:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=c0mKa3GFn/K7z3Vp/MPPgKL76eW1ze0iSxZTVlkL+ck=; b=UAU/za3GuoSErFVUR5mSVr0iOVcm+wLcDmNc6ZI6MTJhm+PwSDCwh5bRs+StaqrPx0 VnXTCNrTa4r62k/0DaE3Cl1Am1enn/LMdVoCoCdVaWNtVFTyR3Qabi9QZ9IIIM3lblQ5 QWM6MlEJL8gKsCVq25jfGhVpcOmQ0ij9iifoUyjuTi6CoGuywI25KZRT4uX92v+7Mo+5 n/NO/z3cmx1rfwICYnAzrTWWyaezqSvqPHmuh7+CP8b9gpc+drJprt45OXGgc3uwS1bc 5YdjOy1ejLaCAb8iztXpLP301KFVuaZc34OC6b7vOlP+NHuB3OvnWIn8Sb1MAq7Ip2Xv TOEQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=VKgSC1iM; arc=pass (i=1); 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j3si9515429plx.441.2022.02.09.01.55.38; Wed, 09 Feb 2022 01:55:52 -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=@amd.com header.s=selector1 header.b=VKgSC1iM; arc=pass (i=1); 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232841AbiBGFt2 (ORCPT + 99 others); Mon, 7 Feb 2022 00:49:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234958AbiBGDE7 (ORCPT ); Sun, 6 Feb 2022 22:04:59 -0500 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2079.outbound.protection.outlook.com [40.107.93.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81066C061A73 for ; Sun, 6 Feb 2022 19:04:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RYu96WpzmH6mc5Sqdf/deBj9vTifvUoqUzycBpI34yow0RShghp11OHuBSO0U13+oLEvLhw/9+BcagFPO1T788emc1lOWrd+wGGY12DldZHnXEEQJILLJSRwWEUaB4X/h8aE+ZakNH7mJekogZHNSe+BGTrlPv3onHOgUOV91C9zEy5BRbgOKhwTwAsZSIL3+LwjtsJW3H06BEWgaWlnxQ8iaaaIwA9eN5JK5nbC+6IucT9yCgoeyR9DvtdOsCTpSvEH0sTXIsEKlNIUlTAINKA+ZWT8bTiqVh94QX6YphkAfLA12omHT4yyLfBzJ9mtUaWflqSwYPmM3kqiGNkIqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=c0mKa3GFn/K7z3Vp/MPPgKL76eW1ze0iSxZTVlkL+ck=; b=XkCWipNofTevI7q6GacIjoZJDa6W35yhe47//ANOre0u78p1GHsu4nwKOxiVfUr02VHF8cip6qgDcIDB7EOcWpTjfToHd2Z2ApsFEicimdpO33eaM9/TX+Pv+Ajbp1/zlHcBX5f/PcmPq3Whu0zDVuE4Dzb2EpWM9dvN4D2qAkfXEiYynVt+b737+ckx6i7gERZZizCGjWvGXDJQawUSbI40lCm1WvrfKYaoRPIwxs0Ty62nRLOV8sj+JSDs2sm9NXEwAR4YN01/EHZJnufyTXU5gxhGk3eqmRyE5RtqM1iP8594LLJMIKFuD19QHAFWSnfrgyt8m2nL8gXZngNxpQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c0mKa3GFn/K7z3Vp/MPPgKL76eW1ze0iSxZTVlkL+ck=; b=VKgSC1iMkWDvacw27isg10Vfulvhvftaa5XEQEtg3fGvKUj9DHSer3fgxDyVbHtSUW+ZltQ3TGT5xb2+EY0sEyRi6V3GnwXXtRZLqdiMKVLpdjz1WraDAYH/4Lg5r27VS5YcG2e3DAD27GRWldcuYtDobg9LWDYzmHnyATaf9rE= Received: from DM6PR12MB2619.namprd12.prod.outlook.com (2603:10b6:5:45::18) by BN7PR12MB2642.namprd12.prod.outlook.com (2603:10b6:408:26::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.11; Mon, 7 Feb 2022 03:04:54 +0000 Received: from DM6PR12MB2619.namprd12.prod.outlook.com ([fe80::a894:300e:5c16:5639]) by DM6PR12MB2619.namprd12.prod.outlook.com ([fe80::a894:300e:5c16:5639%6]) with mapi id 15.20.4951.018; Mon, 7 Feb 2022 03:04:54 +0000 From: "Quan, Evan" To: "trix@redhat.com" , "Deucher, Alexander" , "Koenig, Christian" , "Pan, Xinhui" , "airlied@linux.ie" , "daniel@ffwll.ch" , "nathan@kernel.org" , "ndesaulniers@google.com" , "Lazar, Lijo" , "Powell, Darren" , "Chen, Guchun" , "Grodzovsky, Andrey" CC: "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "llvm@lists.linux.dev" Subject: RE: [PATCH] drm/amd/pm: fix error handling Thread-Topic: [PATCH] drm/amd/pm: fix error handling Thread-Index: AQHYGqEaK1SoVE67J0WJiMLZE9ClrayHaYlA Date: Mon, 7 Feb 2022 03:04:54 +0000 Message-ID: References: <20220205150008.1968218-1-trix@redhat.com> In-Reply-To: <20220205150008.1968218-1-trix@redhat.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_Enabled=true; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_SetDate=2022-02-07T03:04:47Z; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_Method=Standard; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_Name=AMD Official Use Only-AIP 2.0; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_ActionId=2b99d696-63a7-4ca0-bf44-e753c9397dd4; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_ContentBits=1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c188e0a8-7488-42b9-629c-08d9e9e69d9a x-ms-traffictypediagnostic: BN7PR12MB2642:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: O5Na4Drt+e6IU5twF3tO7fse8sRaBLN5Ag/yXrgkBJSxV/jOHNZOQQOM6FZsArRmiVL9Et0UcJDQIeENhPafnPfjHE17PakC1IPV0ur36qOSKqD2NYKYmdiBOKT2JO22AOuI/V+QPRERRei7ExKAJGQyoyvjCZQbHSvdHE7hQ6U3AiadXEKa6CkI3mn+Ppcug4Nyd2sOU/h2Q1crlBXTqqgUAPtIigodWLTauHhKNYkeJeHvo1+BO1QuTKOW6hf7UkX7/CQl8CUIIJ2Mc5ZHHNU1aBG1XiIsgM/baFw2DAn+GuotqoB5at3rQ0jgzkj+zumA5kqozvmyRiJiqo/mH9UNEsB3ibnQHvZMK84U1bzsofEXPe/eP/f9wOwO899tHmZUi8iQTNjZY6HTgq52GdrEfRrUb0/bM1ezgLsHu1Mz8XMmXQscL48z+EM67VRMx3a9aArY3dmjgLCejekgWN724W3H5gS5YQ04k7M81aBIx9hd9zpejdSQy3LIFmQWaDRdJgrS/eI4OMLcnsWPYVb8laYZmJJHja/mNKFmUw6ptzE4qhu52niJsuzcVJ/5Q+70dq17Mnt3IcKm16by7tMN9yKZh4DYFIEVySGQ32PA8elGJHZmRvGceRS5ZvlPgHPrcKYinTGlA2mLTDcE0mB5G99ZID2zuGSBSYjROMgGnQjiYvJuCKD5fDJaDLUOkwnzGA0i0F3uhwdL7Ybcl4LXzeCbNbPj2/KcekfXVWI= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB2619.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(71200400001)(7696005)(110136005)(122000001)(6636002)(9686003)(53546011)(508600001)(54906003)(6506007)(316002)(52536014)(2906002)(38070700005)(86362001)(76116006)(26005)(66946007)(33656002)(66476007)(186003)(38100700002)(921005)(4326008)(8936002)(8676002)(83380400001)(66556008)(66446008)(5660300002)(64756008)(55016003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Awb+bMdpuRa1CEWGzhvwM42zAGS9j9GlvPOLWxso2h3CZtYuCf0ePjjTk5HI?= =?us-ascii?Q?Gl2Dav8PQRTqFXxlj0x+d1vM+M+A3MVj8UvtgmNxAyJb1W84QVi3xNPNqt5d?= =?us-ascii?Q?7m2jig/xkqN7tn3u+dSlpxnrVN0dJyksN5XYWHgsthhHp/WHaSXQAKasG0IX?= =?us-ascii?Q?UMtQBZBoFYNnlDNRr24alC/LOMyCyRCJXfpy4zPeOPpUHDjrhXKa7AaETkIL?= =?us-ascii?Q?uh7t4u87SC9BPiHG/GdaFYdHva4ezWUSwg3CkbBVU4ytaZvx6eyP/tKEn8r5?= =?us-ascii?Q?wSSul8TlLHqo8mnng9qDdgN2IeZ9iinA7ONAdn2aUcxu8dE7pD1h1+9rZbuC?= =?us-ascii?Q?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cOI?= =?us-ascii?Q?pTHtwxBodD9iApB4EWWnrJ1cAlJoRyfMhm8PNvvPEsdMc1ptevq6HA2uW+Z3?= =?us-ascii?Q?EnfujW/KlCc/uTjoNMLdkC8miQ9Q9ES0wrCNPIV4/bubAZKudvK95xqFv1k7?= =?us-ascii?Q?aihvTBJdbsCLfsiTHLp+NXNgIP+LhJNWsrSqhgjpK+leiKlkpEKpyT/v7NwM?= =?us-ascii?Q?lmVF2aMPlxBFr5Mc8pr+uwvabgaDzGj7cEUzZdzQnUVo75ZpkcQPrvkF50MW?= =?us-ascii?Q?wF3WEiqIfTaJGW7oeUlcugb2LnF/wwpm/Hc4dnQzfvriqKO5P1LAkQedVxBZ?= =?us-ascii?Q?fGv55AYDElNDSjVo/vw=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB2619.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c188e0a8-7488-42b9-629c-08d9e9e69d9a X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Feb 2022 03:04:54.3339 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: TxdlzYlzeKtnYEubo5WYukrBNMTJw30oNF8I6L4O7L7hNsKz39bwrJ88QsEMY6Zp X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR12MB2642 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [AMD Official Use Only] Reviewed-by: Evan Quan > -----Original Message----- > From: trix@redhat.com > Sent: Saturday, February 5, 2022 11:00 PM > To: Quan, Evan ; Deucher, Alexander > ; Koenig, Christian > ; Pan, Xinhui ; > airlied@linux.ie; daniel@ffwll.ch; nathan@kernel.org; > ndesaulniers@google.com; Lazar, Lijo ; Powell, Darren > ; Chen, Guchun ; > Grodzovsky, Andrey > Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux= - > kernel@vger.kernel.org; llvm@lists.linux.dev; Tom Rix > Subject: [PATCH] drm/amd/pm: fix error handling >=20 > From: Tom Rix >=20 > clang static analysis reports this error > amdgpu_smu.c:2289:9: warning: Called function pointer > is null (null dereference) > return smu->ppt_funcs->emit_clk_levels( > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >=20 > There is a logic error in the earlier check of > emit_clk_levels. The error value is set to > the ret variable but ret is never used. Return > directly and remove the unneeded ret variable. >=20 > Fixes: 5d64f9bbb628 ("amdgpu/pm: Implement new API function "emit" that > accepts buffer base and write offset") > Signed-off-by: Tom Rix > --- > drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > index af368aa1fd0ae..5f3b3745a9b7a 100644 > --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > @@ -2274,7 +2274,6 @@ static int smu_emit_ppclk_levels(void *handle, > enum pp_clock_type type, char *bu > { > struct smu_context *smu =3D handle; > enum smu_clk_type clk_type; > - int ret =3D 0; >=20 > clk_type =3D smu_convert_to_smuclk(type); > if (clk_type =3D=3D SMU_CLK_COUNT) > @@ -2284,7 +2283,7 @@ static int smu_emit_ppclk_levels(void *handle, > enum pp_clock_type type, char *bu > return -EOPNOTSUPP; >=20 > if (!smu->ppt_funcs->emit_clk_levels) > - ret =3D -ENOENT; > + return -ENOENT; >=20 > return smu->ppt_funcs->emit_clk_levels(smu, clk_type, buf, offset); >=20 > -- > 2.26.3