From: Viresh Kumar <viresh.kumar@linaro.org>
To: Denys Vlasenko <dvlasenk@redhat.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Ingo Molnar <mingo@kernel.org>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Benoit Cousson <bcousson@baylibre.com>,
Fenghua Yu <fenghua.yu@intel.com>,
Guenter Roeck <linux@roeck-us.net>,
Jean Delvare <jdelvare@suse.de>, Jonathan Corbet <corbet@lwn.net>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpufreq: p4-clockmod: Replace bool_int_array[NR_CPUS] with bitmap
Date: Sat, 26 Sep 2015 15:07:59 -0700 [thread overview]
Message-ID: <20150926220759.GI5951@linux> (raw)
In-Reply-To: <1443271638-2568-2-git-send-email-dvlasenk@redhat.com>
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 <dvlasenk@redhat.com>
> CC: Viresh Kumar <viresh.kumar@linaro.org>
> CC: Rafael J. Wysocki <rjw@rjwysocki.net>
> CC: Ingo Molnar <mingo@kernel.org>
> CC: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> CC: H. Peter Anvin <hpa@zytor.com>
> CC: Benoit Cousson <bcousson@baylibre.com>
> CC: Fenghua Yu <fenghua.yu@intel.com>
> CC: Guenter Roeck <linux@roeck-us.net>
> CC: Jean Delvare <jdelvare@suse.de>
> CC: Jonathan Corbet <corbet@lwn.net>
> CC: Peter Zijlstra <peterz@infradead.org>
> CC: Thomas Gleixner <tglx@linutronix.de>
> 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.kumar@linaro.org>
--
viresh
next prev parent reply other threads:[~2015-09-26 22:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-26 12:47 [PATCH] x86/kgdb: Replace bool_int_array[NR_CPUS] with bitmap Denys Vlasenko
2015-09-26 12:47 ` [PATCH] cpufreq: p4-clockmod: " Denys Vlasenko
2015-09-26 22:07 ` Viresh Kumar [this message]
2015-09-27 16:10 ` Jean Delvare
2015-09-27 17:58 ` Denys Vlasenko
2015-09-28 7:10 ` Jean Delvare
2015-09-29 8:36 ` [tip:x86/debug] x86/kgdb: " tip-bot for Denys Vlasenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150926220759.GI5951@linux \
--to=viresh.kumar@linaro.org \
--cc=bcousson@baylibre.com \
--cc=bgolaszewski@baylibre.com \
--cc=corbet@lwn.net \
--cc=dvlasenk@redhat.com \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--cc=jdelvare@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox