Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp107563ybd; Fri, 21 Jun 2019 23:03:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7DXnDdlhO8jFWiUfvicpy445XkBCaXAS9+Ehe4Hu9oDlqqzltdYaTZt5i2P7+tAW9PAmq X-Received: by 2002:a63:f95d:: with SMTP id q29mr22091915pgk.368.1561183404591; Fri, 21 Jun 2019 23:03:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561183404; cv=none; d=google.com; s=arc-20160816; b=a/Gw1KFpHhDBzTdf4AFdlBDNiD9aqMa/SndEXxqmqYIMsPeDkbdiuvFjWSz8Jl1b66 oYSiTXC0i24bM5NefAIl7oS0d5Do6uLbv/1gQv6p51dzT3vLNVSAVDoRHhzFl/8DIsm5 Ssijb67+hkc5b91QOCYZqm3d3HNKDavZSMLNJEJGh0AyhWeErGzIeAl3fXGvCJdgAcFu zyRoHrqX0bhyjop3N+GTT8vjXn2vqfgkPl99w3Ghb2frWn+xakUxlEFrbXtDSWcN/JbE GTYgsM9+4ymWN2B+g6OA9WTSkXDmAQgkOG60sGTNiJ+ZiStWvqAPY5QJEVAs7BLK38+O IOvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=DAHpHqQxF6cs+woTq8VNG6mxGCYdSp23EiKPZSvu8K0=; b=jShVfwTWIUNY6LUBBTSqNqLBHmR4QK+geidbVrgx626anPP97eyKi80d2Cc9oZroLh gO8Xp2b1z2ABGQPIS18kioE1uAFTUWWnfCYNYawyxWwS39rft51F44mKGiQmGx4HOicW rIqNnZEUeEG/JpXWfGGXkNxqQyLNVPJgaSSp029v+wJoj0P+8u5ZwIi9Z9pF17JBA7BS DhRveXB0FnmY8A3CQ8xJ1DjJlnyAcbHxjH9PagkQsBLX41gFOYrGwhyO2Il2dpjh6tWV cPtGtXX/7/KHpmCrYNTtWTdap7kYVYkXopb48D9Vnc/3kZ6DaSgz3uBcHoGSgHiaZy4Z 0LOA== 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 v19si4682029pjn.96.2019.06.21.23.03.09; Fri, 21 Jun 2019 23:03:24 -0700 (PDT) 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 S1726111AbfFVGCU (ORCPT + 99 others); Sat, 22 Jun 2019 02:02:20 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:55312 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725932AbfFVGCU (ORCPT ); Sat, 22 Jun 2019 02:02:20 -0400 X-IronPort-AV: E=Sophos;i="5.63,403,1557180000"; d="scan'208";a="311051050" Received: from abo-12-105-68.mrs.modulonet.fr (HELO hadrien) ([85.68.105.12]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jun 2019 08:02:16 +0200 Date: Sat, 22 Jun 2019 08:02:16 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Mao Wenan cc: airlied@linux.ie, daniel@ffwll.ch, alexander.deucher@amd.com, christian.koenig@amd.com, David1.Zhou@amd.com, kernel-janitors@vger.kernel.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] drm/amdgpu: remove set but not used variables 'ret' In-Reply-To: <20190622030314.169640-1-maowenan@huawei.com> Message-ID: References: <20190622030314.169640-1-maowenan@huawei.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-406165930-1561183337=:3253" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-406165930-1561183337=:3253 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Sat, 22 Jun 2019, Mao Wenan wrote: > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c: In function ‘amdgpu_pmu_init’: > drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c:249:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] > int ret = 0; > ^ > > It is never used since introduction in 9c7c85f7ea1f ("drm/amdgpu: add pmu counters") > > Signed-off-by: Mao Wenan > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c > index 0e6dba9..0bf4dd9 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c > @@ -246,12 +246,10 @@ static int init_pmu_by_type(struct amdgpu_device *adev, > /* init amdgpu_pmu */ > int amdgpu_pmu_init(struct amdgpu_device *adev) > { > - int ret = 0; > - > switch (adev->asic_type) { > case CHIP_VEGA20: > /* init df */ > - ret = init_pmu_by_type(adev, df_v3_6_attr_groups, > + init_pmu_by_type(adev, df_v3_6_attr_groups, > "DF", "amdgpu_df", PERF_TYPE_AMDGPU_DF, > DF_V3_6_MAX_COUNTERS); Maybe it would be better to use ret? If knowing whether the call has failed is really useless, then maybe the return type should be void? julia > > -- > 2.7.4 > > --8323329-406165930-1561183337=:3253--