[U-Boot] [PATCH v2] usb: f_mass_storage: Fix compile on x86

Bryan O'Donoghue pure.logic at nexus-software.ie
Thu Apr 26 20:47:28 UTC 2018


Compiling the f_mass_storage driver for an x86 target results in a
compilation error as set_bit and clear_bit are provided by bitops.h

The local version of set_bit and clear_bit are doing some IP-block specific
bit-twiddling so we don't actually want to accidentally pick up the
bitops.h version of set_bit and clear bit.

This patch renames to _set_bit() and _clear_bit() respectively to avoid the
namespace collision.

Signed-off-by: Bryan O'Donoghue <pure.logic at nexus-software.ie>
Cc: Lukasz Majewski <lukma at denx.de>
Cc: Marek Vasut <marex at denx.de>
---
 drivers/usb/gadget/f_mass_storage.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 1ecb92ac6b..524c43419f 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -283,7 +283,7 @@ static const char fsg_string_interface[] = "Mass Storage";
 struct kref {int x; };
 struct completion {int x; };
 
-inline void set_bit(int nr, volatile void *addr)
+inline void _set_bit(int nr, volatile void *addr)
 {
 	int	mask;
 	unsigned int *a = (unsigned int *) addr;
@@ -293,7 +293,7 @@ inline void set_bit(int nr, volatile void *addr)
 	*a |= mask;
 }
 
-inline void clear_bit(int nr, volatile void *addr)
+inline void _clear_bit(int nr, volatile void *addr)
 {
 	int	mask;
 	unsigned int *a = (unsigned int *) addr;
@@ -2086,7 +2086,7 @@ static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh)
 		 * we can simply accept and discard any data received
 		 * until the next reset. */
 		wedge_bulk_in_endpoint(fsg);
-		set_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags);
+		_set_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags);
 		return -EINVAL;
 	}
 
@@ -2250,7 +2250,7 @@ reset:
 	fsg->bulk_out_enabled = 1;
 	common->bulk_out_maxpacket =
 				le16_to_cpu(get_unaligned(&d->wMaxPacketSize));
-	clear_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags);
+	_clear_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags);
 
 	/* Allocate the requests */
 	for (i = 0; i < FSG_NUM_BUFFERS; ++i) {
-- 
2.17.0



More information about the U-Boot mailing list