All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] spl: Move check for SPL_LIBCOMMON support to header
@ 2017-01-06 19:09 Andrew F. Davis
  2017-01-06 19:09 ` [U-Boot] [PATCH 2/2] spl: Remove inline ifdef check for EXT and FAT support Andrew F. Davis
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Andrew F. Davis @ 2017-01-06 19:09 UTC (permalink / raw)
  To: u-boot

Print statements in SPL depend on lib/common support, so many such
statements are ifdef'd, move the check to the common.h header and
remove these inline checks.

Signed-off-by: Andrew F. Davis <afd@ti.com>
---
 common/spl/spl.c         |  2 --
 common/spl/spl_ext.c     |  8 --------
 common/spl/spl_fat.c     |  6 ------
 common/spl/spl_fit.c     |  4 ----
 common/spl/spl_mmc.c     | 18 ------------------
 common/spl/spl_sata.c    |  2 --
 common/spl/spl_usb.c     |  2 --
 drivers/mmc/mmc.c        | 10 ----------
 drivers/mmc/mmc_legacy.c |  2 --
 include/common.h         |  3 ++-
 10 files changed, 2 insertions(+), 55 deletions(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index b7ec333c8a..30b540797f 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -404,9 +404,7 @@ static int spl_load_image(u32 boot_device)
 		return spl_board_load_image();
 #endif
 	default:
-#if defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
 		puts("SPL: Unsupported Boot Device!\n");
-#endif
 		return -ENODEV;
 	}
 
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
index a85dc85ffe..9fe1c026bf 100644
--- a/common/spl/spl_ext.c
+++ b/common/spl/spl_ext.c
@@ -31,9 +31,7 @@ int spl_load_image_ext(struct blk_desc *block_dev,
 
 	err = ext4fs_mount(0);
 	if (!err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		printf("%s: ext4fs mount err - %d\n", __func__, err);
-#endif
 		goto end;
 	}
 
@@ -57,11 +55,9 @@ int spl_load_image_ext(struct blk_desc *block_dev,
 	err = ext4fs_read((char *)spl_image.load_addr, filelen, &actlen);
 
 end:
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 	if (err < 0)
 		printf("%s: error reading image %s, err - %d\n",
 		       __func__, filename, err);
-#endif
 
 	return err < 0;
 }
@@ -83,9 +79,7 @@ int spl_load_image_ext_os(struct blk_desc *block_dev, int partition)
 
 	err = ext4fs_mount(0);
 	if (!err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		printf("%s: ext4fs mount err - %d\n", __func__, err);
-#endif
 		return -1;
 	}
 #if defined(CONFIG_SPL_ENV_SUPPORT)
@@ -127,10 +121,8 @@ defaults:
 
 	err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen, &actlen);
 	if (err < 0) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		printf("%s: error reading image %s, err - %d\n",
 		       __func__, CONFIG_SPL_FS_LOAD_ARGS_NAME, err);
-#endif
 		return -1;
 	}
 
diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index 73d33f54fc..bb78445d6a 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -29,9 +29,7 @@ static int spl_register_fat_device(struct blk_desc *block_dev, int partition)
 
 	err = fat_register_device(block_dev, partition);
 	if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		printf("%s: fat register err - %d\n", __func__, err);
-#endif
 		return err;
 	}
 
@@ -93,11 +91,9 @@ int spl_load_image_fat(struct blk_desc *block_dev,
 	}
 
 end:
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 	if (err <= 0)
 		printf("%s: error reading image %s, err - %d\n",
 		       __func__, filename, err);
-#endif
 
 	return (err <= 0);
 }
@@ -141,10 +137,8 @@ defaults:
 	err = file_fat_read(CONFIG_SPL_FS_LOAD_ARGS_NAME,
 			    (void *)CONFIG_SYS_SPL_ARGS_ADDR, 0);
 	if (err <= 0) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		printf("%s: error reading image %s, err - %d\n",
 		       __func__, CONFIG_SPL_FS_LOAD_ARGS_NAME, err);
-#endif
 		return -1;
 	}
 
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index be86072c24..372eae85ce 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -40,10 +40,8 @@ static int spl_fit_select_fdt(const void *fdt, int images, int *fdt_offsetp)
 	     node = fdt_next_subnode(fdt, node)) {
 		name = fdt_getprop(fdt, node, "description", &len);
 		if (!name) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 			printf("%s: Missing FDT description in DTB\n",
 			       __func__);
-#endif
 			return -EINVAL;
 		}
 		if (board_fit_config_name_match(name))
@@ -72,7 +70,6 @@ static int spl_fit_select_fdt(const void *fdt, int images, int *fdt_offsetp)
 		return len;
 	}
 
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 	printf("No matching DT out of these options:\n");
 	for (node = fdt_first_subnode(fdt, conf);
 	     node >= 0;
@@ -80,7 +77,6 @@ static int spl_fit_select_fdt(const void *fdt, int images, int *fdt_offsetp)
 		name = fdt_getprop(fdt, node, "description", &len);
 		printf("   %s\n", name);
 	}
-#endif
 
 	return -ENOENT;
 }
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 7c7f32959b..0c561513c0 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -86,9 +86,7 @@ static int mmc_load_image_raw_sector(struct mmc *mmc, unsigned long sector)
 
 end:
 	if (ret) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		puts("mmc_load_image_raw_sector: mmc block read error\n");
-#endif
 		return -1;
 	}
 
@@ -105,9 +103,7 @@ int spl_mmc_get_device_index(u32 boot_device)
 		return 1;
 	}
 
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 	printf("spl: unsupported mmc boot device.\n");
-#endif
 
 	return -ENODEV;
 }
@@ -125,9 +121,7 @@ static int spl_mmc_find_device(struct mmc **mmcp, u32 boot_device)
 
 	err = mmc_initialize(NULL);
 	if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		printf("spl: could not initialize mmc. error: %d\n", err);
-#endif
 		return err;
 	}
 
@@ -140,9 +134,7 @@ static int spl_mmc_find_device(struct mmc **mmcp, u32 boot_device)
 	err = *mmcp ? 0 : -ENODEV;
 #endif
 	if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		printf("spl: could not find mmc device. error: %d\n", err);
-#endif
 		return err;
 	}
 
@@ -157,9 +149,7 @@ static int mmc_load_image_raw_partition(struct mmc *mmc, int partition)
 
 	err = part_get_info(mmc_get_blk_desc(mmc), partition, &info);
 	if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		puts("spl: partition error\n");
-#endif
 		return -1;
 	}
 
@@ -189,9 +179,7 @@ static int mmc_load_image_raw_os(struct mmc *mmc)
 		CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS,
 		(void *) CONFIG_SYS_SPL_ARGS_ADDR);
 	if (count == 0) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		puts("mmc_load_image_raw_os: mmc block read error\n");
-#endif
 		return -1;
 	}
 
@@ -280,9 +268,7 @@ int spl_mmc_load_image(u32 boot_device)
 
 	err = mmc_init(mmc);
 	if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		printf("spl: mmc init failed with error: %d\n", err);
-#endif
 		return err;
 	}
 
@@ -302,9 +288,7 @@ int spl_mmc_load_image(u32 boot_device)
 
 			err = blk_dselect_hwpart(mmc_get_blk_desc(mmc), part);
 			if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 				puts("spl: mmc partition switch failed\n");
-#endif
 				return err;
 			}
 			/* Fall through */
@@ -337,10 +321,8 @@ int spl_mmc_load_image(u32 boot_device)
 
 		break;
 	case MMCSD_MODE_UNDEFINED:
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 	default:
 		puts("spl: mmc: wrong boot mode\n");
-#endif
 	}
 
 	return err;
diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c
index 9d8cc7c2dd..d91cc724be 100644
--- a/common/spl/spl_sata.c
+++ b/common/spl/spl_sata.c
@@ -27,9 +27,7 @@ int spl_sata_load_image(void)
 
 	err = init_sata(CONFIG_SPL_SATA_BOOT_DEVICE);
 	if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		printf("spl: sata init failed: err - %d\n", err);
-#endif
 		return err;
 	} else {
 		/* try to recognize storage devices immediately */
diff --git a/common/spl/spl_usb.c b/common/spl/spl_usb.c
index 04fa66758c..05dc06a2db 100644
--- a/common/spl/spl_usb.c
+++ b/common/spl/spl_usb.c
@@ -30,9 +30,7 @@ int spl_usb_load_image(void)
 	usb_stop();
 	err = usb_init();
 	if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		printf("%s: usb init failed: err - %d\n", __func__, err);
-#endif
 		return err;
 	}
 
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 43ea0bba76..d7b2b6e21a 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -148,10 +148,8 @@ int mmc_send_status(struct mmc *mmc, int timeout)
 			     MMC_STATE_PRG)
 				break;
 			else if (cmd.response[0] & MMC_STATUS_MASK) {
-#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
 				printf("Status Error: 0x%08X\n",
 					cmd.response[0]);
-#endif
 				return -ECOMM;
 			}
 		} else if (--retries < 0)
@@ -165,9 +163,7 @@ int mmc_send_status(struct mmc *mmc, int timeout)
 
 	mmc_trace_state(mmc, &cmd);
 	if (timeout <= 0) {
-#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
 		printf("Timeout waiting card ready\n");
-#endif
 		return -ETIMEDOUT;
 	}
 
@@ -219,9 +215,7 @@ static int mmc_read_blocks(struct mmc *mmc, void *dst, lbaint_t start,
 		cmd.cmdarg = 0;
 		cmd.resp_type = MMC_RSP_R1b;
 		if (mmc_send_cmd(mmc, &cmd, NULL)) {
-#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
 			printf("mmc fail to send stop cmd\n");
-#endif
 			return 0;
 		}
 	}
@@ -1526,9 +1520,7 @@ int mmc_start_init(struct mmc *mmc)
 #endif
 	if (no_card) {
 		mmc->has_init = 0;
-#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
 		printf("MMC: no card present\n");
-#endif
 		return -ENOMEDIUM;
 	}
 
@@ -1572,9 +1564,7 @@ int mmc_start_init(struct mmc *mmc)
 		err = mmc_send_op_cond(mmc);
 
 		if (err) {
-#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
 			printf("Card did not respond to voltage select!\n");
-#endif
 			return -EOPNOTSUPP;
 		}
 	}
diff --git a/drivers/mmc/mmc_legacy.c b/drivers/mmc/mmc_legacy.c
index 25361d10f6..e57a065f73 100644
--- a/drivers/mmc/mmc_legacy.c
+++ b/drivers/mmc/mmc_legacy.c
@@ -25,9 +25,7 @@ struct mmc *find_mmc_device(int dev_num)
 			return m;
 	}
 
-#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
 	printf("MMC Device %d not found\n", dev_num);
-#endif
 
 	return NULL;
 }
diff --git a/include/common.h b/include/common.h
index e9f0dea308..0336917cc9 100644
--- a/include/common.h
+++ b/include/common.h
@@ -866,7 +866,8 @@ int	getc(void);
 int	tstc(void);
 
 /* stdout */
-#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_SERIAL_SUPPORT)
+#if defined(CONFIG_SPL_BUILD) && !(defined(CONFIG_SPL_SERIAL_SUPPORT) &&
+				   defined(CONFIG_SPL_LIBCOMMON_SUPPORT))
 #define	putc(...) do { } while (0)
 #define puts(...) do { } while (0)
 #define printf(...) do { } while (0)
-- 
2.11.0

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

* [U-Boot] [PATCH 2/2] spl: Remove inline ifdef check for EXT and FAT support
  2017-01-06 19:09 [U-Boot] [PATCH 1/2] spl: Move check for SPL_LIBCOMMON support to header Andrew F. Davis
@ 2017-01-06 19:09 ` Andrew F. Davis
  2017-01-06 19:33 ` [U-Boot] [PATCH 1/2] spl: Move check for SPL_LIBCOMMON support to header Andrew F. Davis
  2017-01-19 13:57 ` Simon Glass
  2 siblings, 0 replies; 7+ messages in thread
