All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] configs: Remove empty #ifdef/#ifndef blocks from configs
@ 2018-06-02  5:42 Alex Kiernan
  2018-06-03 11:17 ` Chris Packham
  2018-07-11 12:41 ` [U-Boot] " Tom Rini
  0 siblings, 2 replies; 5+ messages in thread
From: Alex Kiernan @ 2018-06-02  5:42 UTC (permalink / raw)
  To: u-boot

Remove empty #ifdef/#ifndef..#endif blocks where the configuration they
guarded has been completely removed.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---

 arch/powerpc/include/asm/config.h    | 3 ---
 include/configs/MPC8610HPCD.h        | 2 --
 include/configs/P1022DS.h            | 3 ---
 include/configs/T102xQDS.h           | 2 --
 include/configs/T208xQDS.h           | 2 --
 include/configs/UCP1020.h            | 2 --
 include/configs/advantech_dms-ba16.h | 3 ---
 include/configs/controlcenterd.h     | 3 ---
 include/configs/cyrus.h              | 3 ---
 include/configs/ea20.h               | 7 -------
 include/configs/ethernut5.h          | 3 ---
 include/configs/ge_bx50v3.h          | 3 ---
 include/configs/ipam390.h            | 3 ---
 include/configs/lacie_kw.h           | 6 ------
 include/configs/mx6ul_14x14_evk.h    | 3 ---
 include/configs/omapl138_lcdk.h      | 3 ---
 include/configs/sunxi-common.h       | 3 ---
 include/configs/tegra-common-post.h  | 4 ----
 include/configs/zynq-common.h        | 4 ----
 19 files changed, 62 deletions(-)

diff --git a/arch/powerpc/include/asm/config.h b/arch/powerpc/include/asm/config.h
index 284cfe21ab..bf11f40e23 100644
--- a/arch/powerpc/include/asm/config.h
+++ b/arch/powerpc/include/asm/config.h
@@ -14,9 +14,6 @@
 #include <asm/config_mpc86xx.h>
 #endif
 
-#ifdef CONFIG_MPC83xx
-#endif
-
 #ifndef HWCONFIG_BUFFER_SIZE
   #define HWCONFIG_BUFFER_SIZE 256
 #endif
diff --git a/include/configs/MPC8610HPCD.h b/include/configs/MPC8610HPCD.h
index 24f9fca53c..ddfb241010 100644
--- a/include/configs/MPC8610HPCD.h
+++ b/include/configs/MPC8610HPCD.h
@@ -259,8 +259,6 @@
 #define CONFIG_PCI_SCAN_SHOW		/* show pci devices on startup */
 
 #define CONFIG_ULI526X
-#ifdef CONFIG_ULI526X
-#endif
 
 /************************************************************
  * USB support
diff --git a/include/configs/P1022DS.h b/include/configs/P1022DS.h
index 1b347541c0..63a4d12560 100644
--- a/include/configs/P1022DS.h
+++ b/include/configs/P1022DS.h
@@ -363,9 +363,6 @@
 #undef CONFIG_SYS_FLASH_EMPTY_INFO
 #endif
 
-#ifndef CONFIG_FSL_DIU_FB
-#endif
-
 #ifdef CONFIG_ATI
 #define VIDEO_IO_OFFSET		CONFIG_SYS_PCIE1_IO_VIRT
 #define CONFIG_BIOSEMU
diff --git a/include/configs/T102xQDS.h b/include/configs/T102xQDS.h
index e457135e56..042cc360ad 100644
--- a/include/configs/T102xQDS.h
+++ b/include/configs/T102xQDS.h
@@ -515,8 +515,6 @@ unsigned long get_board_ddr_clk(void);
 /*
  * eSPI - Enhanced SPI
  */
-#ifndef CONFIG_SPL_BUILD
-#endif
 #define CONFIG_SPI_FLASH_BAR
 #define CONFIG_SF_DEFAULT_SPEED	 10000000
 #define CONFIG_SF_DEFAULT_MODE	  0
diff --git a/include/configs/T208xQDS.h b/include/configs/T208xQDS.h
index f5d454b002..ba7980a22d 100644
--- a/include/configs/T208xQDS.h
+++ b/include/configs/T208xQDS.h
@@ -509,8 +509,6 @@ unsigned long get_board_ddr_clk(void);
  * eSPI - Enhanced SPI
  */
 #ifdef CONFIG_SPI_FLASH
-#ifndef CONFIG_SPL_BUILD
-#endif
 
 #define CONFIG_SPI_FLASH_BAR
 #define CONFIG_SF_DEFAULT_SPEED	 10000000
