summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAristo Chen <[email protected]>2026-05-26 01:41:40 +0000
committerTom Rini <[email protected]>2026-06-10 14:49:46 -0600
commit6c636eabbde7f7915fe37c84395b23c61c66ce64 (patch)
tree03896935cc408414bd08ce76d336281eeb5f2c25 /include
parent1cc0442ede5444b76356bcba9aaeb11750e97b65 (diff)
treewide: prefer __func__ over __FUNCTION__ and __PRETTY_FUNCTION__
__FUNCTION__ and __PRETTY_FUNCTION__ are gcc extensions that predate the C99 __func__ identifier. scripts/checkpatch.pl emits a warning for any new use of __FUNCTION__ and recommends __func__ instead. In C (unlike C++) __PRETTY_FUNCTION__ is identical to __func__ because C function names do not carry signature information, so the distinction has no behavioural effect here. The majority of the tree already uses __func__, but a handful of older files in arch/, board/, boot/, drivers/, examples/ and include/ still carry the gcc spellings (55 occurrences of __FUNCTION__ across 19 files plus one __PRETTY_FUNCTION__ in drivers/usb/musb-new/omap2430.c). Convert them all to the C99 form so the tree is consistent and new patches in these areas do not have to follow an outdated local style. Ten "Unnecessary ftrace-like logging - prefer using ftrace" warnings remain on the printf("%s\n", __func__) and dbg("%s\n", __func__) function-entry traces in drivers/net/rtl8169.c (behind DEBUG_RTL8169* preprocessor guards) and drivers/usb/host/ohci-hcd.c. checkpatch matches the literal "%s\n", __func__ shape regardless of the wrapper, so silencing those warnings would require changing the debug message text or removing the traces entirely. Signed-off-by: Aristo Chen <[email protected]> Reviewed-by: Tom Rini <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/usbdevice.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/usbdevice.h b/include/usbdevice.h
index d173c1c4e37..76fda5ff90b 100644
--- a/include/usbdevice.h
+++ b/include/usbdevice.h
@@ -22,19 +22,19 @@
#define MAX_URBS_QUEUED 5
#if 1
-#define usberr(fmt,args...) serial_printf("ERROR: %s(), %d: "fmt"\n",__FUNCTION__,__LINE__,##args)
+#define usberr(fmt, args...) serial_printf("ERROR: %s(), %d: " fmt "\n", __func__, __LINE__, ##args)
#else
#define usberr(fmt,args...) do{}while(0)
#endif
#if 0
-#define usbdbg(fmt,args...) serial_printf("debug: %s(), %d: "fmt"\n",__FUNCTION__,__LINE__,##args)
+#define usbdbg(fmt, args...) serial_printf("debug: %s(), %d: " fmt "\n", __func__, __LINE__, ##args)
#else
#define usbdbg(fmt,args...) do{}while(0)
#endif
#if 0
-#define usbinfo(fmt,args...) serial_printf("info: %s(), %d: "fmt"\n",__FUNCTION__,__LINE__,##args)
+#define usbinfo(fmt, args...) serial_printf("info: %s(), %d: " fmt "\n", __func__, __LINE__, ##args)
#else
#define usbinfo(fmt,args...) do{}while(0)
#endif