Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp406053ybd; Sat, 22 Jun 2019 06:00:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxGjRyOaNzKPgHHmHjiDBjORw930w1FTKq/l4mloW/VUrwl0lvSnIt+uBlaH9V2wx+bTcg X-Received: by 2002:a63:c60b:: with SMTP id w11mr3007246pgg.356.1561208437365; Sat, 22 Jun 2019 06:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561208437; cv=none; d=google.com; s=arc-20160816; b=TG/MF3/vWnU9DXD4BJTvB1XRfONQF/w6d1PBcqsaIFqDXVV+M9qJRHb/RxKeAbtxyv avhG9Y+djEY9BVZNyKCwulkLXVxmNJ8kCZkxQN/Go9MxuGkzKs0SFHf5wP7lC71b8E9L To31ZliiS4kT5s10xmzYTW/NVKeaHh10BdhAOU7crthzdYXAY+cTa4gKsQwEe3zJ+vNh yTnHvu53McVf1FvutREmU0Cm9BKlvytF9bj1Vc4jnsFpQ5NvzhiDeeJoZw9eJdy2CO5X jZA1DCLGDlY2i85HgjXBfm1TVoWkWH7z/15sNKOigKN+5P4nSD4OIy3XLj+903hxixLN BcMA== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=kW+ghsF0HbXLHsFvEj3r1NTF1tnSSPuUbl0XJDr4tWo=; b=eIFAbOdWNnBwV02yrfFk8LibIXBWfjpoXr3SL3JMTxBn3NTb4CZT0twJA/u451IUQf B7s6T9nvEik0ke6s94CBm9Q0zepfKfnZtl/6DeRHcBELGCBGP1BFkONsgMiOaghI3iw3 j7KIoW8WBLBbF9DooSL/Nah87G80JA6/UzbrEGIa+U5yv3ULG0YninwDliBcByLwVKzS EnY2VshetRLXu8CBQSkVHryeCcJtwExU5cN0cowW4YzPkTKSctLa5TvWL+bn7fQiIzVY SGjdukP7jw38hvrabrfV8LzdRl7x3YH3g4I1JuRU3beeTdvz7WCIars8oRNkH670q4Ae IP6g== 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 f6si4988569plo.382.2019.06.22.06.00.11; Sat, 22 Jun 2019 06:00:37 -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 S1726310AbfFVM6p (ORCPT + 99 others); Sat, 22 Jun 2019 08:58:45 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:19058 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726286AbfFVM6p (ORCPT ); Sat, 22 Jun 2019 08:58:45 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 2EA12DE6D53BC5843FA8; Sat, 22 Jun 2019 20:58:42 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.439.0; Sat, 22 Jun 2019 20:58:32 +0800 From: Mao Wenan To: , , , , , , CC: , , , Mao Wenan Subject: [PATCH -next v2] drm/amdgpu: return 'ret' in amdgpu_pmu_init Date: Sat, 22 Jun 2019 21:05:27 +0800 Message-ID: <20190622130527.182022-1-maowenan@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190622104318.GT28859@kadam> References: <20190622104318.GT28859@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is one 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; ^ amdgpu_pmu_init() is called by amdgpu_device_init() in drivers/gpu/drm/amd/amdgpu/amdgpu_device.c, which will use the return value. So it returns 'ret' for caller. amdgpu_device_init() r = amdgpu_pmu_init(adev); Fixes: 9c7c85f7ea1f ("drm/amdgpu: add pmu counters") Signed-off-by: Mao Wenan --- v1->v2: change the subject for this patch; change the indenting when it calls init_pmu_by_type; use the value 'ret' in amdgpu_pmu_init(). drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c index 0e6dba9..145e720 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c @@ -252,8 +252,8 @@ int amdgpu_pmu_init(struct amdgpu_device *adev) case CHIP_VEGA20: /* init df */ ret = init_pmu_by_type(adev, df_v3_6_attr_groups, - "DF", "amdgpu_df", PERF_TYPE_AMDGPU_DF, - DF_V3_6_MAX_COUNTERS); + "DF", "amdgpu_df", PERF_TYPE_AMDGPU_DF, + DF_V3_6_MAX_COUNTERS); /* other pmu types go here*/ break; @@ -261,7 +261,7 @@ int amdgpu_pmu_init(struct amdgpu_device *adev) return 0; } - return 0; + return ret; } -- 2.7.4