From: Andrew F. Davis @ 2017-01-06 19:09 UTC (permalink / raw)
  To: u-boot

These files are only included for build by the make system
when CONFIG_SPL_{EXT,FAT}_SUPPORT is enabled, remove the unneed
checks for these in the source files.

Signed-off-by: Andrew F. Davis <afd@ti.com>
---
 common/spl/spl_ext.c | 2 --
 common/spl/spl_fat.c | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
index 9fe1c026bf..954891f570 100644
--- a/common/spl/spl_ext.c
+++ b/common/spl/spl_ext.c
@@ -9,7 +9,6 @@
 #include <errno.h>
 #include <image.h>
 
-#ifdef CONFIG_SPL_EXT_SUPPORT
 int spl_load_image_ext(struct blk_desc *block_dev,
 						int partition,
 						const char *filename)
@@ -135,4 +134,3 @@ int spl_load_image_ext_os(struct blk_desc *block_dev, int partition)
 	return -ENOSYS;
 }
 #endif
-#endif
diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index bb78445d6a..9339dc81a3 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -19,7 +19,6 @@
 
 static int fat_registered;
 
-#ifdef CONFIG_SPL_FAT_SUPPORT
 static int spl_register_fat_device(struct blk_desc *block_dev, int partition)
 {
 	int err = 0;
@@ -151,4 +150,3 @@ int spl_load_image_fat_os(struct blk_desc *block_dev, int partition)
 	return -ENOSYS;
 }
 #endif
