From patchwork Tue Sep 26 05:56:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cong Liu X-Patchwork-Id: 144732 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp1695822vqu; Mon, 25 Sep 2023 23:00:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGEfiRAZwXGjbftIA53sY0soLLy0saS1btdDfNvJPQOJfv9Eh0zs50zF89epbUjr4sl79tR X-Received: by 2002:a05:6a20:101a:b0:14c:4deb:3dc4 with SMTP id gs26-20020a056a20101a00b0014c4deb3dc4mr8299604pzc.31.1695708017335; Mon, 25 Sep 2023 23:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695708017; cv=none; d=google.com; s=arc-20160816; b=g5NXap0h6LOFkPok2GZ2ykGFO9z0QoNZWeW6AtR/C1CbR0NVWYF6/aak1n5uJB7+N4 at04GL2/Le1hS7W1sd2YCq36hUFV8saSN92eNYcxccSTaB7FxFtnEXJdRgpWIQDgXOUf 5PvKVPTufwmLPhl8ge+sC72MRGPQbN4q5i3F6r9divXhaykZh1F6PSA0xb6R/qwU2LcQ MZCFjvVMz76Z2C5s0WavjsL6UiNFwyVpmmSgX0kMtj6iGNF5zj/35UNTYcymrdC+tlJF KRbOPLJKm4hRRmIgGxIzwq8KeHcacDX8oeFhe3LKyEYBgODlA7cqlKvzdOjfi/uGck6+ NvsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=1nFLTXHceDFowM97RDTgoUvFaY5dCPOGFEwf/4IJ540=; fh=0QQLjqh88xLC7/w3eBA7W8xxPTWF4qtbLmiYGDQcJtA=; b=cEc4gBQ36lern4sogB4HRHXsH5PdV3x3jBoInLar332paliRYcGkmvAhuSL5j0+crC 6p6l91PMOJUMLxuJPo15tV4PBAcwOkxwCQTpM71ztWRWnXIlHoAkzkUBXTRdKY8v5W4I gcEDUfSvSgupmaCu+QVzQbrx7miB4BVYldqZ4UyIl5VcJ2EAyYOgx2OknJu8PUjA59xF 4OVv1QZ2rz24FYhHYLl5Fa8mxji3su6qaTg8RDNC2uZkg7oaxbEKKLsPgjb5dKqaqWlB 6Pep0+epnRjp4iuvdNXd20CBFGkf+2mr2ADwZfR5HGqdVcui+/qX8i4kjWHv4Cnycjgi vOvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id m11-20020a170902c44b00b001c6183af4d3si4344288plm.332.2023.09.25.23.00.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 23:00:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id B180280BB5DB; Mon, 25 Sep 2023 22:58:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233689AbjIZF5q (ORCPT + 26 others); Tue, 26 Sep 2023 01:57:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231466AbjIZF5n (ORCPT ); Tue, 26 Sep 2023 01:57:43 -0400 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1F389D for ; Mon, 25 Sep 2023 22:57:36 -0700 (PDT) X-UUID: 3c5ed56bf6c94e699b45d29275fdf15f-20230926 X-CID-O-RULE: Release_Ham X-CID-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.31,REQID:62cae887-a010-406f-b0cb-62e849e7dd42,IP:5,U RL:0,TC:0,Content:0,EDM:25,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:15 X-CID-INFO: VERSION:1.1.31,REQID:62cae887-a010-406f-b0cb-62e849e7dd42,IP:5,URL :0,TC:0,Content:0,EDM:25,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:15 X-CID-META: VersionHash:0ad78a4,CLOUDID:ed0b47bf-14cc-44ca-b657-2d2783296e72,B ulkID:230926135702CTO4OX2J,BulkQuantity:0,Recheck:0,SF:24|17|19|44|38|102, TC:nil,Content:0,EDM:5,IP:-2,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0, OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-UUID: 3c5ed56bf6c94e699b45d29275fdf15f-20230926 X-User: liucong2@kylinos.cn Received: from localhost.localdomain [(116.128.244.169)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 1803900476; Tue, 26 Sep 2023 13:57:02 +0800 From: Cong Liu To: Evan Quan , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter Cc: Cong Liu , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] drm/amd/pm: Fix warn: missing error code in smu_v13_0_0_check_ecc_table_support() Date: Tue, 26 Sep 2023 13:56:59 +0800 Message-Id: <20230926055700.119576-1-liucong2@kylinos.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 25 Sep 2023 22:58:09 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778078729910336471 X-GMAIL-MSGID: 1778078729910336471 This patch fixes a smatch warning: drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_0_ppt.c:2868 smu_v13_0_0_check_ecc_table_support() warn: missing error code? 'ret' This warning is caused by the fact that this function returns the value of the variable ret. However, the value of ret is not explicitly set in the function. This patch fixes the warning by explicitly setting the value of ret to 0 if the device is supported Signed-off-by: Cong Liu --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c index 9ac2be5627d9..cf832cef2b0a 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c @@ -2863,11 +2863,11 @@ static int smu_v13_0_0_check_ecc_table_support(struct smu_context *smu) if (ret) return -EOPNOTSUPP; - if ((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 10)) && - (smu_version >= SUPPORT_ECCTABLE_SMU_13_0_10_VERSION)) - return ret; - else + if ((adev->ip_versions[MP1_HWIP][0] != IP_VERSION(13, 0, 10)) && + (smu_version < SUPPORT_ECCTABLE_SMU_13_0_10_VERSION)) return -EOPNOTSUPP; + + return 0; } static ssize_t smu_v13_0_0_get_ecc_info(struct smu_context *smu,