From e166782f397f7db2c4446c5e120fa30afbde7bdd Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Sat, 5 May 2012 15:29:32 +0200 Subject: Clean up #ifs Replace #if CONFIG_FOO==1 with #if CONFIG_FOO: find src -name \*.[ch] -exec sed -i "s,#if[[:space:]]*\(CONFIG_[A-Z0-9_]*\)[[:space:]]*==[[:space:]]*1[[:space:]]*\$,#if \1," {} + Replace #if (CONFIG_FOO==1) with #if CONFIG_FOO: find src -name \*.[ch] -exec sed -i "s,#if[[:space:]]*(\(CONFIG_[A-Z0-9_]*\)[[:space:]]*==[[:space:]]*1)[[:space:]]*\$,#if \1," {} + Replace #if CONFIG_FOO==0 with #if !CONFIG_FOO: find src -name \*.[ch] -exec sed -i "s,#if[[:space:]]*\(CONFIG_[A-Z0-9_]*\)[[:space:]]*==[[:space:]]*0[[:space:]]*\$,#if \!\1," {} + Replace #if (CONFIG_FOO==0) with #if !CONFIG_FOO: find src -name \*.[ch] -exec sed -i "s,#if[[:space:]]*(\(CONFIG_[A-Z0-9_]*\)[[:space:]]*==[[:space:]]*0)[[:space:]]*\$,#if \!\1," {} + (and some manual changes to fix false positives) Change-Id: Iac6ca7605a5f99885258cf1a9a2473a92de27c42 Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/1004 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich Reviewed-by: Martin Roth --- src/drivers/ati/ragexl/atyfb.h | 6 +++--- src/drivers/ati/ragexl/mach64_ct.c | 2 +- src/drivers/ati/ragexl/xlinit.c | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/drivers/ati') diff --git a/src/drivers/ati/ragexl/atyfb.h b/src/drivers/ati/ragexl/atyfb.h index 99a87b3371..557ead7752 100644 --- a/src/drivers/ati/ragexl/atyfb.h +++ b/src/drivers/ati/ragexl/atyfb.h @@ -8,7 +8,7 @@ #define max(x,y) (x>=y)?x:y -#if CONFIG_CONSOLE_BTEXT==1 +#if CONFIG_CONSOLE_BTEXT /* * Elements of the hardware specific atyfb_par structure */ @@ -73,7 +73,7 @@ union aty_pll { * The hardware parameters for each card */ struct atyfb_par { -#if CONFIG_CONSOLE_BTEXT==1 +#if CONFIG_CONSOLE_BTEXT struct crtc crtc; #endif union aty_pll pll; @@ -97,7 +97,7 @@ struct aty_cursor { }; #endif struct fb_info_aty { -#if CONFIG_CONSOLE_BTEXT==1 +#if CONFIG_CONSOLE_BTEXT #if PLL_CRTC_DECODE==1 struct fb_info fb_info; #endif diff --git a/src/drivers/ati/ragexl/mach64_ct.c b/src/drivers/ati/ragexl/mach64_ct.c index b34be821fb..9b45f2a1fb 100644 --- a/src/drivers/ati/ragexl/mach64_ct.c +++ b/src/drivers/ati/ragexl/mach64_ct.c @@ -284,7 +284,7 @@ int aty_var_to_pll_ct(const struct fb_info_aty *info, u32 vclk_per, aty_calc_pll_ct(info, &pll->ct); return 0; } -#if CONFIG_CONSOLE_BTEXT==1 +#if CONFIG_CONSOLE_BTEXT #if PLL_CRTC_DECODE==1 u32 aty_pll_ct_to_var(const struct fb_info_aty *info, const union aty_pll *pll) diff --git a/src/drivers/ati/ragexl/xlinit.c b/src/drivers/ati/ragexl/xlinit.c index 747b343cc8..36a06199b7 100644 --- a/src/drivers/ati/ragexl/xlinit.c +++ b/src/drivers/ati/ragexl/xlinit.c @@ -28,7 +28,7 @@ // Hence do only remove this if you fix the code. #define CONFIG_CONSOLE_BTEXT 0 -#if CONFIG_CONSOLE_BTEXT==1 +#if CONFIG_CONSOLE_BTEXT #define PLL_CRTC_DECODE 0 #define SUPPORT_8_BPP_ABOVE 0 @@ -393,7 +393,7 @@ static char m64n_xl_33[] = "3D RAGE (XL PCI-33MHz)"; static char m64n_xl_66[] = "3D RAGE (XL PCI-66MHz)"; -#if CONFIG_CONSOLE_BTEXT==1 +#if CONFIG_CONSOLE_BTEXT static void aty_set_crtc(const struct fb_info_aty *info, const struct crtc *crtc); static int aty_var_to_crtc(const struct fb_info_aty *info, @@ -455,7 +455,7 @@ static struct { /* 3D RAGE XL PCI-33/BGA */ { 0x4752, 0x4752, 0x00, 0x00, m64n_xl_33, 230, 83, 63, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT | M64F_XL_DLL | M64F_MFB_TIMES_4 }, }; -#if CONFIG_CONSOLE_BTEXT==1 +#if CONFIG_CONSOLE_BTEXT static void aty_calc_mem_refresh(struct fb_info_aty *info, u16 id, int xclk) { int i, size; @@ -502,7 +502,7 @@ static void ati_ragexl_init(device_t dev) #endif int pll, mclk, xclk; -#if CONFIG_CONSOLE_BTEXT==1 +#if CONFIG_CONSOLE_BTEXT #if 0 int gtb_memsize, k; @@ -532,7 +532,7 @@ static void ati_ragexl_init(device_t dev) res = res->next; } -#if CONFIG_CONSOLE_BTEXT==1 +#if CONFIG_CONSOLE_BTEXT info->frame_buffer = res->base; #endif /* CONFIG_CONSOLE_BTEXT */ @@ -548,7 +548,7 @@ static void ati_ragexl_init(device_t dev) #endif -#if CONFIG_CONSOLE_BTEXT==1 +#if CONFIG_CONSOLE_BTEXT info->aty_cmap_regs = (struct aty_cmap_regs *)(info->ati_regbase+0xc0); #endif @@ -581,7 +581,7 @@ found: mclk = 63; } #endif -#if CONFIG_CONSOLE_BTEXT==1 +#if CONFIG_CONSOLE_BTEXT aty_calc_mem_refresh(info, type, xclk); #endif /* CONFIG_CONSOLE_BTEXT */ @@ -596,7 +596,7 @@ found: atyfb_xl_init(info); -#if CONFIG_CONSOLE_BTEXT==1 +#if CONFIG_CONSOLE_BTEXT info->ram_type = (aty_ld_le32(CONFIG_STAT0, info) & 0x07); @@ -803,7 +803,7 @@ found: } -#if CONFIG_CONSOLE_BTEXT==1 +#if CONFIG_CONSOLE_BTEXT static int atyfb_decode_var(const struct fb_var_screeninfo *var, struct atyfb_par *par, -- cgit v1.2.3