[U-Boot] [PATCH v2 2/4] gadget: f_mass_storge: fix compilation error for MIPS.

Purna Chandra Mandal purna.mandal at microchip.com
Mon Mar 7 14:19:35 CET 2016


Compiling USB mass storage gadget for MIPS reports redefinition error.
------------------
drivers/usb/gadget/f_mass_storage.c:286:13: error: redefinition of 'set_bit'
 inline void set_bit(int nr, volatile void *addr)
             ^
In file included from include/linux/bitops.h:123:0,
                 from include/common.h:20,
                 from drivers/usb/gadget/f_mass_storage.c:245:
./arch/mips/include/asm/bitops.h:328:24: note: previous definition of 'set_bit' was here
 static __inline__ void set_bit(int nr, volatile void * addr)
                        ^
drivers/usb/gadget/f_mass_storage.c:296:13: error: redefinition of 'clear_bit'
 inline void clear_bit(int nr, volatile void *addr)
             ^
In file included from include/linux/bitops.h:123:0,
                 from include/common.h:20,
                 from drivers/usb/gadget/f_mass_storage.c:245:
./arch/mips/include/asm/bitops.h:370:24: note: previous definition of 'clear_bit' was here
 static __inline__ void clear_bit(int nr, volatile void * addr)
-------------
Fixed it by allowing default implementation of set_bit(), clear_bit()
for non MIPS.

Signed-off-by: Purna Chandra Mandal <purna.mandal at microchip.com>
---

Changes in v2: None

 drivers/usb/gadget/f_mass_storage.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 1ecb92a..8ca02f2 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -283,6 +283,7 @@ static const char fsg_string_interface[] = "Mass Storage";
 struct kref {int x; };
 struct completion {int x; };
 
+#if !defined(CONFIG_MIPS)
 inline void set_bit(int nr, volatile void *addr)
 {
 	int	mask;
@@ -302,6 +303,7 @@ inline void clear_bit(int nr, volatile void *addr)
 	mask = 1 << (nr & 0x1f);
 	*a &= ~mask;
 }
+#endif
 
 struct fsg_dev;
 struct fsg_common;
-- 
1.8.3.1



More information about the U-Boot mailing list