From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756813AbbIZWIG (ORCPT ); Sat, 26 Sep 2015 18:08:06 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:32995 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754243AbbIZWIB (ORCPT ); Sat, 26 Sep 2015 18:08:01 -0400 Date: Sat, 26 Sep 2015 15:07:59 -0700 From: Viresh Kumar To: Denys Vlasenko Cc: "Rafael J. Wysocki" , Ingo Molnar , Bartosz Golaszewski , "H. Peter Anvin" , Benoit Cousson , Fenghua Yu , Guenter Roeck , Jean Delvare , Jonathan Corbet , Peter Zijlstra , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cpufreq: p4-clockmod: Replace bool_int_array[NR_CPUS] with bitmap Message-ID: <20150926220759.GI5951@linux> References: <1443271638-2568-1-git-send-email-dvlasenk@redhat.com> <1443271638-2568-2-git-send-email-dvlasenk@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1443271638-2568-2-git-send-email-dvlasenk@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26-09-15, 14:47, Denys Vlasenko wrote: > Straigntforward conversion from > int has_N44_O17_errata[NR_CPUS] > to > DECLARE_BITMAP(has_N44_O17_errata, NR_CPUS) > > Saves about 2 kbytes in bss for NR_CPUS=512. > > Signed-off-by: Denys Vlasenko > CC: Viresh Kumar > CC: Rafael J. Wysocki > CC: Ingo Molnar > CC: Bartosz Golaszewski > CC: H. Peter Anvin > CC: Benoit Cousson > CC: Fenghua Yu > CC: Guenter Roeck > CC: Jean Delvare > CC: Jonathan Corbet > CC: Peter Zijlstra > CC: Thomas Gleixner > CC: x86@kernel.org > CC: linux-kernel@vger.kernel.org > --- > drivers/cpufreq/p4-clockmod.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/cpufreq/p4-clockmod.c b/drivers/cpufreq/p4-clockmod.c > index 5dd95da..dd15810 100644 > --- a/drivers/cpufreq/p4-clockmod.c > +++ b/drivers/cpufreq/p4-clockmod.c > @@ -49,7 +49,7 @@ enum { > #define DC_ENTRIES 8 > > > -static int has_N44_O17_errata[NR_CPUS]; > +static DECLARE_BITMAP(has_N44_O17_errata, NR_CPUS); > static unsigned int stock_freq; > static struct cpufreq_driver p4clockmod_driver; > static unsigned int cpufreq_p4_get(unsigned int cpu); > @@ -66,7 +66,7 @@ static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate) > if (l & 0x01) > pr_debug("CPU#%d currently thermal throttled\n", cpu); > > - if (has_N44_O17_errata[cpu] && > + if (test_bit(cpu, has_N44_O17_errata) && > (newstate == DC_25PT || newstate == DC_DFLT)) > newstate = DC_38PT; > > @@ -182,7 +182,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) > case 0x0f0a: > case 0x0f11: > case 0x0f12: > - has_N44_O17_errata[policy->cpu] = 1; > + set_bit(policy->cpu, has_N44_O17_errata); > pr_debug("has errata -- disabling low frequencies\n"); > } > > @@ -199,7 +199,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) > > /* table init */ > for (i = 1; (p4clockmod_table[i].frequency != CPUFREQ_TABLE_END); i++) { > - if ((i < 2) && (has_N44_O17_errata[policy->cpu])) > + if ((i < 2) && test_bit(policy->cpu, has_N44_O17_errata)) > p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID; > else > p4clockmod_table[i].frequency = (stock_freq * i)/8; Acked-by: Viresh Kumar -- viresh