-#endif
-- 
2.11.0

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

* [U-Boot] [PATCH 1/2] spl: Move check for SPL_LIBCOMMON support to header
  2017-01-06 19:09 [U-Boot] [PATCH 1/2] spl: Move check for SPL_LIBCOMMON support to header Andrew F. Davis
  2017-01-06 19:09 ` [U-Boot] [PATCH 2/2] spl: Remove inline ifdef check for EXT and FAT support Andrew F. Davis
@ 2017-01-06 19:33 ` Andrew F. Davis
  2017-01-19 13:57 ` Simon Glass
  2 siblings, 0 replies; 7+ messages in thread
From: Andrew F. Davis @ 2017-01-06 19:33 UTC (permalink / raw)
  To: u-boot

This is not based on the latest upstream, please ignore.

Sorry for the noise.

Andrew

On 01/06/2017 01:09 PM, Andrew F. Davis wrote:
> Print statements in SPL depend on lib/common support, so many such
> statements are ifdef'd, move the check to the common.h header and
> remove these inline checks.
> 
> Signed-off-by: Andrew F. Davis <afd@ti.com>
> ---
>  common/spl/spl.c         |  2 --
>  common/spl/spl_ext.c     |  8 --------
>  common/spl/spl_fat.c     |  6 ------
>  common/spl/spl_fit.c     |  4 ----
>  common/spl/spl_mmc.c     | 18 ------------------
>  common/spl/spl_sata.c    |  2 --
>  common/spl/spl_usb.c     |  2 --
>  drivers/mmc/mmc.c        | 10 ----------
>  drivers/mmc/mmc_legacy.c |  2 --
>  include/common.h         |  3 ++-
>  10 files changed, 2 insertions(+), 55 deletions(-)
> 
> diff --git a/common/spl/spl.c b/common/spl/spl.c
> index b7ec333c8a..30b540797f 100644
> --- a/common/spl/spl.c
> +++ b/common/spl/spl.c
> @@ -404,9 +404,7 @@ static int spl_load_image(u32 boot_device)
>  		return spl_board_load_image();
>  #endif
>  	default:
> -#if defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
>  		puts("SPL: Unsupported Boot Device!\n");
> -#endif
>  		return -ENODEV;
>  	}
>  
> diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
> index a85dc85ffe..9fe1c026bf 100644
> --- a/common/spl/spl_ext.c
> +++ b/common/spl/spl_ext.c
> @@ -31,9 +31,7 @@ int spl_load_image_ext(struct blk_desc *block_dev,
>  
>  	err = ext4fs_mount(0);
>  	if (!err) {
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  		printf("%s: ext4fs mount err - %d\n", __func__, err);
> -#endif
>  		goto end;
>  	}
>  
> @@ -57,11 +55,9 @@ int spl_load_image_ext(struct blk_desc *block_dev,
>  	err = ext4fs_read((char *)spl_image.load_addr, filelen, &actlen);
>  
>  end:
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  	if (err < 0)
>  		printf("%s: error reading image %s, err - %d\n",
>  		       __func__, filename, err);
> -#endif
>  
>  	return err < 0;
>  }
> @@ -83,9 +79,7 @@ int spl_load_image_ext_os(struct blk_desc *block_dev, int partition)
>  
>  	err = ext4fs_mount(0);
>  	if (!err) {
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  		printf("%s: ext4fs mount err - %d\n", __func__, err);
> -#endif
>  		return -1;
>  	}
>  #if defined(CONFIG_SPL_ENV_SUPPORT)
> @@ -127,10 +121,8 @@ defaults:
>  
>  	err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen, &actlen);
>  	if (err < 0) {
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  		printf("%s: error reading image %s, err - %d\n",
>  		       __func__, CONFIG_SPL_FS_LOAD_ARGS_NAME, err);
> -#endif
>  		return -1;
>  	}
>  
> diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
> index 73d33f54fc..bb78445d6a 100644
> --- a/common/spl/spl_fat.c
> +++ b/common/spl/spl_fat.c
> @@ -29,9 +29,7 @@ static int spl_register_fat_device(struct blk_desc *block_dev, int partition)
>  
>  	err = fat_register_device(block_dev, partition);
>  	if (err) {
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  		printf("%s: fat register err - %d\n", __func__, err);
> -#endif
>  		return err;
>  	}
>  
> @@ -93,11 +91,9 @@ int spl_load_image_fat(struct blk_desc *block_dev,
>  	}
>  
>  end:
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  	if (err <= 0)
>  		printf("%s: error reading image %s, err - %d\n",
>  		       __func__, filename, err);
> -#endif
>  
>  	return (err <= 0);
>  }
> @@ -141,10 +137,8 @@ defaults:
>  	err = file_fat_read(CONFIG_SPL_FS_LOAD_ARGS_NAME,
>  			    (void *)CONFIG_SYS_SPL_ARGS_ADDR, 0);
>  	if (err <= 0) {
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  		printf("%s: error reading image %s, err - %d\n",
>  		       __func__, CONFIG_SPL_FS_LOAD_ARGS_NAME, err);
> -#endif
>  		return -1;
>  	}
>  
> diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
> index be86072c24..372eae85ce 100644
> --- a/common/spl/spl_fit.c
> +++ b/common/spl/spl_fit.c
> @@ -40,10 +40,8 @@ static int spl_fit_select_fdt(const void *fdt, int images, int *fdt_offsetp)
>  	     node = fdt_next_subnode(fdt, node)) {
>  		name = fdt_getprop(fdt, node, "description", &len);
>  		if (!name) {
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  			printf("%s: Missing FDT description in DTB\n",
>  			       __func__);
> -#endif
>  			return -EINVAL;
>  		}
>  		if (board_fit_config_name_match(name))
> @@ -72,7 +70,6 @@ static int spl_fit_select_fdt(const void *fdt, int images, int *fdt_offsetp)
>  		return len;
>  	}
>  
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  	printf("No matching DT out of these options:\n");
>  	for (node = fdt_first_subnode(fdt, conf);
>  	     node >= 0;
> @@ -80,7 +77,6 @@ static int spl_fit_select_fdt(const void *fdt, int images, int *fdt_offsetp)
>  		name = fdt_getprop(fdt, node, "description", &len);
>  		printf("   %s\n", name);
>  	}
> -#endif
>  
>  	return -ENOENT;
>  }
> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
> index 7c7f32959b..0c561513c0 100644
> --- a/common/spl/spl_mmc.c
> +++ b/common/spl/spl_mmc.c
> @@ -86,9 +86,7 @@ static int mmc_load_image_raw_sector(struct mmc *mmc, unsigned long sector)
>  
>  end:
>  	if (ret) {
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  		puts("mmc_load_image_raw_sector: mmc block read error\n");
> -#endif
>  		return -1;
>  	}
>  
> @@ -105,9 +103,7 @@ int spl_mmc_get_device_index(u32 boot_device)
>  		return 1;
>  	}
>  
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  	printf("spl: unsupported mmc boot device.\n");
> -#endif
>  
>  	return -ENODEV;
>  }
> @@ -125,9 +121,7 @@ static int spl_mmc_find_device(struct mmc **mmcp, u32 boot_device)
>  
>  	err = mmc_initialize(NULL);
>  	if (err) {
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  		printf("spl: could not initialize mmc. error: %d\n", err);
> -#endif
>  		return err;
>  	}
>  
> @@ -140,9 +134,7 @@ static int spl_mmc_find_device(struct mmc **mmcp, u32 boot_device)
>  	err = *mmcp ? 0 : -ENODEV;
>  #endif
>  	if (err) {
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  		printf("spl: could not find mmc device. error: %d\n", err);
> -#endif
>  		return err;
>  	}
>  
> @@ -157,9 +149,7 @@ static int mmc_load_image_raw_partition(struct mmc *mmc, int partition)
>  
>  	err = part_get_info(mmc_get_blk_desc(mmc), partition, &info);
>  	if (err) {
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  		puts("spl: partition error\n");
> -#endif
>  		return -1;
>  	}
>  
> @@ -189,9 +179,7 @@ static int mmc_load_image_raw_os(struct mmc *mmc)
>  		CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS,
>  		(void *) CONFIG_SYS_SPL_ARGS_ADDR);
>  	if (count == 0) {
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  		puts("mmc_load_image_raw_os: mmc block read error\n");
> -#endif
>  		return -1;
>  	}
>  
> @@ -280,9 +268,7 @@ int spl_mmc_load_image(u32 boot_device)
>  
>  	err = mmc_init(mmc);
>  	if (err) {
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  		printf("spl: mmc init failed with error: %d\n", err);
> -#endif
>  		return err;
>  	}
>  
> @@ -302,9 +288,7 @@ int spl_mmc_load_image(u32 boot_device)
>  
>  			err = blk_dselect_hwpart(mmc_get_blk_desc(mmc), part);
>  			if (err) {
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  				puts("spl: mmc partition switch failed\n");
> -#endif
>  				return err;
>  			}
>  			/* Fall through */
> @@ -337,10 +321,8 @@ int spl_mmc_load_image(u32 boot_device)
>  
>  		break;
>  	case MMCSD_MODE_UNDEFINED:
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  	default:
>  		puts("spl: mmc: wrong boot mode\n");
> -#endif
>  	}
>  
>  	return err;
> diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c
> index 9d8cc7c2dd..d91cc724be 100644
> --- a/common/spl/spl_sata.c
> +++ b/common/spl/spl_sata.c
> @@ -27,9 +27,7 @@ int spl_sata_load_image(void)
>  
>  	err = init_sata(CONFIG_SPL_SATA_BOOT_DEVICE);
>  	if (err) {
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  		printf("spl: sata init failed: err - %d\n", err);
> -#endif
>  		return err;
>  	} else {
>  		/* try to recognize storage devices immediately */
> diff --git a/common/spl/spl_usb.c b/common/spl/spl_usb.c
> index 04fa66758c..05dc06a2db 100644
> --- a/common/spl/spl_usb.c
> +++ b/common/spl/spl_usb.c
> @@ -30,9 +30,7 @@ int spl_usb_load_image(void)
>  	usb_stop();
>  	err = usb_init();
>  	if (err) {
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  		printf("%s: usb init failed: err - %d\n", __func__, err);
> -#endif
>  		return err;
>  	}
>  
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 43ea0bba76..d7b2b6e21a 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -148,10 +148,8 @@ int mmc_send_status(struct mmc *mmc, int timeout)
>  			     MMC_STATE_PRG)
>  				break;
>  			else if (cmd.response[0] & MMC_STATUS_MASK) {
> -#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
>  				printf("Status Error: 0x%08X\n",
>  					cmd.response[0]);
> -#endif
>  				return -ECOMM;
>  			}
>  		} else if (--retries < 0)
> @@ -165,9 +163,7 @@ int mmc_send_status(struct mmc *mmc, int timeout)
>  
>  	mmc_trace_state(mmc, &cmd);
>  	if (timeout <= 0) {
> -#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
>  		printf("Timeout waiting card ready\n");
> -#endif
>  		return -ETIMEDOUT;
>  	}
>  
> @@ -219,9 +215,7 @@ static int mmc_read_blocks(struct mmc *mmc, void *dst, lbaint_t start,
>  		cmd.cmdarg = 0;
>  		cmd.resp_type = MMC_RSP_R1b;
>  		if (mmc_send_cmd(mmc, &cmd, NULL)) {
> -#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
>  			printf("mmc fail to send stop cmd\n");
> -#endif
>  			return 0;
>  		}
>  	}
> @@ -1526,9 +1520,7 @@ int mmc_start_init(struct mmc *mmc)
>  #endif
>  	if (no_card) {
>  		mmc->has_init = 0;
> -#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
>  		printf("MMC: no card present\n");
> -#endif
>  		return -ENOMEDIUM;
>  	}
>  
> @@ -1572,9 +1564,7 @@ int mmc_start_init(struct mmc *mmc)
>  		err = mmc_send_op_cond(mmc);
>  
>  		if (err) {
> -#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
>  			printf("Card did not respond to voltage select!\n");
> -#endif
>  			return -EOPNOTSUPP;
>  		}
>  	}
> diff --git a/drivers/mmc/mmc_legacy.c b/drivers/mmc/mmc_legacy.c
> index 25361d10f6..e57a065f73 100644
> --- a/drivers/mmc/mmc_legacy.c
> +++ b/drivers/mmc/mmc_legacy.c
> @@ -25,9 +25,7 @@ struct mmc *find_mmc_device(int dev_num)
>  			return m;
>  	}
>  
> -#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
>  	printf("MMC Device %d not found\n", dev_num);
> -#endif
>  
>  	return NULL;
>  }
> diff --git a/include/common.h b/include/common.h
> index e9f0dea308..0336917cc9 100644
> --- a/include/common.h
> +++ b/include/common.h
> @@ -866,7 +866,8 @@ int	getc(void);
>  int	tstc(void);
>  
>  /* stdout */
> -#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_SERIAL_SUPPORT)
> +#if defined(CONFIG_SPL_BUILD) && !(defined(CONFIG_SPL_SERIAL_SUPPORT) &&
> +				   defined(CONFIG_SPL_LIBCOMMON_SUPPORT))
>  #define	putc(...) do { } while (0)
>  #define puts(...) do { } while (0)
>  #define printf(...) do { } while (0)
> 

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

* [U-Boot] [PATCH 1/2] spl: Move check for SPL_LIBCOMMON support to header
  2017-01-06 19:09 [U-Boot] [PATCH 1/2] spl: Move check for SPL_LIBCOMMON support to header Andrew F. Davis
  2017-01-06 19:09 ` [U-Boot] [PATCH 2/2] spl: Remove inline ifdef check for EXT and FAT support Andrew F. Davis
  2017-01-06 19:33 ` [U-Boot] [PATCH 1/2] spl: Move check for SPL_LIBCOMMON support to header Andrew F. Davis
@ 2017-01-19 13:57 ` Simon Glass
  2 siblings, 0 replies; 7+ messages in thread
