diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2014-12-11 23:35:03 -0500 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2015-02-02 06:38:37 -0500 |
commit | 4c86231c14a8a1e9838dcb013ded07ebd2f2a1a5 (patch) | |
tree | 014cfaa92fb7f5450b8f55a0051a66ffe513a55d | |
parent | 26bc420b59a38e4e6685a73345a0def461136dce (diff) |
ARC: fix /proc/cpuinfo for offline cpus
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
-rw-r--r-- | arch/arc/kernel/setup.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c index 252bf603db9c..900f68a70088 100644 --- a/arch/arc/kernel/setup.c +++ b/arch/arc/kernel/setup.c | |||
@@ -412,6 +412,11 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
412 | char *str; | 412 | char *str; |
413 | int cpu_id = ptr_to_cpu(v); | 413 | int cpu_id = ptr_to_cpu(v); |
414 | 414 | ||
415 | if (!cpu_online(cpu_id)) { | ||
416 | seq_printf(m, "processor [%d]\t: Offline\n", cpu_id); | ||
417 | goto done; | ||
418 | } | ||
419 | |||
415 | str = (char *)__get_free_page(GFP_TEMPORARY); | 420 | str = (char *)__get_free_page(GFP_TEMPORARY); |
416 | if (!str) | 421 | if (!str) |
417 | goto done; | 422 | goto done; |
@@ -429,7 +434,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
429 | 434 | ||
430 | free_page((unsigned long)str); | 435 | free_page((unsigned long)str); |
431 | done: | 436 | done: |
432 | seq_printf(m, "\n\n"); | 437 | seq_printf(m, "\n"); |
433 | 438 | ||
434 | return 0; | 439 | return 0; |
435 | } | 440 | } |