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 <[email protected]>
> CC: Viresh Kumar <[email protected]>
> CC: Rafael J. Wysocki <[email protected]>
> CC: Ingo Molnar <[email protected]>
> CC: Bartosz Golaszewski <[email protected]>
> CC: H. Peter Anvin <[email protected]>
> CC: Benoit Cousson <[email protected]>
> CC: Fenghua Yu <[email protected]>
> CC: Guenter Roeck <[email protected]>
> CC: Jean Delvare <[email protected]>
> CC: Jonathan Corbet <[email protected]>
> CC: Peter Zijlstra <[email protected]>
> CC: Thomas Gleixner <[email protected]>
> CC: [email protected]
> CC: [email protected]
> ---
>  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 <[email protected]>
-- 
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to