diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2015-10-02 09:50:27 -0400 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2015-10-17 08:18:25 -0400 |
commit | 964cf28f9d10f4e5229e4365258c292bc5c856b2 (patch) | |
tree | 572964150990fa671a84b9a7c72bdfe1549dbfae | |
parent | b598e17f6a7a3a9bb6e0953ef586ee3697b59fce (diff) |
ARC: boot log: move helper macros to header for reuse
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
-rw-r--r-- | arch/arc/include/asm/setup.h | 7 | ||||
-rw-r--r-- | arch/arc/kernel/mcip.c | 3 | ||||
-rw-r--r-- | arch/arc/kernel/setup.c | 4 | ||||
-rw-r--r-- | arch/arc/mm/cache.c | 5 | ||||
-rw-r--r-- | arch/arc/mm/tlb.c | 2 |
5 files changed, 11 insertions, 10 deletions
diff --git a/arch/arc/include/asm/setup.h b/arch/arc/include/asm/setup.h index 6e3ef5ba4f74..307846691be6 100644 --- a/arch/arc/include/asm/setup.h +++ b/arch/arc/include/asm/setup.h | |||
@@ -33,4 +33,11 @@ extern int root_mountflags, end_mem; | |||
33 | void setup_processor(void); | 33 | void setup_processor(void); |
34 | void __init setup_arch_memory(void); | 34 | void __init setup_arch_memory(void); |
35 | 35 | ||
36 | /* Helpers used in arc_*_mumbojumbo routines */ | ||
37 | #define IS_AVAIL1(v, s) ((v) ? s : "") | ||
38 | #define IS_DISABLED_RUN(v) ((v) ? "" : "(disabled) ") | ||
39 | #define IS_USED_RUN(v) ((v) ? "" : "(not used) ") | ||
40 | #define IS_USED_CFG(cfg) IS_USED_RUN(IS_ENABLED(cfg)) | ||
41 | #define IS_AVAIL2(v, s, cfg) IS_AVAIL1(v, s), IS_AVAIL1(v, IS_USED_CFG(cfg)) | ||
42 | |||
36 | #endif /* __ASMARC_SETUP_H */ | 43 | #endif /* __ASMARC_SETUP_H */ |
diff --git a/arch/arc/kernel/mcip.c b/arch/arc/kernel/mcip.c index 4ffd1855f1bd..e48a1331c588 100644 --- a/arch/arc/kernel/mcip.c +++ b/arch/arc/kernel/mcip.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/irq.h> | 12 | #include <linux/irq.h> |
13 | #include <linux/spinlock.h> | 13 | #include <linux/spinlock.h> |
14 | #include <asm/mcip.h> | 14 | #include <asm/mcip.h> |
15 | #include <asm/setup.h> | ||
15 | 16 | ||
16 | static char smp_cpuinfo_buf[128]; | 17 | static char smp_cpuinfo_buf[128]; |
17 | static int idu_detected; | 18 | static int idu_detected; |
@@ -122,8 +123,6 @@ struct plat_smp_ops plat_smp_ops = { | |||
122 | 123 | ||
123 | void mcip_init_early_smp(void) | 124 | void mcip_init_early_smp(void) |
124 | { | 125 | { |
125 | #define IS_AVAIL1(var, str) ((var) ? str : "") | ||
126 | |||
127 | struct mcip_bcr { | 126 | struct mcip_bcr { |
128 | #ifdef CONFIG_CPU_BIG_ENDIAN | 127 | #ifdef CONFIG_CPU_BIG_ENDIAN |
129 | unsigned int pad3:8, | 128 | unsigned int pad3:8, |
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c index cabde9dc0696..68d3e181a82f 100644 --- a/arch/arc/kernel/setup.c +++ b/arch/arc/kernel/setup.c | |||
@@ -160,10 +160,6 @@ static const struct cpuinfo_data arc_cpu_tbl[] = { | |||
160 | { {0x00, NULL } } | 160 | { {0x00, NULL } } |
161 | }; | 161 | }; |
162 | 162 | ||
163 | #define IS_AVAIL1(v, s) ((v) ? s : "") | ||
164 | #define IS_USED_RUN(v) ((v) ? "" : "(not used) ") | ||
165 | #define IS_USED_CFG(cfg) IS_USED_RUN(IS_ENABLED(cfg)) | ||
166 | #define IS_AVAIL2(v, s, cfg) IS_AVAIL1(v, s), IS_AVAIL1(v, IS_USED_CFG(cfg)) | ||
167 | 163 | ||
168 | static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len) | 164 | static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len) |
169 | { | 165 | { |
diff --git a/arch/arc/mm/cache.c b/arch/arc/mm/cache.c index 0d1a6e96839f..ae3b772ecc4d 100644 --- a/arch/arc/mm/cache.c +++ b/arch/arc/mm/cache.c | |||
@@ -37,7 +37,6 @@ char *arc_cache_mumbojumbo(int c, char *buf, int len) | |||
37 | int n = 0; | 37 | int n = 0; |
38 | struct cpuinfo_arc_cache *p; | 38 | struct cpuinfo_arc_cache *p; |
39 | 39 | ||
40 | #define IS_USED_RUN(v) ((v) ? "" : "(disabled) ") | ||
41 | #define PR_CACHE(p, cfg, str) \ | 40 | #define PR_CACHE(p, cfg, str) \ |
42 | if (!(p)->ver) \ | 41 | if (!(p)->ver) \ |
43 | n += scnprintf(buf + n, len - n, str"\t\t: N/A\n"); \ | 42 | n += scnprintf(buf + n, len - n, str"\t\t: N/A\n"); \ |
@@ -47,7 +46,7 @@ char *arc_cache_mumbojumbo(int c, char *buf, int len) | |||
47 | (p)->sz_k, (p)->assoc, (p)->line_len, \ | 46 | (p)->sz_k, (p)->assoc, (p)->line_len, \ |
48 | (p)->vipt ? "VIPT" : "PIPT", \ | 47 | (p)->vipt ? "VIPT" : "PIPT", \ |
49 | (p)->alias ? " aliasing" : "", \ | 48 | (p)->alias ? " aliasing" : "", \ |
50 | IS_ENABLED(cfg) ? "" : " (not used)"); | 49 | IS_USED_CFG(cfg)); |
51 | 50 | ||
52 | PR_CACHE(&cpuinfo_arc700[c].icache, CONFIG_ARC_HAS_ICACHE, "I-Cache"); | 51 | PR_CACHE(&cpuinfo_arc700[c].icache, CONFIG_ARC_HAS_ICACHE, "I-Cache"); |
53 | PR_CACHE(&cpuinfo_arc700[c].dcache, CONFIG_ARC_HAS_DCACHE, "D-Cache"); | 52 | PR_CACHE(&cpuinfo_arc700[c].dcache, CONFIG_ARC_HAS_DCACHE, "D-Cache"); |
@@ -63,7 +62,7 @@ char *arc_cache_mumbojumbo(int c, char *buf, int len) | |||
63 | 62 | ||
64 | if (ioc_exists) | 63 | if (ioc_exists) |
65 | n += scnprintf(buf + n, len - n, "IOC\t\t:%s\n", | 64 | n += scnprintf(buf + n, len - n, "IOC\t\t:%s\n", |
66 | IS_USED_RUN(ioc_enable)); | 65 | IS_DISABLED_RUN(ioc_enable)); |
67 | 66 | ||
68 | return buf; | 67 | return buf; |
69 | } | 68 | } |
diff --git a/arch/arc/mm/tlb.c b/arch/arc/mm/tlb.c index 25699db016b3..a69f2078a96d 100644 --- a/arch/arc/mm/tlb.c +++ b/arch/arc/mm/tlb.c | |||
@@ -779,7 +779,7 @@ char *arc_mmu_mumbojumbo(int cpu_id, char *buf, int len) | |||
779 | if (p_mmu->s_pg_sz_m) | 779 | if (p_mmu->s_pg_sz_m) |
780 | scnprintf(super_pg, 64, "%dM Super Page%s, ", | 780 | scnprintf(super_pg, 64, "%dM Super Page%s, ", |
781 | p_mmu->s_pg_sz_m, | 781 | p_mmu->s_pg_sz_m, |
782 | IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) ? "" : " (not used)"); | 782 | IS_USED_CFG(CONFIG_TRANSPARENT_HUGEPAGE)); |
783 | 783 | ||
784 | n += scnprintf(buf + n, len - n, | 784 | n += scnprintf(buf + n, len - n, |
785 | "MMU [v%x]\t: %dk PAGE, %sJTLB %d (%dx%d), uDTLB %d, uITLB %d %s\n", | 785 | "MMU [v%x]\t: %dk PAGE, %sJTLB %d (%dx%d), uDTLB %d, uITLB %d %s\n", |