From: Simon Glass @ 2017-01-19 13:57 UTC (permalink / raw)
  To: u-boot

On 6 January 2017 at 12:09, Andrew F. Davis <afd@ti.com> wrote:
>
> Print statements in SPL depend on lib/common support, so many such
> statements are ifdef'd, move the check to the common.h header and
> remove these inline checks.
>
> Signed-off-by: Andrew F. Davis <afd@ti.com>
> ---
>  common/spl/spl.c         |  2 --
>  common/spl/spl_ext.c     |  8 --------
>  common/spl/spl_fat.c     |  6 ------
>  common/spl/spl_fit.c     |  4 ----
>  common/spl/spl_mmc.c     | 18 ------------------
>  common/spl/spl_sata.c    |  2 --
>  common/spl/spl_usb.c     |  2 --
>  drivers/mmc/mmc.c        | 10 ----------
>  drivers/mmc/mmc_legacy.c |  2 --
>  include/common.h         |  3 ++-
>  10 files changed, 2 insertions(+), 55 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

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

* [U-Boot] [PATCH 2/2] spl: Remove inline ifdef check for EXT and FAT support
  2017-01-11 16:28   ` Tom Rini
@ 2017-01-19 13:57     ` Simon Glass
  0 siblings, 0 replies; 7+ messages in thread