diff --git a/include/configs/UCP1020.h b/include/configs/UCP1020.h
index 6231a1e4ae..fad1eabba3 100644
--- a/include/configs/UCP1020.h
+++ b/include/configs/UCP1020.h
@@ -38,8 +38,6 @@
 #define CONFIG_NETMASK		255.255.252.0
 #define CONFIG_ETHPRIME		"eTSEC3"
 
-#ifndef CONFIG_SPI_FLASH
-#endif
 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
 
 #define CONFIG_SYS_L2_SIZE	(256 << 10)
diff --git a/include/configs/advantech_dms-ba16.h b/include/configs/advantech_dms-ba16.h
index 8e33d38f97..586e7a77ca 100644
--- a/include/configs/advantech_dms-ba16.h
+++ b/include/configs/advantech_dms-ba16.h
@@ -225,9 +225,6 @@
 #define CONFIG_ENV_SPI_MODE             CONFIG_SF_DEFAULT_MODE
 #define CONFIG_ENV_SPI_MAX_HZ           CONFIG_SF_DEFAULT_SPEED
 
-#ifndef CONFIG_SYS_DCACHE_OFF
-#endif
-
 #define CONFIG_SYS_FSL_USDHC_NUM        3
 
 /* Framebuffer */
diff --git a/include/configs/controlcenterd.h b/include/configs/controlcenterd.h
index 1fe6f2fa5e..e5bf048398 100644
--- a/include/configs/controlcenterd.h
+++ b/include/configs/controlcenterd.h
@@ -177,9 +177,6 @@
 #define CONFIG_SYS_FSL_I2C2_SLAVE	0x7F
 #define CONFIG_SYS_FSL_I2C2_OFFSET	0x3100
 
-#ifndef CONFIG_TRAILBLAZER
-#endif
-
 #define CONFIG_PCA9698			/* NXP PCA9698 */
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x52
diff --git a/include/configs/cyrus.h b/include/configs/cyrus.h
index 6ce2bc0042..0ce9a35f11 100644
--- a/include/configs/cyrus.h
+++ b/include/configs/cyrus.h
@@ -475,7 +475,4 @@
 
 #include <asm/fsl_secure_boot.h>
 
-#ifdef CONFIG_SECURE_BOOT
-#endif
-
 #endif	/* __CONFIG_H */
diff --git a/include/configs/ea20.h b/include/configs/ea20.h
index c84cd962d7..ee122ad7a4 100644
--- a/include/configs/ea20.h
+++ b/include/configs/ea20.h
@@ -111,9 +111,6 @@
 #define CONFIG_CLOCKS
 #endif
 
-#ifndef CONFIG_DRIVER_TI_EMAC
-#endif
-
 /* NAND Setup */
 #ifdef CONFIG_SYS_USE_NAND
 #define CONFIG_MTD_DEVICE
@@ -130,10 +127,6 @@
 #define CONFIG_SYS_MAX_NAND_DEVICE	1 /* Max number of NAND devices */
 #endif
 
-/* SPI Flash */
-#ifdef CONFIG_USE_SPIFLASH
-#endif
-
 #if !defined(CONFIG_SYS_USE_NAND) && \
 	!defined(CONFIG_USE_NOR) && \
 	!defined(CONFIG_USE_SPIFLASH)
diff --git a/include/configs/ethernut5.h b/include/configs/ethernut5.h
index ca5c65fe5a..8913c1609c 100644
--- a/include/configs/ethernut5.h
+++ b/include/configs/ethernut5.h
@@ -58,9 +58,6 @@
 #define CONFIG_ENV_SECT_SIZE	CONFIG_ENV_SIZE
 #define CONFIG_ENV_SPI_MAX_HZ	15000000
 
-#ifndef MINIMAL_LOADER
-#endif
-
 /* NAND flash */
 #ifdef CONFIG_CMD_NAND
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h
index 1b947db9d4..fef41a8a18 100644
--- a/include/configs/ge_bx50v3.h
+++ b/include/configs/ge_bx50v3.h
@@ -188,9 +188,6 @@
 #define CONFIG_ENV_SPI_MODE		CONFIG_SF_DEFAULT_MODE
 #define CONFIG_ENV_SPI_MAX_HZ		CONFIG_SF_DEFAULT_SPEED
 
-#ifndef CONFIG_SYS_DCACHE_OFF
-#endif
-
 #define CONFIG_SYS_FSL_USDHC_NUM	3
 
 /* Framebuffer */
diff --git a/include/configs/ipam390.h b/include/configs/ipam390.h
index faf21ddb08..08978fa658 100644
--- a/include/configs/ipam390.h
+++ b/include/configs/ipam390.h
@@ -212,9 +212,6 @@
 #define CONFIG_CLOCKS
 #endif
 
