From patchwork Mon Jun 29 10:04:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 192010 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3214317ilg; Mon, 29 Jun 2020 13:48:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWAWGpsEuzLq1JVQGZHP7n03HlPtwsuV84zz90tH6HptsikAfOoxpaNmfvnafkvtMq9Cq0 X-Received: by 2002:a17:906:29d8:: with SMTP id y24mr15395900eje.212.1593463692540; Mon, 29 Jun 2020 13:48:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593463692; cv=none; d=google.com; s=arc-20160816; b=gl4hj6AuCjp+uTV9zqOnVlosoBPBaGVIzC54QuLxTDhuaNP5NevIxfMRTa96zYRISz Q9+3NW0Flee0I0gUhAkpgVDGzzZRJ3De+40k1YEBRaGRmQZ4HzDKv4RKh6VyGkvHrgH2 q0JyNRAl95l5Rcvh6oflI61dHZ6j4b39QWBxJRStSo6Z4PhgxXgOCwrFgKCSixQjXPIm 07ScwxBcA/qPcTTCnhbQatBtErNFodpCLKcI9XzgTfjW0VTzUXW/itB1lFGmkV8KXV8K NQR1uBDP7aE9phKHRYB01CfhLPGePcOPKnanBS+EZ77nfn2i3s3D3ZEoq2/NrOD8Qqh6 XlUA== 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=ly6GQY518rugBZBKaypUfjaHtOs18Gvlz/xTQcFP+uo=; b=PSLqRv5BmHnkGHtR3JcaS4E8sszwTfQU8Um/z9OdIlS4YrpkeVckEagxvsQHr+Qu/D lDEdJM8WNKJfbjK5bOlOZmzrfTa3UE/D+iQZ7eLIvdX5YvMfBD7Ht5o+D4GfXCIDSbIm AOWXhAt+GEMeUkGGMraH0G9PKTdy0vv8eHGqSl+BQP2KCPKSCcRukpFES68J5xjzupyz +hONQYymnCFfO6J3Hcv7ZZpZWXB6h5LQ+trcGkF9+CyXPI2j9n+PIyMk362pMqsoFfYQ wpSBxgafnnY0CX8Qev8z+vrwyH06hjaUQtQkShCwqf7JYNSb8DAJMMEbb/kc7mGKk0Oa WxEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="FwlutL/Q"; 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 bs20si385829edb.444.2020.06.29.13.48.12; Mon, 29 Jun 2020 13:48:12 -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="FwlutL/Q"; 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 S1729268AbgF2UsK (ORCPT + 10 others); Mon, 29 Jun 2020 16:48:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731538AbgF2TNw (ORCPT ); Mon, 29 Jun 2020 15:13:52 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 630CFC00864B for ; Mon, 29 Jun 2020 03:04:45 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id j4so6915979plk.3 for ; Mon, 29 Jun 2020 03:04:45 -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=ly6GQY518rugBZBKaypUfjaHtOs18Gvlz/xTQcFP+uo=; b=FwlutL/Q/eEKYRihTTqlzWcZE7NzatpA+2aRZl4vnE+PQ+Ig5lMtw6ZACAqglZLEfo yuSIol4GzaOVt6nQHLF+YD63riXx/XSOQIrc68BaP0Cw9GDXvs/1/072SiY/Mbv+WIG7 6ED9NmAMHgEzeBjHu2WzoZYxF6I/QKzrgiFapmGeIgP5UTs17yv0rEDiliHlkQLqDhen fLrb6m/PGZD87Yiw5zsGWeyZfeW11GjUaK/4QedXpAeknQRRdB7gfHi6NyaQmOXa0e/t 7xpM8idGeiC4zW2IWrvgnrXun960Lkyd/5OgqGfu/0iUjZHRNyvbtFXO0RVv5BxHJCMl iM7g== 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=ly6GQY518rugBZBKaypUfjaHtOs18Gvlz/xTQcFP+uo=; b=eK78qOg3dd3u0090Ampdy/N6/O9rRkBsMjWnQqX/Jls/mXQxY389EE7lW4lAqpeaej nyLwX5+7kBBA6hcXuVM1JFmPBeeRMFaaSkHFHgnbWpClX4OqpGD8HGKiIlfkZzTIrOI7 isMu6glOrWl1Ors/zw7dboXZqUAzT3bh7fsoAM/XYYw9bhlkt5BYquXSrbPzVb0yZhHg JSqUKl/cYCGkPaErIur5M+m5DWV0NYUvPuXMaVXDGmTzCiba7Ny68g4asb7pRgH1fqty sx+5tXqc8wknxY/Jz8TUlR2jkRw1o81Xo/whMSxG+J5aOOa2PlNu5NdCaYRjNN7Mshxw AmhQ== X-Gm-Message-State: AOAM531WR40meQddqCA0D6CHu6/o2bsXCoNy+wGIBBm7hFHV7APwUrKf aZf8s3JsTzh3tlqdYWDsW3ICqQ== X-Received: by 2002:a17:902:7483:: with SMTP id h3mr9067587pll.114.1593425084898; Mon, 29 Jun 2020 03:04:44 -0700 (PDT) Received: from localhost ([122.172.127.76]) by smtp.gmail.com with ESMTPSA id z9sm25088302pgh.94.2020.06.29.03.04.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2020 03:04:44 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Quentin Perret , linux-kernel@vger.kernel.org Subject: [PATCH] cpufreq: Remove the weakly defined cpufreq_default_governor() Date: Mon, 29 Jun 2020 15:34:40 +0530 Message-Id: <2f00a5847708547a57920e24a2ec5e76b265cde9.1593425047.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 The default cpufreq governor is chosen with the help of a "choice" option in the Kconfig which will always end up selecting one of the governors and so the weakly defined definition of cpufreq_default_governor() will never get called. Moreover, this makes us skip the checking of the return value of that routine as it will always be non NULL. If the Kconfig option changes in future, then we will start getting a link error instead (and it won't go unnoticed as in the case of the weak definition). Suggested-by: Quentin Perret Signed-off-by: Viresh Kumar --- Based over the following series: - [PATCH V4 0/3] cpufreq: Allow default governor on cmdline and fix locking issues drivers/cpufreq/cpufreq.c | 7 ------- 1 file changed, 7 deletions(-) -- 2.25.0.rc1.19.g042ed3e048af diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index ad94b1d47ddb..036f4cc42ede 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1056,11 +1056,6 @@ static int cpufreq_add_dev_interface(struct cpufreq_policy *policy) return 0; } -__weak struct cpufreq_governor *cpufreq_default_governor(void) -{ - return NULL; -} - static int cpufreq_init_policy(struct cpufreq_policy *policy) { struct cpufreq_governor *gov = NULL; @@ -1079,8 +1074,6 @@ static int cpufreq_init_policy(struct cpufreq_policy *policy) if (!gov) { gov = cpufreq_default_governor(); - if (!gov) - return -ENODATA; __module_get(gov->owner); }