From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Tue, 6 Nov 2012 01:54:03 +0100 Subject: [U-Boot] [PATCH 1/3] common: add ifdefs around bouncebuf.c body In-Reply-To: <1352156642-7975-1-git-send-email-swarren@wwwdotorg.org> References: <1352156642-7975-1-git-send-email-swarren@wwwdotorg.org> Message-ID: <201211060154.03822.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Stephen Warren, > From: Stephen Warren > > 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 > --- > 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 > #include > > +#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