From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 254B9C43613 for ; Sat, 22 Jun 2019 09:12:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E9CE6205F4 for ; Sat, 22 Jun 2019 09:12:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561194779; bh=2zZ41vVuXY02GEy7MVixifqb73seHKp8DloGDMxgPI0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=vCCsKJcJBRTa4QPfMIgl2y4WSSt92kz+Kp8ojiuesvt5HsIJEIsg0XA4IpAgB20ir 823LKMdlnY4pa7MlDBnSrRntEyHnUzRzp4pGWyj0gM1GRg7ZoGtudgqttyoToJpxQf rVfJcUM0CecKFIh0U66pceYiXUnWsLQeN1Guvxgw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726272AbfFVJM6 (ORCPT ); Sat, 22 Jun 2019 05:12:58 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:35027 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726187AbfFVJM5 (ORCPT ); Sat, 22 Jun 2019 05:12:57 -0400 Received: by mail-ot1-f66.google.com with SMTP id j19so8723925otq.2; Sat, 22 Jun 2019 02:12:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=za5DjWecnxQo5WhKu7I+X5Hk3iA1uY1rMAIDn+XLDII=; b=YoG4ncd8373zFg6HZwCcpzB9zw+pEF6pAtAOISfTBhubdC5D+3+WLsgGAhZZfP/fz0 zCRARpIpRFYNi2xjYvgt8HceNP0TLEhVhKxwoDM4+t0TQiIPb3/Bo/JL59Rqbg08sYYK mrBkrrNGCOiHCpSnVa42MsDP/Y01FdKkWO5iMV3VFKaXYwp7B4mH8MeC/H1U7mJ9b00R vIFy/nEv/hAcp26GHM8vzjJXStS4ko7NZ1itlA5G3dt+btkA4K/bGRjdqQaBhjpNbYtj 91dt6JOP9eJftgfBcc8cAOtN+QJ3SlUtx3ri22Di2Vu6vPtM4Dmk/WxdDrLV7HEOO9re S97w== X-Gm-Message-State: APjAAAVPFY2YE5dwSInzyF+YJUr+YQJ5xRqWnIMAdoUwcuLku/Somju3 DM/jYxY/xOGhVw7jSzZZDoZGbRlZmR3n/o0QnbM= X-Google-Smtp-Source: APXvYqy79d/NCRv3FRk7cUoFWpn4u0tK3EJ2qKGeyjzmJz8YDBEpJ1Pun+fgOt8pSnglb/ICBLDyOrBxFfzzVgXc+6g= X-Received: by 2002:a05:6830:1516:: with SMTP id k22mr16209366otp.189.1561194777137; Sat, 22 Jun 2019 02:12:57 -0700 (PDT) MIME-Version: 1.0 References: <20190621132302.30414-1-daniel.lezcano@linaro.org> In-Reply-To: <20190621132302.30414-1-daniel.lezcano@linaro.org> From: "Rafael J. Wysocki" Date: Sat, 22 Jun 2019 11:12:46 +0200 Message-ID: Subject: Re: [PATCH 1/6] cpufreq: Use existing stub functions instead of IS_ENABLED macro To: Daniel Lezcano Cc: Viresh Kumar , Eduardo Valentin , Linux Kernel Mailing List , "Rafael J. Wysocki" , "open list:CPU FREQUENCY SCALING FRAMEWORK" Content-Type: text/plain; charset="UTF-8" Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Fri, Jun 21, 2019 at 3:23 PM Daniel Lezcano wrote: > > The functions stub already exist for the condition the IS_ENABLED > is trying to avoid. > > Remove the IS_ENABLED macros as they are pointless. AFAICS, the IS_ENABLED checks are an optimization to avoid generating pointless code (including a branch) in case CONFIG_CPU_THERMAL is not set. Why do you think that it is not useful? > Signed-off-by: Daniel Lezcano > --- > drivers/cpufreq/cpufreq.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > index 85ff958e01f1..7c72f7d3509c 100644 > --- a/drivers/cpufreq/cpufreq.c > +++ b/drivers/cpufreq/cpufreq.c > @@ -1378,8 +1378,7 @@ static int cpufreq_online(unsigned int cpu) > if (cpufreq_driver->ready) > cpufreq_driver->ready(policy); > > - if (IS_ENABLED(CONFIG_CPU_THERMAL) && > - cpufreq_driver->flags & CPUFREQ_IS_COOLING_DEV) > + if (cpufreq_driver->flags & CPUFREQ_IS_COOLING_DEV) > policy->cdev = of_cpufreq_cooling_register(policy); > > pr_debug("initialization complete\n"); > @@ -1469,8 +1468,7 @@ static int cpufreq_offline(unsigned int cpu) > goto unlock; > } > > - if (IS_ENABLED(CONFIG_CPU_THERMAL) && > - cpufreq_driver->flags & CPUFREQ_IS_COOLING_DEV) { > + if (cpufreq_driver->flags & CPUFREQ_IS_COOLING_DEV) { > cpufreq_cooling_unregister(policy->cdev); > policy->cdev = NULL; > } > -- > 2.17.1 >