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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 14 Apr 2014 21:53:59 +0530
From:	Viresh Kumar <viresh.kumar@...aro.org>
To:	tglx@...utronix.de
Cc:	linaro-kernel@...ts.linaro.org, linux-kernel@...r.kernel.org,
	fweisbec@...il.com, Arvind.Chauhan@....com,
	linaro-networking@...aro.org,
	Viresh Kumar <viresh.kumar@...aro.org>
Subject: [PATCH 37/38] tick-broadcast: merge tick_do_broadcast_on_off() into tick_broadcast_on_off()

We have added a wrapper around tick_do_broadcast_on_off() which doesn't have
anything so special that we should keep it. It just had a check if cpu is online
or not. Just merge these two routines and keep one: tick_broadcast_on_off().
This would get rid of an extra function call that we are doing currently.

This also replaces printk(KERN_ERR "**"); with pr_err("**");

Signed-off-by: Viresh Kumar <viresh.kumar@...aro.org>
---
 kernel/time/tick-broadcast.c | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index ec86227..9d81a81 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -327,13 +327,19 @@ unlock:
  * Powerstate information: The system enters/leaves a state, where
  * affected devices might stop
  */
-static void tick_do_broadcast_on_off(unsigned long *reason)
+void tick_broadcast_on_off(unsigned long reason, int *oncpu)
 {
 	struct tick_device *td = tick_get_cpu_device();
 	struct clock_event_device *bc, *dev = td->evtdev;
 	int cpu = smp_processor_id(), bc_stopped;
 	unsigned long flags;
 
+	if (!cpumask_test_cpu(*oncpu, cpu_online_mask)) {
+		pr_err("tick-broadcast: ignoring broadcast for offline CPU #%d\n",
+		       *oncpu);
+		return;
+	}
+
 	/*
 	 * Is the device not affected by the powerstate ?
 	 */
@@ -347,7 +353,7 @@ static void tick_do_broadcast_on_off(unsigned long *reason)
 	bc = tick_broadcast_device.evtdev;
 	bc_stopped = cpumask_empty(tick_broadcast_mask);
 
-	switch (*reason) {
+	switch (reason) {
 	case CLOCK_EVT_NOTIFY_BROADCAST_FORCE:
 		tick_broadcast_force = 1;
 	case CLOCK_EVT_NOTIFY_BROADCAST_ON:
@@ -383,19 +389,6 @@ static void tick_do_broadcast_on_off(unsigned long *reason)
 }
 
 /*
- * Powerstate information: The system enters/leaves a state, where
- * affected devices might stop.
- */
-void tick_broadcast_on_off(unsigned long reason, int *oncpu)
-{
-	if (!cpumask_test_cpu(*oncpu, cpu_online_mask))
-		printk(KERN_ERR "tick-broadcast: ignoring broadcast for offline CPU #%d\n",
-		       *oncpu);
-	else
-		tick_do_broadcast_on_off(&reason);
-}
-
-/*
  * Set the periodic handler depending on broadcast on/off
  */
 void tick_set_periodic_handler(struct clock_event_device *dev, int broadcast)
-- 
1.7.12.rc2.18.g61b472e

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