From: Simon Glass @ 2017-01-19 13:57 UTC (permalink / raw)
  To: u-boot

On 11 January 2017 at 09:28, Tom Rini <trini@konsulko.com> wrote:
> On Fri, Jan 06, 2017 at 01:35:45PM -0600, Andrew F. Davis wrote:
>
>> These files are only included for build by the make system
>> when CONFIG_SPL_{EXT,FAT}_SUPPORT is enabled, remove the unneed
>> checks for these in the source files.
>>
>> Signed-off-by: Andrew F. Davis <afd@ti.com>
>
> Reviewed-by: Tom Rini <trini@konsulko.com>
>
> --
> Tom

Reviewed-by: Simon Glass <sjg@chromium.org>

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

* [U-Boot] [PATCH 2/2] spl: Remove inline ifdef check for EXT and FAT support
  2017-01-06 19:35 ` [U-Boot] [PATCH 2/2] spl: Remove inline ifdef check for EXT and FAT support Andrew F. Davis
@ 2017-01-11 16:28   ` Tom Rini
  2017-01-19 13:57     ` Simon Glass
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Rini @ 2017-01-11 16:28 UTC (permalink / raw)
  To: u-boot

On Fri, Jan 06, 2017 at 01:35:45PM -0600, Andrew F. Davis wrote:

> These files are only included for build by the make system
> when CONFIG_SPL_{EXT,FAT}_SUPPORT is enabled, remove the unneed
> checks for these in the source files.
> 
> Signed-off-by: Andrew F. Davis <afd@ti.com>

Reviewed-by: Tom Rini <trini@konsulko.com>

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

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

* [U-Boot] [PATCH 2/2] spl: Remove inline ifdef check for EXT and FAT support
  2017-01-06 19:35 Andrew F. Davis
@ 2017-01-06 19:35 ` Andrew F. Davis
  2017-01-11 16:28   ` Tom Rini
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew F. Davis @ 2017-01-06 19:35 UTC (permalink / raw)
  To: u-boot

These files are only included for build by the make system
when CONFIG_SPL_{EXT,FAT}_SUPPORT is enabled, remove the unneed
checks for these in the source files.

Signed-off-by: Andrew F. Davis <afd@ti.com>
---
 common/spl/spl_ext.c | 2 --
 common/spl/spl_fat.c | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
index 6165f88d2b..a58f7ef3fe 100644
--- a/common/spl/spl_ext.c
+++ b/common/spl/spl_ext.c
@@ -9,7 +9,6 @@
 #include <errno.h>
 #include <image.h>
 
-#ifdef CONFIG_SPL_EXT_SUPPORT
 int spl_load_image_ext(struct spl_image_info *spl_image,
 		       struct blk_desc *block_dev, int partition,
 		       const char *filename)
@@ -138,4 +137,3 @@ int spl_load_image_ext_os(struct spl_image_info *spl_image,
 	return -ENOSYS;
 }
 #endif
-#endif
diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index aa5a39e4f7..66917ffa4f 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -19,7 +19,6 @@
 
 static int fat_registered;
 
-#ifdef CONFIG_SPL_FAT_SUPPORT
 static int spl_register_fat_device(struct blk_desc *block_dev, int partition)
 {
 	int err = 0;
@@ -154,4 +153,3 @@ int spl_load_image_fat_os(struct spl_image_info *spl_image,
 	return -ENOSYS;
 }
 #endif
-#endif
-- 
2.11.0

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

end of thread, other threads:[~2017-01-19 13:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-06 19:09 [U-Boot] [PATCH 1/2] spl: Move check for SPL_LIBCOMMON support to header Andrew F. Davis
2017-01-06 19:09 ` [U-Boot] [PATCH 2/2] spl: Remove inline ifdef check for EXT and FAT support Andrew F. Davis
2017-01-06 19:33 ` [U-Boot] [PATCH 1/2] spl: Move check for SPL_LIBCOMMON support to header Andrew F. Davis
2017-01-19 13:57 ` Simon Glass
2017-01-06 19:35 Andrew F. Davis
2017-01-06 19:35 ` [U-Boot] [PATCH 2/2] spl: Remove inline ifdef check for EXT and FAT support Andrew F. Davis
2017-01-11 16:28   ` Tom Rini
2017-01-19 13:57     ` Simon Glass

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.