[U-Boot] [PATCH 1/3] common: add ifdefs around bouncebuf.c body

Marek Vasut marex at denx.de
Tue Nov 6 01:54:03 CET 2012


Dear Stephen Warren,

> From: Stephen Warren <swarren at nvidia.com>
> 
> If a U-Boot config file enables CONFIG_BOUNCE_BUFFER only for the main
> U-Boot build and not for the SPL, then config.mk will contain
> CONFIG_BOUNCE_BUFFER=y, so common/Makefile will build bouncebuf.c for
> both the SPL and main U-Boot, but config.h won't set CONFIG_BOUNCE_BUFFER
> for the SPL, so bouncebuf.h will provide static inline functions, which
> will conflict with the compiled bouncebuf.c. Solve this by guarding the
> body of bouncebuf.c with the ifdef to avoid conflicts.

Uh, don't you want the bounce buffer not compiled in for SPL? Then maybe add 
CONFIG_SPL_BOUNCE_BUFFER to force BB to be compiled into SPL or something ...

> Signed-off-by: Stephen Warren <swarren at nvidia.com>
> ---
> This series is based on u-boot/master. I've CC'd the MMC and Tegra
> maintainers since they'll presumably need to ack the changes in order for
> these patches to all be applied in one place. Marek seems to be the main
> MXS MMC maintainer as far as I can tell.

What did I get myself into ... ;-)

>  common/bouncebuf.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/common/bouncebuf.c b/common/bouncebuf.c
> index 4f827f8..ffd3c90 100644
> --- a/common/bouncebuf.c
> +++ b/common/bouncebuf.c
> @@ -27,6 +27,7 @@
>  #include <errno.h>
>  #include <bouncebuf.h>
> 
> +#ifdef CONFIG_BOUNCE_BUFFER
>  static int addr_aligned(void *data, size_t len)
>  {
>  	const ulong align_mask = ARCH_DMA_MINALIGN - 1;
> @@ -90,3 +91,4 @@ int bounce_buffer_stop(void **data, size_t len, void
> **backup, uint8_t flags)
> 
>  	return 0;
>  }
> +#endif

Best regards,
Marek Vasut


More information about the U-Boot mailing list