Skip to contentSkip to conversation

cris: Convert ffs from an object-like macro to a function-like macro

PATCH In review Geert Uytterhoeven 2 participants 2 messages Mar 10, 2014 – Mar 11, 2014 Bitops API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cris: Convert ffs from an object-like macro to a function-like macro

This avoids bad interactions with code using identifiers called "ffs":

drivers/usb/gadget/f_fs.c: In function 'ffsmod_init':
drivers/usb/gadget/f_fs.c:2693:494: error: 'ffsusb_func' undeclared (first use in this function) drivers/usb/gadget/f_fs.c:2693:494: note: each undeclared identifier is reported only once for each function it appears in drivers/usb/gadget/f_fs.c: In function 'ffsmod_exit':
drivers/usb/gadget/f_fs.c:2693:677: error: 'ffsusb_func' undeclared (first use in this function) drivers/usb/gadget/f_fs.c: At top level:
drivers/usb/gadget/f_fs.c:2693:35: warning: 'kernel_ffsusb_func' defined but not used [-Wunused-variable] drivers/usb/gadget/f_fs.c: In function 'ffsmod_init':
drivers/usb/gadget/f_fs.c:2693:15: warning: control reaches end of non-void function [-Wreturn-type]

---
http://kisskb.ellerman.id.au/kisskb/buildresult/10715817/

 arch/cris/include/asm/bitops.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/cris/include/asm/bitops.h +1 -1
index 184066ceb1f6..053c17b36559 100644
@@ -144,7 +144,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
  * definition, which doesn't have the same semantics.  We don't want to
  * use -fno-builtin, so just hide the name ffs.
  */
-#define ffs kernel_ffs
+#define ffs(x) kernel_ffs(x)
 
 #include <asm-generic/bitops/fls.h>
 #include <asm-generic/bitops/__fls.h>
Signature · 1 line
1.7.9.5
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Geert Uytterhoeven

This avoids bad interactions with code using identifiers called "ffs":

drivers/usb/gadget/f_fs.c: In function 'ffsmod_init':
drivers/usb/gadget/f_fs.c:2693:494: error: 'ffsusb_func' undeclared (first use in this function) drivers/usb/gadget/f_fs.c:2693:494: note: each undeclared identifier is reported only once for each function it appears in drivers/usb/gadget/f_fs.c: In function 'ffsmod_exit':
drivers/usb/gadget/f_fs.c:2693:677: error: 'ffsusb_func' undeclared (first use in this function) drivers/usb/gadget/f_fs.c: At top level:
drivers/usb/gadget/f_fs.c:2693:35: warning: 'kernel_ffsusb_func' defined but not used [-Wunused-variable] drivers/usb/gadget/f_fs.c: In function 'ffsmod_init':
drivers/usb/gadget/f_fs.c:2693:15: warning: control reaches end of non-void function [-Wreturn-type]

Yup, quite right. Andrew already added it to his queue, but for the mailing archives here's my:

Quoted 1 line

/^JN - Jesper Nilsson

Signature · 1 line
               Jesper Nilsson -- [email protected]