Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3983019pxb; Tue, 25 Jan 2022 00:38:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFGw3IjjF7lZoRAb1N6BO07b2x2GHQ/Qf1W5RgsKzXVYgnn/bcl5kHdkJ0iue7ndlAa794 X-Received: by 2002:a17:906:5d16:: with SMTP id g22mr6022483ejt.520.1643099904542; Tue, 25 Jan 2022 00:38:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643099904; cv=none; d=google.com; s=arc-20160816; b=RrXGbd7Ln4jBdtupz0RQ2hA2QfZy6s4HiNX4cx5jnEWe5ATNrEe6tmiz13i6riAOqa lg8cP9nKw/2iFpPFuiSrlZVPDLvh2kuJCNQYZbj+XTF/Y/U34amnAZz6P6QlM93ITj/5 bQ0PGTeCJB6g2cfClh3PIJcI3labr1lN0jF4ysd/TUslA8z0e4cTie8RKr/Ssp8In4Hw 7FYqkqVCs0GgYpRakDytE32hzu8ro/+hQdOogXLrJ793flWVoVlD54h+mfi2rHOKT6DF Sp1wWm8TgCJADScEd7Q4u5u3N3QrkwjQTt4vdyda7V/4z7Zcvnlc+OT3kQ9vb0AIpiwA avsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=5AU7UHXWGTgXus+jcgLu4tYknaJHqkDWYn1T5acuUH8=; b=y6sRiC3QdfIMu4dCu0kbr93YgD8jgjkUEWntYQ1UojbAomUSa1v71w7T0Ft7RqOCpX Xk8v8/JXyXc03xw3HANIShog8gn2x1I0v8J3/aVpC2QRsMpXApVC0NF4A/54oms70tB3 GWtkYAO6vyTQ6kXcJZbgOwIkp7vG7RHe4jTEuLpcoGZGlDQcw3Rr/H/pp8uaaZhkEs7e MKfIG8U46A5CtFnRmPmfI9fXorakktJ9kabdLyLKWZfA4kA/3A/c6nHyTsnnH9Z/0yMH ashoCTxxGtKPM/UMAXLjHKgkZ1QjU5GZndg+iSbwcHQhKvSNcGlVzUgEn7fvBcF9hxDh CArg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="NMM7a/yj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 27si9204083eja.324.2022.01.25.00.37.59; Tue, 25 Jan 2022 00:38:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="NMM7a/yj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1315871AbiAYCyt (ORCPT + 99 others); Mon, 24 Jan 2022 21:54:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S3409660AbiAYA1J (ORCPT ); Mon, 24 Jan 2022 19:27:09 -0500 Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71F41C0C6864 for ; Mon, 24 Jan 2022 14:08:40 -0800 (PST) Received: by mail-ot1-x329.google.com with SMTP id m8-20020a9d4c88000000b00592bae7944bso24246165otf.1 for ; Mon, 24 Jan 2022 14:08:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5AU7UHXWGTgXus+jcgLu4tYknaJHqkDWYn1T5acuUH8=; b=NMM7a/yjJoWOPQjiTo+SdO9A7Y7k+6dqKIG3Kq3o8dz5RSoZ1W2vD77yq2K3z1Nxt4 2Qn4P18bkaT2nk5dsqlPUyMhY/TB3Qoo6FJRy1W+8sr33cSUmBdktRvJMckxtUpC7ev5 NS4RFF6uAiFsuqMj/uJEnwtonchUz8WDNLz/9Wj0/0qE5/gDqlonX/RwX/0T7sfOjJsJ mIRTYh6QH+zNutWNdWHCUp+LbnJaxAVIF41PJPKVg7CoHdgjKGgvoNgaGqzpbgr4/4Ox X1OrHW75bzMi9cF1nNAmFxIVFjO2qiS8K+uCqfqG980sJeDjyS8uL0x5tfK1XA0vq274 2OwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5AU7UHXWGTgXus+jcgLu4tYknaJHqkDWYn1T5acuUH8=; b=KbJDaLLvVU+WglUBj+dYRQPoJ1iDOkrsiLSohR60XG5u7xi/m47RKdbOpA7gBFSCCz G0Xc/z/978zOoecCDi5zxr/y4cNY7vJ+vo2YC6IHSQNWNxW6y05KCwri4Y6nShRKVnvJ mZlZe8Pf5pNY0/KIhWXwmrNWajlh6I/+SiAqR0qjvYxrYNTOA3hOSBncx9m3+6QdW6NG S55pZUgipkztcoqf4TFOzZSqCtv15USun5Ud0BE1JlwO1Nfp/gGdWpGNcaMB4qRtxNX5 12XZm+BWZWCu1tE9VqZ4ZY53K1VfLPjX9oGmHp/R6QC5AJvzECYNt9i30WuhE69H2x/D 8sOw== X-Gm-Message-State: AOAM533RruNJBG9Pc//jqQBvfYfgP8Vk8UpLgWbpO0x+R8bkN8+mKzc8 j2rbyhQkVq1td+zKOV8QvDjV+Fj5DWobpXypKJk= X-Received: by 2002:a9d:601a:: with SMTP id h26mr3605702otj.357.1643062119806; Mon, 24 Jan 2022 14:08:39 -0800 (PST) MIME-Version: 1.0 References: <20220124201812.1078824-1-trix@redhat.com> In-Reply-To: <20220124201812.1078824-1-trix@redhat.com> From: Alex Deucher Date: Mon, 24 Jan 2022 17:08:28 -0500 Message-ID: Subject: Re: [PATCH v2] drm/amd/pm: return -ENOTSUPP if there is no get_dpm_ultimate_freq function To: Tom Rix Cc: "Quan, Evan" , "Deucher, Alexander" , Christian Koenig , xinhui pan , Dave Airlie , Daniel Vetter , Nathan Chancellor , Nick Desaulniers , "Lazar, Lijo" , "Powell, Darren" , "Chen, Guchun" , Arunpravin , Andrey Grodzovsky , llvm@lists.linux.dev, Maling list - DRI developers , amd-gfx list , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Applied. Thanks! Alex On Mon, Jan 24, 2022 at 3:18 PM wrote: > > From: Tom Rix > > clang static analysis reports this represenative problem > amdgpu_smu.c:144:18: warning: The left operand of '*' is a garbage value > return clk_freq * 100; > ~~~~~~~~ ^ > > If there is no get_dpm_ultimate_freq function, > smu_get_dpm_freq_range returns success without setting the > output min,max parameters. So return an -ENOTSUPP error. > > Fixes: e5ef784b1e17 ("drm/amd/powerplay: revise calling chain on retrieving frequency range") > Signed-off-by: Tom Rix > --- > v2: return error instead of initializing min/max > > drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > index 5ace30434e603..264eb09ccfd51 100644 > --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > @@ -116,7 +116,7 @@ int smu_get_dpm_freq_range(struct smu_context *smu, > uint32_t *min, > uint32_t *max) > { > - int ret = 0; > + int ret = -ENOTSUPP; > > if (!min && !max) > return -EINVAL; > -- > 2.26.3 >