Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARC: Use kconfig helper IS_ENABLED() to get rid of defines.h

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

+23 -68
+1 -3
arch/arc/Makefile
··· 16 16 17 17 cflags-y += -mA7 -fno-common -pipe -fno-builtin -D__linux__ 18 18 19 - LINUXINCLUDE += -include ${src}/arch/arc/include/asm/defines.h 20 - 21 19 ifdef CONFIG_ARC_CURR_IN_REG 22 20 # For a global register defintion, make sure it gets passed to every file 23 21 # We had a customer reported bug where some code built in kernel was NOT using 24 22 # any kernel headers, and missing the r25 global register 25 - # Can't do unconditionally (like above) because of recursive include issues 23 + # Can't do unconditionally because of recursive include issues 26 24 # due to <linux/thread_info.h> 27 25 LINUXINCLUDE += -include ${src}/arch/arc/include/asm/current.h 28 26 endif
+2
arch/arc/include/asm/cache.h
··· 9 9 #ifndef __ARC_ASM_CACHE_H 10 10 #define __ARC_ASM_CACHE_H 11 11 12 + #include <asm/mmu.h> /* some of cache registers depend on MMU ver */ 13 + 12 14 /* In case $$ not config, setup a dummy number for rest of kernel */ 13 15 #ifndef CONFIG_ARC_CACHE_LINE_SHIFT 14 16 #define L1_CACHE_SHIFT 6
-56
arch/arc/include/asm/defines.h
··· 1 - /* 2 - * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) 3 - * 4 - * This program is free software; you can redistribute it and/or modify 5 - * it under the terms of the GNU General Public License version 2 as 6 - * published by the Free Software Foundation. 7 - */ 8 - 9 - #ifndef __ARC_ASM_DEFINES_H__ 10 - #define __ARC_ASM_DEFINES_H__ 11 - 12 - #if defined(CONFIG_ARC_MMU_V1) 13 - #define CONFIG_ARC_MMU_VER 1 14 - #elif defined(CONFIG_ARC_MMU_V2) 15 - #define CONFIG_ARC_MMU_VER 2 16 - #elif defined(CONFIG_ARC_MMU_V3) 17 - #define CONFIG_ARC_MMU_VER 3 18 - #endif 19 - 20 - #ifdef CONFIG_ARC_HAS_LLSC 21 - #define __CONFIG_ARC_HAS_LLSC_VAL 1 22 - #else 23 - #define __CONFIG_ARC_HAS_LLSC_VAL 0 24 - #endif 25 - 26 - #ifdef CONFIG_ARC_HAS_SWAPE 27 - #define __CONFIG_ARC_HAS_SWAPE_VAL 1 28 - #else 29 - #define __CONFIG_ARC_HAS_SWAPE_VAL 0 30 - #endif 31 - 32 - #ifdef CONFIG_ARC_HAS_RTSC 33 - #define __CONFIG_ARC_HAS_RTSC_VAL 1 34 - #else 35 - #define __CONFIG_ARC_HAS_RTSC_VAL 0 36 - #endif 37 - 38 - #ifdef CONFIG_ARC_MMU_SASID 39 - #define __CONFIG_ARC_MMU_SASID_VAL 1 40 - #else 41 - #define __CONFIG_ARC_MMU_SASID_VAL 0 42 - #endif 43 - 44 - #ifdef CONFIG_ARC_HAS_ICACHE 45 - #define __CONFIG_ARC_HAS_ICACHE 1 46 - #else 47 - #define __CONFIG_ARC_HAS_ICACHE 0 48 - #endif 49 - 50 - #ifdef CONFIG_ARC_HAS_DCACHE 51 - #define __CONFIG_ARC_HAS_DCACHE 1 52 - #else 53 - #define __CONFIG_ARC_HAS_DCACHE 0 54 - #endif 55 - 56 - #endif /* __ARC_ASM_DEFINES_H__ */
+8
arch/arc/include/asm/mmu.h
··· 9 9 #ifndef _ASM_ARC_MMU_H 10 10 #define _ASM_ARC_MMU_H 11 11 12 + #if defined(CONFIG_ARC_MMU_V1) 13 + #define CONFIG_ARC_MMU_VER 1 14 + #elif defined(CONFIG_ARC_MMU_V2) 15 + #define CONFIG_ARC_MMU_VER 2 16 + #elif defined(CONFIG_ARC_MMU_V3) 17 + #define CONFIG_ARC_MMU_VER 3 18 + #endif 19 + 12 20 #ifndef __ASSEMBLY__ 13 21 14 22 typedef struct {
+3 -2
arch/arc/include/asm/tlb-mmu1.h
··· 9 9 #ifndef __ASM_TLB_MMU_V1_H__ 10 10 #define __ASM_TLB_MMU_V1_H__ 11 11 12 - #if defined(__ASSEMBLY__) && defined(CONFIG_ARC_MMU_VER == 1) 13 - 12 + #include <asm/mmu.h> 14 13 #include <asm/tlb.h> 14 + 15 + #if defined(__ASSEMBLY__) && (CONFIG_ARC_MMU_VER == 1) 15 16 16 17 .macro TLB_WRITE_HEURISTICS 17 18
+4 -4
arch/arc/kernel/setup.c
··· 182 182 FIX_PTR(cpu); 183 183 #define IS_AVAIL1(var, str) ((var) ? str : "") 184 184 #define IS_AVAIL2(var, str) ((var == 0x2) ? str : "") 185 - #define IS_USED(var) ((var) ? "(in-use)" : "(not used)") 185 + #define IS_USED(cfg) (IS_ENABLED(cfg) ? "(in-use)" : "(not used)") 186 186 187 187 n += scnprintf(buf + n, len - n, 188 188 "Extn [700-Base]\t: %s %s %s %s %s %s\n", ··· 202 202 if (cpu->core.family == 0x34) { 203 203 n += scnprintf(buf + n, len - n, 204 204 "Extn [700-4.10]\t: LLOCK/SCOND %s, SWAPE %s, RTSC %s\n", 205 - IS_USED(__CONFIG_ARC_HAS_LLSC_VAL), 206 - IS_USED(__CONFIG_ARC_HAS_SWAPE_VAL), 207 - IS_USED(__CONFIG_ARC_HAS_RTSC_VAL)); 205 + IS_USED(CONFIG_ARC_HAS_LLSC), 206 + IS_USED(CONFIG_ARC_HAS_SWAPE), 207 + IS_USED(CONFIG_ARC_HAS_RTSC)); 208 208 } 209 209 210 210 n += scnprintf(buf + n, len - n, "Extn [CCM]\t: %s",
+4 -2
arch/arc/mm/cache_arc700.c
··· 89 89 enb ? "" : "DISABLED (kernel-build)"); \ 90 90 } 91 91 92 - PR_CACHE(&cpuinfo_arc700[c].icache, __CONFIG_ARC_HAS_ICACHE, "I-Cache"); 93 - PR_CACHE(&cpuinfo_arc700[c].dcache, __CONFIG_ARC_HAS_DCACHE, "D-Cache"); 92 + PR_CACHE(&cpuinfo_arc700[c].icache, IS_ENABLED(CONFIG_ARC_HAS_ICACHE), 93 + "I-Cache"); 94 + PR_CACHE(&cpuinfo_arc700[c].dcache, IS_ENABLED(CONFIG_ARC_HAS_DCACHE), 95 + "D-Cache"); 94 96 95 97 return buf; 96 98 }
+1 -1
arch/arc/mm/tlb.c
··· 505 505 "J-TLB %d (%dx%d), uDTLB %d, uITLB %d, %s\n", 506 506 p_mmu->num_tlb, p_mmu->sets, p_mmu->ways, 507 507 p_mmu->u_dtlb, p_mmu->u_itlb, 508 - __CONFIG_ARC_MMU_SASID_VAL ? "SASID" : ""); 508 + IS_ENABLED(CONFIG_ARC_MMU_SASID) ? "SASID" : ""); 509 509 510 510 return buf; 511 511 }