Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: use function attribute __maybe_unused

Substitute USB instances of __attribute__ ((unused)) functions with the
newly introduced __maybe_unused.

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

David Rientjes and committed by
Greg Kroah-Hartman
8234509c ba02978a

+16 -16
+3 -3
drivers/usb/gadget/pxa2xx_udc.h
··· 204 204 # define UDC_DEBUG DBG_NORMAL 205 205 #endif 206 206 207 - static void __attribute__ ((__unused__)) 207 + static void __maybe_unused 208 208 dump_udccr(const char *label) 209 209 { 210 210 u32 udccr = UDCCR; ··· 220 220 (udccr & UDCCR_UDE) ? " ude" : ""); 221 221 } 222 222 223 - static void __attribute__ ((__unused__)) 223 + static void __maybe_unused 224 224 dump_udccs0(const char *label) 225 225 { 226 226 u32 udccs0 = UDCCS0; ··· 237 237 (udccs0 & UDCCS0_OPR) ? " opr" : ""); 238 238 } 239 239 240 - static void __attribute__ ((__unused__)) 240 + static void __maybe_unused 241 241 dump_state(struct pxa2xx_udc *dev) 242 242 { 243 243 u32 tmp;
+11 -11
drivers/usb/host/ehci-dbg.c
··· 115 115 116 116 #ifdef DEBUG 117 117 118 - static void __attribute__((__unused__)) 118 + static void __maybe_unused 119 119 dbg_qtd (const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd) 120 120 { 121 121 ehci_dbg(ehci, "%s td %p n%08x %08x t%08x p0=%08x\n", label, qtd, ··· 131 131 hc32_to_cpup(ehci, &qtd->hw_buf[4])); 132 132 } 133 133 134 - static void __attribute__((__unused__)) 134 + static void __maybe_unused 135 135 dbg_qh (const char *label, struct ehci_hcd *ehci, struct ehci_qh *qh) 136 136 { 137 137 ehci_dbg (ehci, "%s qh %p n%08x info %x %x qtd %x\n", label, ··· 140 140 dbg_qtd ("overlay", ehci, (struct ehci_qtd *) &qh->hw_qtd_next); 141 141 } 142 142 143 - static void __attribute__((__unused__)) 143 + static void __maybe_unused 144 144 dbg_itd (const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd) 145 145 { 146 146 ehci_dbg (ehci, "%s [%d] itd %p, next %08x, urb %p\n", ··· 171 171 itd->index[6], itd->index[7]); 172 172 } 173 173 174 - static void __attribute__((__unused__)) 174 + static void __maybe_unused 175 175 dbg_sitd (const char *label, struct ehci_hcd *ehci, struct ehci_sitd *sitd) 176 176 { 177 177 ehci_dbg (ehci, "%s [%d] sitd %p, next %08x, urb %p\n", ··· 186 186 hc32_to_cpu(ehci, sitd->hw_buf[1])); 187 187 } 188 188 189 - static int __attribute__((__unused__)) 189 + static int __maybe_unused 190 190 dbg_status_buf (char *buf, unsigned len, const char *label, u32 status) 191 191 { 192 192 return scnprintf (buf, len, ··· 205 205 ); 206 206 } 207 207 208 - static int __attribute__((__unused__)) 208 + static int __maybe_unused 209 209 dbg_intr_buf (char *buf, unsigned len, const char *label, u32 enable) 210 210 { 211 211 return scnprintf (buf, len, ··· 273 273 } 274 274 275 275 #else 276 - static inline void __attribute__((__unused__)) 276 + static inline void __maybe_unused 277 277 dbg_qh (char *label, struct ehci_hcd *ehci, struct ehci_qh *qh) 278 278 {} 279 279 280 - static inline int __attribute__((__unused__)) 280 + static inline int __maybe_unused 281 281 dbg_status_buf (char *buf, unsigned len, const char *label, u32 status) 282 282 { return 0; } 283 283 284 - static inline int __attribute__((__unused__)) 284 + static inline int __maybe_unused 285 285 dbg_command_buf (char *buf, unsigned len, const char *label, u32 command) 286 286 { return 0; } 287 287 288 - static inline int __attribute__((__unused__)) 288 + static inline int __maybe_unused 289 289 dbg_intr_buf (char *buf, unsigned len, const char *label, u32 enable) 290 290 { return 0; } 291 291 292 - static inline int __attribute__((__unused__)) 292 + static inline int __maybe_unused 293 293 dbg_port_buf (char *buf, unsigned len, const char *label, int port, u32 status) 294 294 { return 0; } 295 295
+2 -2
drivers/usb/host/ohci-dbg.c
··· 23 23 /* debug| print the main components of an URB 24 24 * small: 0) header + data packets 1) just header 25 25 */ 26 - static void __attribute__((unused)) 26 + static void __maybe_unused 27 27 urb_print (struct urb * urb, char * str, int small) 28 28 { 29 29 unsigned int pipe= urb->pipe; ··· 338 338 } 339 339 340 340 /* caller MUST own hcd spinlock if verbose is set! */ 341 - static void __attribute__((unused)) 341 + static void __maybe_unused 342 342 ohci_dump_ed (const struct ohci_hcd *ohci, const char *label, 343 343 const struct ed *ed, int verbose) 344 344 {