-#ifndef CONFIG_DRIVER_TI_EMAC
-#endif
-
 #define CONFIG_MTD_DEVICE
 #define CONFIG_MTD_PARTITIONS
 
diff --git a/include/configs/lacie_kw.h b/include/configs/lacie_kw.h
index ac9ac4aeaa..8af8fd5c63 100644
--- a/include/configs/lacie_kw.h
+++ b/include/configs/lacie_kw.h
@@ -39,12 +39,6 @@
 #endif
 #define CONFIG_SKIP_LOWLEVEL_INIT	/* disable board lowlevel_init */
 
-/*
- * Commands configuration
- */
-#ifndef CONFIG_NETSPACE_MINI_V2 /* No USB ports on Network Space v2 Mini */
-#endif
-
 /*
  * Core clock definition
  */
diff --git a/include/configs/mx6ul_14x14_evk.h b/include/configs/mx6ul_14x14_evk.h
index 31305aab1b..da2a67fc21 100644
--- a/include/configs/mx6ul_14x14_evk.h
+++ b/include/configs/mx6ul_14x14_evk.h
@@ -166,9 +166,6 @@
 #define CONFIG_SYS_MMC_ENV_PART		0	/* user area */
 #define CONFIG_MMCROOT			"/dev/mmcblk1p2"  /* USDHC2 */
 
-#ifndef CONFIG_SYS_DCACHE_OFF
-#endif
-
 #ifdef CONFIG_FSL_QSPI
 #define CONFIG_SF_DEFAULT_BUS		0
 #define CONFIG_SF_DEFAULT_CS		0
diff --git a/include/configs/omapl138_lcdk.h b/include/configs/omapl138_lcdk.h
index 58624ec581..879c8a0cff 100644
--- a/include/configs/omapl138_lcdk.h
+++ b/include/configs/omapl138_lcdk.h
@@ -259,9 +259,6 @@
 #define CONFIG_CLOCKS
 #endif
 
-#ifndef CONFIG_DRIVER_TI_EMAC
-#endif
-
 #ifdef CONFIG_USE_NAND
 #define CONFIG_MTD_DEVICE
 #define CONFIG_MTD_PARTITIONS
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index b515e9bb1f..21371f4919 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -301,9 +301,6 @@ extern int soft_i2c_gpio_scl;
 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1
 #endif
 
-#ifdef CONFIG_USB_FUNCTION_MASS_STORAGE
-#endif
-
 #ifdef CONFIG_USB_KEYBOARD
 #define CONFIG_PREBOOT
 #endif
diff --git a/include/configs/tegra-common-post.h b/include/configs/tegra-common-post.h
index 1c0046ac0d..e54428ba43 100644
--- a/include/configs/tegra-common-post.h
+++ b/include/configs/tegra-common-post.h
@@ -109,15 +109,11 @@
 #ifdef CONFIG_SYS_I2C_TEGRA
 #undef CONFIG_SYS_I2C_TEGRA
 #endif
-#ifdef CONFIG_CMD_I2C
-#endif
 
 /* remove USB */
 #ifdef CONFIG_USB_EHCI_TEGRA
 #undef CONFIG_USB_EHCI_TEGRA
 #endif
-#ifdef CONFIG_CMD_USB
-#endif
 
 #endif /* CONFIG_SPL_BUILD */
 
diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
index 55b983fc16..a6f2aceea1 100644
--- a/include/configs/zynq-common.h
+++ b/include/configs/zynq-common.h
@@ -40,10 +40,6 @@
 # define CONFIG_BOOTP_MAY_FAIL
 #endif
 
-/* SPI */
-#ifdef CONFIG_ZYNQ_SPI
-#endif
-
 /* QSPI */
 #ifdef CONFIG_ZYNQ_QSPI
 # define CONFIG_SF_DEFAULT_SPEED	30000000
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] configs: Remove empty #ifdef/#ifndef blocks from configs
  2018-06-02  5:42 [U-Boot] [PATCH] configs: Remove empty #ifdef/#ifndef blocks from configs Alex Kiernan
@ 2018-06-03 11:17 ` Chris Packham
  2018-06-03 14:20   ` Alex Kiernan
  2018-07-11 12:41 ` [U-Boot] " Tom Rini
  1 sibling, 1 reply; 5+ messages in thread
From: Chris Packham @ 2018-06-03 11:17 UTC (permalink / raw)
  To: u-boot

On Sun, 3 Jun 2018, 8:15 AM Alex Kiernan, <alex.kiernan@gmail.com> wrote:

> Remove empty #ifdef/#ifndef..#endif blocks where the configuration they
> guarded has been completely removed.
>
> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
>

Just out of interest how did you perform these changes? I sent a similar
patch for some kirkwood boards (manually generated) but I knew there was
bound to be more. If we could automate the process it could be integrated
with moveconfig.py.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] configs: Remove empty #ifdef/#ifndef blocks from configs
  2018-06-03 11:17 ` Chris Packham
