lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160605165733.25076-1-dvlasenk@redhat.com>
Date:	Sun,  5 Jun 2016 18:57:33 +0200
From:	Denys Vlasenko <dvlasenk@...hat.com>
To:	Ingo Molnar <mingo@...nel.org>
Cc:	Denys Vlasenko <dvlasenk@...hat.com>,
	"Rafael J . Wysocki" <rjw@...ysocki.net>,
	Bartosz Golaszewski <bgolaszewski@...libre.com>,
	"H . Peter Anvin" <hpa@...or.com>,
	Benoit Cousson <bcousson@...libre.com>,
	Fenghua Yu <fenghua.yu@...el.com>,
	Guenter Roeck <linux@...ck-us.net>,
	Jean Delvare <jdelvare@...e.de>,
	Jonathan Corbet <corbet@....net>,
	Peter Zijlstra <peterz@...radead.org>,
	Thomas Gleixner <tglx@...utronix.de>, x86@...nel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH RESEND] cpufreq: p4-clockmod: Replace bool_int_array[NR_CPUS] with bitmap

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@...hat.com>
Acked-by: Viresh Kumar <viresh.kumar@...aro.org>
CC: Rafael J. Wysocki <rjw@...ysocki.net>
CC: Ingo Molnar <mingo@...nel.org>
CC: Bartosz Golaszewski <bgolaszewski@...libre.com>
CC: H. Peter Anvin <hpa@...or.com>
CC: Benoit Cousson <bcousson@...libre.com>
CC: Fenghua Yu <fenghua.yu@...el.com>
CC: Guenter Roeck <linux@...ck-us.net>
CC: Jean Delvare <jdelvare@...e.de>
CC: Jonathan Corbet <corbet@....net>
CC: Peter Zijlstra <peterz@...radead.org>
CC: Thomas Gleixner <tglx@...utronix.de>
CC: x86@...nel.org
CC: linux-kernel@...r.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;
-- 
1.8.1.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