From patchwork Thu Aug 27 05:24:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 248421 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp125231ils; Wed, 26 Aug 2020 22:24:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxf+hW+3QRKLGNSteFXtbg7I19FhKhIx2l9VBKeU1H1jPfhHwDJfoDtuSb+BAySApM/9AQr X-Received: by 2002:a17:906:c187:: with SMTP id g7mr20122144ejz.108.1598505864049; Wed, 26 Aug 2020 22:24:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598505864; cv=none; d=google.com; s=arc-20160816; b=vS/U76dvfX30pOAAV7eSqkKmAMpb7T2E0LS/N79GvQ4rTS8MsB1su2ol5tVxyCV1rZ 0SoyQcxILfCAL7cnTmtkPHouVHewc7AaDalbTKMDBCSh0qChcoeHpC7zgUlgqjUpplyt 5HR+Br4RG0+WDosUG+kQpK0m6HX9ZzLUtCK4/WbO7PRcdCZSxhi/vEvNF92QazsMXzt/ DUUppRPyZepS3d7c4QIA8mrKyno30GpmOCetZXEmdp1UmkJ5CVPAHY2Wko1nfjyGLKUe nQhJICxbPhNS/b/R70wxdgfxMm3gSGaRg4kBXHbln1MGvnvJX+D55O5Uwjl/UjONskz1 I9OQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=fWnOmZQiE1diGG7f4xMEwIVX10lb7UFm+giUYyHedJQ=; b=WAqz4Nks/RM4BAQaADCeR+D/FzTTu96QJQpX8KvMcK6zLr8QG4+N1onXNhwvouzbBT EHrjvDVQ2jM4vNsKs6bolEEBBQKICYOhOlaHP1Bvex4PXcXzwf5RUROpheFpHjWVA81D gSGJpuKzCzkty0gUQ1zX/OUbtLhw1Mb/6MfsGETBuBPVAjdJZmvA0AcdtUBtvh4t1a61 xbLylqGDmB9YqcMhFJo651HpKGZlISXD6gffG70VWz0rQMFntHu0bYsuS0d1ERxe00qo gLwtnRo4O41URZfA+LNbAbcXT2sZj3vmo7KoqKEGofDfl7WKFzdgyC0QGkWEfnwYnplO SEvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kRaZNdmG; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x17si806726edi.428.2020.08.26.22.24.23; Wed, 26 Aug 2020 22:24:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-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=@linaro.org header.s=google header.b=kRaZNdmG; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726070AbgH0FYW (ORCPT + 10 others); Thu, 27 Aug 2020 01:24:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726028AbgH0FYW (ORCPT ); Thu, 27 Aug 2020 01:24:22 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56249C061240 for ; Wed, 26 Aug 2020 22:24:22 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id i10so2533277pgk.1 for ; Wed, 26 Aug 2020 22:24:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fWnOmZQiE1diGG7f4xMEwIVX10lb7UFm+giUYyHedJQ=; b=kRaZNdmGKAg4HLrE/uGXgzjrobjeg9t/Pk1pY/YiXJZG9LKcE3HWgvpc4pXBQdT/Dp BaxA6FsrvZamlFnpGRQfXE9kC616WOSDQ+UkXmHO/nVFHtVRF3KfvAlKf0HVXh4O9ED3 RpTwruLbf3b8F+mcY1Z9kMuuz7h6G9SICrgihKOAfx8BPtrYjBw9dDEDjZ3f2Y2aCD7b /uQWeevM+9Lk0bvjrRJMSn9D+v/jHpvXY+fyM2NVl5fuXGJMU35CMX3EOqBr5vRBq9gw cUI0oG4KZ6HRY4MaES8SY9+2m1Wx2QSkcsw8LU7zafJbDKf4IVnSwo9VMnNgBjCljAp4 OBqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fWnOmZQiE1diGG7f4xMEwIVX10lb7UFm+giUYyHedJQ=; b=cbRK0xmUzKNknkNA/85R581Mrtr0xSsjodNiUSZfNPZj8JvEG5LsxvOBixxngyTeHg FDBUU90IagVi5l8p0w4WRRsMUS59DAimNZpN5u70a8maKpSiWb0zv6Tuy9Xi6Fe1/wYM KA93VnLmCIK+1zX5MYtjh5ZqEcSt0Sm0hX5Fa6YXeFPov9RqXaDycf2+nKY3Tt3JR7ww pJN6XX2yS4fC4YlJemGbF4PiFs7H9XQgk3lmHweNva6Ge0eH19Sg2/XTFkN7ILpl8eh9 /1DrhxQ25FZu1yuWaNHHA8p3EwbhEhiQkDjjoAH1GyAah3T39bGWWrGKNQ+6XjMa1RTz R77w== X-Gm-Message-State: AOAM531HFtTuTPcOtrOKaguCH2WrKuqbnTKBWaL8XRO2c6pEBZYnkrRb 13jvJx3PbVf7zGFWof8+MN4c1Q== X-Received: by 2002:aa7:91ce:: with SMTP id z14mr7473320pfa.241.1598505861790; Wed, 26 Aug 2020 22:24:21 -0700 (PDT) Received: from localhost ([122.167.135.199]) by smtp.gmail.com with ESMTPSA id mp1sm858405pjb.27.2020.08.26.22.24.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Aug 2020 22:24:21 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] cpufreq: No need to verify cpufreq_driver in show_scaling_cur_freq() Date: Thu, 27 Aug 2020 10:54:15 +0530 Message-Id: <906198d77aa73613a1b588425aa45e5025ee60cb.1598505843.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org "cpufreq_driver" is guaranteed to be valid here, no need to check it here. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.25.0.rc1.19.g042ed3e048af diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 02ab56b2a0d8..47aa90f9a7c2 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -703,8 +703,7 @@ static ssize_t show_scaling_cur_freq(struct cpufreq_policy *policy, char *buf) freq = arch_freq_get_on_cpu(policy->cpu); if (freq) ret = sprintf(buf, "%u\n", freq); - else if (cpufreq_driver && cpufreq_driver->setpolicy && - cpufreq_driver->get) + else if (cpufreq_driver->setpolicy && cpufreq_driver->get) ret = sprintf(buf, "%u\n", cpufreq_driver->get(policy->cpu)); else ret = sprintf(buf, "%u\n", policy->cur);