@ 2018-06-03 14:20   ` Alex Kiernan
  2018-06-04  9:27     ` Chris Packham
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Kiernan @ 2018-06-03 14:20 UTC (permalink / raw)
  To: u-boot

On Sun, Jun 3, 2018 at 12:18 PM Chris Packham <judge.packham@gmail.com> wrote:
>
>
>
> On Sun, 3 Jun 2018, 8:15 AM Alex Kiernan, <alex.kiernan@gmail.com> wrote:
>>
>> Remove empty #ifdef/#ifndef..#endif blocks where the configuration they
>> guarded has been completely removed.
>>
>> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
>
>
> Just out of interest how did you perform these changes? I sent a similar patch for some kirkwood boards (manually generated) but I knew there was bound to be more. If we could automate the process it could be integrated with moveconfig.py.

Some horrid (and pretty dumb) sed & awk, something like:

for f in include/configs/*.h; do awk '/^\s*#\s*if/ {n=NR};
/^\s*#\s*endif/ && NR == n+1 {print n"d;"NR"d;"}' $f | sed -f - -i $f;
done

It was seeing yours that reminded I'd tripped over a few of them when
doing moveconfig.py manipulations and I should probably clean them up.
I did wonder if unifdef could be persuaded to do it, but I couldn't
immediately see a way of making it (without explicitly adding support
for it).

-- 
Alex Kiernan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] configs: Remove empty #ifdef/#ifndef blocks from configs
  2018-06-03 14:20   ` Alex Kiernan
@ 2018-06-04  9:27     ` Chris Packham
  0 siblings, 0 replies; 5+ messages in thread
From: Chris Packham @ 2018-06-04  9:27 UTC (permalink / raw)
  To: u-boot

On Mon, Jun 4, 2018 at 2:20 AM Alex Kiernan <alex.kiernan@gmail.com> wrote:
>
> On Sun, Jun 3, 2018 at 12:18 PM Chris Packham <judge.packham@gmail.com> wrote:
> >
> >
> >
> > On Sun, 3 Jun 2018, 8:15 AM Alex Kiernan, <alex.kiernan@gmail.com> wrote:
> >>
> >> Remove empty #ifdef/#ifndef..#endif blocks where the configuration they
> >> guarded has been completely removed.
> >>
> >> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> >
> >
> > Just out of interest how did you perform these changes? I sent a similar patch for some kirkwood boards (manually generated) but I knew there was bound to be more. If we could automate the process it could be integrated with moveconfig.py.
>
> Some horrid (and pretty dumb) sed & awk, something like:
>
> for f in include/configs/*.h; do awk '/^\s*#\s*if/ {n=NR};
> /^\s*#\s*endif/ && NR == n+1 {print n"d;"NR"d;"}' $f | sed -f - -i $f;
> done
>
> It was seeing yours that reminded I'd tripped over a few of them when
> doing moveconfig.py manipulations and I should probably clean them up.
> I did wonder if unifdef could be persuaded to do it, but I couldn't
> immediately see a way of making it (without explicitly adding support
> for it).

Python has a multi-line regex support so I think I've figured out a
way to automate it using that.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] configs: Remove empty #ifdef/#ifndef blocks from configs
  2018-06-02  5:42 [U-Boot] [PATCH] configs: Remove empty #ifdef/#ifndef blocks from configs Alex Kiernan
  2018-06-03 11:17 ` Chris Packham
@ 2018-07-11 12:41 ` Tom Rini
  1 sibling, 0 replies; 5+ messages in thread
From: Tom Rini @ 2018-07-11 12:41 UTC (permalink / raw)
  To: u-boot

On Sat, Jun 02, 2018 at 05:42:55AM +0000, Alex Kiernan wrote:

> Remove empty #ifdef/#ifndef..#endif blocks where the configuration they
> guarded has been completely removed.
> 
> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180711/d545509d/attachment.sig>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-07-11 12:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-02  5:42 [U-Boot] [PATCH] configs: Remove empty #ifdef/#ifndef blocks from configs Alex Kiernan
2018-06-03 11:17 ` Chris Packham
2018-06-03 14:20   ` Alex Kiernan
2018-06-04  9:27     ` Chris Packham
2018-07-11 12:41 ` [U-Boot] " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.