Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1670124rdh; Mon, 25 Sep 2023 22:58:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHuxpMhcRT77hzok4qEAFWFxZwolPPRD7Vxcnvn3wICdvlvjA+FaXqP+B3OdHzMw2sYBssH X-Received: by 2002:a05:620a:ce7:b0:773:a9d4:e7f7 with SMTP id c7-20020a05620a0ce700b00773a9d4e7f7mr8250322qkj.16.1695707915158; Mon, 25 Sep 2023 22:58:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695707915; cv=none; d=google.com; s=arc-20160816; b=TT3xz8Cj8RIzEJwGLGuxZX5momVoiFKtnxtkwCoYeJrNnlZwAOtDBMFZ9Zy0rNEm8i udlH1i7jy0RkQmQVin3ijJwOLhkX2i9yT9BLlnaU2WGbG5j0aFP3CnvZeSzxzIXFCkdH WzkAS5EGcTagCD1dl7d/SGuh6UEGSNaiJccOqy40Fvx6olI+VplIieFWNw4WnCjJ2XBZ hNqLn0OHL4PMfCDoHqr3sakKsxLu5E+rrNk4qSzb/jSxvdg754WDE3mP7u2t8AP/xRd9 iNsoaLIw3N8uJccS9JjM5P+XKL6ZoRGKJszb+uj/T154Is5L0jxCITHhJgj54Qym14hV JiTg== 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.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id r15-20020a632b0f000000b00578ea9a0b97si11355048pgr.539.2023.09.25.22.58.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 22:58:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 6A32A814419C; Mon, 25 Sep 2023 22:57:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233641AbjIZF5p (ORCPT + 99 others); Tue, 26 Sep 2023 01:57:45 -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=20K=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 Content-Transfer-Encoding: 8bit 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 agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 25 Sep 2023 22:57:44 -0700 (PDT) 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, -- 2.34.1