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=-10.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 DDC88C35277 for ; Tue, 14 Jul 2020 21:01:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B5CC420658 for ; Tue, 14 Jul 2020 21:01:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XcralwfL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727941AbgGNVBA (ORCPT ); Tue, 14 Jul 2020 17:01:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726768AbgGNVBA (ORCPT ); Tue, 14 Jul 2020 17:01:00 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F7D5C061755 for ; Tue, 14 Jul 2020 14:01:00 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id j4so150887wrp.10 for ; Tue, 14 Jul 2020 14:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=UgHePzwDWkj9USOlRyqZl2fpeHBfUUnRLMgbgOfnUNw=; b=XcralwfLeQ7zj7+U3F2rSAPGT3V8zamxaPPIYWkdnVcg1eqJTtcBIzvMHPoh9SZOlN P+OH+yjrTB/h8zYJDIOIwKL2Uab/VJC2d7uLCgECqsDHk/RuOurQx/rlbdRiQlI1cdXH b77V2g6/Fp8ue7H6AeTCP5hxb8i8yFxzvwf/VYlt3Czd8VIQbplQ/KHogvebw3BARvGA g/Rwirjizpgq7QoRm2E6MGGFZEj0oEU4o/gRnJcoHdQk0/Atr12T1jWx70vifMvObnQ4 R8EbHOurRCPlsJb5mU5p/My0E3ftHvacHOGbXQwL4o2ntH76gHDdOrKYJUObO3jiLYD6 ordg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=UgHePzwDWkj9USOlRyqZl2fpeHBfUUnRLMgbgOfnUNw=; b=GXWmv799l1pE5aTlGc0luZVyE5EV4vEB6HBFwwlBB0IfERVlezI2oEZrGkcqr+tjEA QFWi8Zr3GNPAbGA0EkwT6tfzQbNKtWfP7AbLme0XxatTQ5DMuBIAVKAVKpjmxtOYMSKa 0HuwHqGSzQHYS+huHDEOizcqCwcaYIc5J1MC33d3y86a1z/qcxlFZ2gaTVo/yfPIxmZ7 lvP31XNG2CDrll0wx5TJiaQoPZeTFynFPh4eh5eidtphoYBPpkMDYGfwjlRvo5PN0k0s fPoGJ09k/K0waqzSBQpiOKmWwv3ssNNjr/vsW0XZyOWKRF6Qk0jQmEWatw4dls08v4o2 zOgw== X-Gm-Message-State: AOAM533C9sLKzXt/cS+VxB6hIWnqTd7UcslMNpef9u5uWl2+GkiaUCBn gwApvZ9J0E1S3X9b4MNJ7A3oDg== X-Google-Smtp-Source: ABdhPJxrP4msc1UWDW+tsY/mSi27FFkqHu34o0CYWRyeqHZuSTP+UmUSIKZrgJtsQIqST40ul+ICCQ== X-Received: by 2002:adf:ff90:: with SMTP id j16mr7773895wrr.364.1594760458999; Tue, 14 Jul 2020 14:00:58 -0700 (PDT) Received: from dell ([2.31.163.61]) by smtp.gmail.com with ESMTPSA id b184sm15426wmc.20.2020.07.14.14.00.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2020 14:00:58 -0700 (PDT) Date: Tue, 14 Jul 2020 22:00:56 +0100 From: Lee Jones To: Robin Murphy Cc: "Rafael J. Wysocki" , Denis Sadykov , Andy Grover , Linux PM , Viresh Kumar , "Rafael J. Wysocki" , Linux Kernel Mailing List , Paul Diefenbaugh , Linux ARM , Dominik Brodowski Subject: Re: [PATCH 08/13] cpufreq: acpi-cpufreq: Take 'dummy' principle one stage further Message-ID: <20200714210056.GF1398296@dell> References: <20200714145049.2496163-1-lee.jones@linaro.org> <20200714145049.2496163-9-lee.jones@linaro.org> <8b2f7674-9e33-e09c-cf99-84c59edb9779@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8b2f7674-9e33-e09c-cf99-84c59edb9779@arm.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Tue, 14 Jul 2020, Robin Murphy wrote: > On 2020-07-14 17:03, Rafael J. Wysocki wrote: > > On Tue, Jul 14, 2020 at 4:51 PM Lee Jones wrote: > > > > > > If we fail to use a variable, even a 'dummy' one, then the compiler > > > complains that it is set but not used. We know this is fine, so we > > > set it to its own value here. > > > > Which is kind of ugly in my personal view. I hope that the compiler > > will actually optimize the extra code away ... > > > > > Fixes the following W=1 kernel build warning(s): > > > > Well, "Makes the following ... warning(s) go away:" rather ... > > Isn't that what we have __maybe_unused and __always_unused for? Yes, that would be better. I didn't know you could do that with standard variables. Will fix. > > > drivers/cpufreq/acpi-cpufreq.c: In function ‘cpu_freq_read_intel’: > > > drivers/cpufreq/acpi-cpufreq.c:247:11: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable] > > > drivers/cpufreq/acpi-cpufreq.c: In function ‘cpu_freq_read_amd’: > > > drivers/cpufreq/acpi-cpufreq.c:265:11: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable] > > > > > > Cc: Andy Grover > > > Cc: Paul Diefenbaugh > > > Cc: Dominik Brodowski > > > Cc: Denis Sadykov > > > Signed-off-by: Lee Jones > > > --- > > > drivers/cpufreq/acpi-cpufreq.c | 2 ++ > > > 1 file changed, 2 insertions(+) > > > > > > diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c > > > index 429e5a36c08a9..d38a693b48e03 100644 > > > --- a/drivers/cpufreq/acpi-cpufreq.c > > > +++ b/drivers/cpufreq/acpi-cpufreq.c > > > @@ -247,6 +247,7 @@ static u32 cpu_freq_read_intel(struct acpi_pct_register *not_used) > > > u32 val, dummy; > > > > > > rdmsr(MSR_IA32_PERF_CTL, val, dummy); > > > + dummy &= dummy; /* Silence set but not used warning */ > > > return val; > > > } > > > > > > @@ -264,6 +265,7 @@ static u32 cpu_freq_read_amd(struct acpi_pct_register *not_used) > > > u32 val, dummy; > > > > > > rdmsr(MSR_AMD_PERF_CTL, val, dummy); > > > + dummy &= dummy; /* Silence set but not used warning */ > > > return val; > > > } > > > > > > > _______________________________________________ > > linux-arm-kernel mailing list > > linux-arm-kernel@lists.infradead.org > > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > > -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog