Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2526632ybc; Sun, 17 Nov 2019 23:58:11 -0800 (PST) X-Google-Smtp-Source: APXvYqwST+P6aS5ZPU1UZNLaFHKiGh4dq/8pwXdwQ/T0Qdirs8e7XIy5t6lWb0rIRJpX+tuV7rhH X-Received: by 2002:a17:906:95c4:: with SMTP id n4mr24578582ejy.39.1574063891652; Sun, 17 Nov 2019 23:58:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574063891; cv=none; d=google.com; s=arc-20160816; b=fb3dbxSY6x+ixyLNRUTdLb0IPAYZUEk9zUfqphj/FZY9J6WO1x5WwURrioQuS7f0hl Dvz9cKrVESLVcrAJDs2LOxadQdrlKO/muH73oYvaPibGz6zDxqeg4TmC1BoHkgwhXztv 4RpgyagEBQ+Oy9fL9eIkGpSJK8qqT9IDIbHYLHRH15JlD+BymfQyH34Y3JqOZTCqsE9s ZxntAbqAMN1CQjvMqJqcFLTsegq56qOBkzS8cOmJE0F5uJG9pWddN4/YAb0YHJh6A1J+ +WTOIcbCRwb9B3a1DrOr3pGB6saPOpKdHVURpmWJW6qRCIfjBPCWHcya91ionoANCcmc Z88w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=eV9agf9mr2Yv6ovKwW76N3xUplYobPP7VFJQ1ujLpYw=; b=0dIY8FPTF9FmoOb5xlXNuhCS9j2m2v3ScqS+p3mQZIl9qwmqDcFeA2/r4nfz+Z3l+h J6blh/rH0fzL7ZhGD31IQryqri5Oa6sgiLRq5hO2E56EcdS4mZDUQLQU+xeYYvSYiHoL hf1PmkslOmo+CxjgNP92lz9TQTQFoX/4isuppgNubiGtUi60P8sjM9n8gA9naFaJsA/o qwxKJtTTNMOjT30gihwIixUA6sC2jyTGAkMmYEtpMbXoM5+gNI/wh92a/hXyfxTjQdYj BUIPfFIl7jIV7c81q83z/F6KltUTOeaD5AvqQvrzqrZWuNHRqR9dxwfnEGjHvmyS7Loe /q8A== 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 a4si10607579ejy.439.2019.11.17.23.57.47; Sun, 17 Nov 2019 23:58:11 -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 S1726435AbfKRH4l (ORCPT + 99 others); Mon, 18 Nov 2019 02:56:41 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:6692 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726315AbfKRH4l (ORCPT ); Mon, 18 Nov 2019 02:56:41 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 53A43BAD1F679704F9BA; Mon, 18 Nov 2019 15:56:39 +0800 (CST) Received: from localhost.localdomain (10.90.53.225) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Mon, 18 Nov 2019 15:56:31 +0800 From: Chen Wandun To: , , , , CC: Subject: [PATCH v2] drm/amd/powerplay: return errno code to caller when error occur Date: Mon, 18 Nov 2019 16:03:34 +0800 Message-ID: <1574064214-109525-1-git-send-email-chenwandun@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573875799-83572-1-git-send-email-chenwandun@huawei.com> References: <1573875799-83572-1-git-send-email-chenwandun@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org return errno code to caller when error occur, and meanwhile remove 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c index 2068eb0..50896e9 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c @@ -1371,11 +1371,16 @@ static int vegam_populate_smc_boot_level(struct pp_hwmgr *hwmgr, result = phm_find_boot_level(&(data->dpm_table.sclk_table), data->vbios_boot_state.sclk_bootup_value, (uint32_t *)&(table->GraphicsBootLevel)); + if (result) + return result; result = phm_find_boot_level(&(data->dpm_table.mclk_table), data->vbios_boot_state.mclk_bootup_value, (uint32_t *)&(table->MemoryBootLevel)); + if (result) + return result; + table->BootVddc = data->vbios_boot_state.vddc_bootup_value * VOLTAGE_SCALE; table->BootVddci = data->vbios_boot_state.vddci_bootup_value * -- 2.7.4