lkml.org 
[lkml]   [2014]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 20/38] tick-sched: initialize 'cpu' while defining it in tick_nohz_full_setup()
Date
We are doing this currently:

int cpu;

cpu = smp_processor_id();

And we can rewrite it to make it shorter:
int cpu = smp_processor_id();

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
kernel/time/tick-sched.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 649b920..e9f9f87 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -274,7 +274,7 @@ out:
/* Parse the boot-time nohz CPU list from the kernel parameters. */
static int __init tick_nohz_full_setup(char *str)
{
- int cpu;
+ int cpu = smp_processor_id();

alloc_bootmem_cpumask_var(&tick_nohz_full_mask);
if (cpulist_parse(str, tick_nohz_full_mask) < 0) {
@@ -282,7 +282,6 @@ static int __init tick_nohz_full_setup(char *str)
return 1;
}

- cpu = smp_processor_id();
if (cpumask_test_cpu(cpu, tick_nohz_full_mask)) {
pr_warning("NO_HZ: Clearing %d from nohz_full range for timekeeping\n",
cpu);
--
1.7.12.rc2.18.g61b472e


\
 
 \ /
  Last update: 2014-04-14 23:41    [W:0.131 / U:1.628 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site