Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2500571ybc; Sun, 17 Nov 2019 23:19:30 -0800 (PST) X-Google-Smtp-Source: APXvYqyf7rSEvFo1dmSNgcVnOi7IghcN+AMYyxsZWDyu9zONjClKdZ4RlbWsmKkifxbC1LBM+8+1 X-Received: by 2002:a17:906:1c97:: with SMTP id g23mr24702530ejh.66.1574061569958; Sun, 17 Nov 2019 23:19:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574061569; cv=none; d=google.com; s=arc-20160816; b=ddVaLG0rQ/mYBZvXUmT+LzcZrYbpBlE7vkt5qMNDyuMMr2DT5ORbp32PCe9LPoe+xL MST3vj2OTLaU7kEsKqKehLBa19+/k4VFIu8pTfiq+e+1HWeJ0i0sIdv4lx2oTjEuinFZ AqW/MdPn4fhWc4WTZnrcMDNjX9q64S2NVJuKutM9WHvya0SR4qEI8QdufdRxOXZxeQ2w jOi6WYbd5XEoVKKgl//2Hy/IkRukHQVurFptcUBE0pdDeHuFpE+yhZ1+mO4Li2wpx0KJ wkAqqzwrjjrLN8aKieFlw7kOpVqpkUf39U9lAzJHcaNee5PwQJhiUO9cSrlw62hqlFWT kduQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=Jhza1ptuviAjurBo2qa+2b847Vp9YQ4/ew4/TKm3gRE=; b=P06Y524YwqOWUix6ao7hsHWb/uSw8uQrxIKfPnlJq6Ot9dfXTnj9N5l4uhlEalalYb MPF+JPifcFj8suLaoRhdhqSShbmIz4vvZ2mRLJmdDrKEYTQA7hogviMqf1IBucyr9YAW 6LYkJGJdM16zRfDeIB+GuBrDhcYccXQCCzldg6OCkkKYQEsNmHvKSW46l6RHCUYI+wBv Zhg1taN2UrMs0Tq6vrGCxP4GeTGmnaEU6GVVbv+VrxFNZQN8hyQmn4ens84fH8M8neNm ogZeZLTFsNPu9GDVGlaPcvak7HRwHz1qO7+ovMd2ZrRlV+zkJAcgwZTRgP8ChEZanBy3 Gzbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g11si11276956ejx.212.2019.11.17.23.19.06; Sun, 17 Nov 2019 23:19:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727092AbfKRHQ6 (ORCPT + 99 others); Mon, 18 Nov 2019 02:16:58 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:40730 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726551AbfKRHQ5 (ORCPT ); Mon, 18 Nov 2019 02:16:57 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id F2F5518BF4F6297890BF; Mon, 18 Nov 2019 15:16:53 +0800 (CST) Received: from [127.0.0.1] (10.173.221.225) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.439.0; Mon, 18 Nov 2019 15:16:49 +0800 Subject: Re: [PATCH] drm/amd/powerplay: remove variable 'result' set but not used To: "Quan, Evan" , "Deucher, Alexander" , "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" References: <1573875799-83572-1-git-send-email-chenwandun@huawei.com> From: Chen Wandun Message-ID: <71d72dc4-5dae-2ae4-9f10-89cca72458da@huawei.com> Date: Mon, 18 Nov 2019 15:16:32 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.173.221.225] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org OK, it indeed should return the 'result' to caller, I will make a modification and repost the patch. Thanks Chen Wandun On 2019/11/18 14:50, Quan, Evan wrote: > Thanks. But it's better to return the 'result' out on 'result != 0'. > > Regards, > Evan > -----Original Message----- > From: Chen Wandun > Sent: Saturday, November 16, 2019 11:43 AM > To: Deucher, Alexander ; Quan, Evan ; amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-kernel@vger.kernel.org > Cc: chenwandun@huawei.com > Subject: [PATCH] drm/amd/powerplay: remove variable 'result' set but not used > > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/vegam_smumgr.c: In function vegam_populate_smc_boot_level: > drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/vegam_smumgr.c:1364:6: warning: variable result set but not used [-Wunused-but-set-variable] > > Signed-off-by: Chen Wandun > --- > drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c > index 2068eb0..fad78bf 100644 > --- a/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c > +++ b/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c > @@ -1361,20 +1361,19 @@ static int vegam_populate_smc_uvd_level(struct pp_hwmgr *hwmgr, > static int vegam_populate_smc_boot_level(struct pp_hwmgr *hwmgr, > struct SMU75_Discrete_DpmTable *table) > { > - int result = 0; > struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); > > table->GraphicsBootLevel = 0; > table->MemoryBootLevel = 0; > > /* find boot level from dpm table */ > - result = phm_find_boot_level(&(data->dpm_table.sclk_table), > - data->vbios_boot_state.sclk_bootup_value, > - (uint32_t *)&(table->GraphicsBootLevel)); > + phm_find_boot_level(&(data->dpm_table.sclk_table), > + data->vbios_boot_state.sclk_bootup_value, > + (uint32_t *)&(table->GraphicsBootLevel)); > > - result = phm_find_boot_level(&(data->dpm_table.mclk_table), > - data->vbios_boot_state.mclk_bootup_value, > - (uint32_t *)&(table->MemoryBootLevel)); > + phm_find_boot_level(&(data->dpm_table.mclk_table), > + data->vbios_boot_state.mclk_bootup_value, > + (uint32_t *)&(table->MemoryBootLevel)); > > table->BootVddc = data->vbios_boot_state.vddc_bootup_value * > VOLTAGE_SCALE; >