usb: host: ehci.h: fix single statement macros
Subsystems (2)
PATCH v3 4/9 usb: host: ehci.h: fix single statement macros
Don't use the 'do {} while (0)' wrapper in a single statement macro.
Caught by checkpatch: "WARNING: Single statement macros should not use a do {} while (0) loop"
---
Change in v3:
- There's no need to evaluate COUNT(x) in #ifdef EHCI_STATS false branch. Thus an empty #define is the choice.
--- drivers/usb/host/ehci.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/ehci.h +2 -2
@@ -244,9 +244,9 @@ struct ehci_hcd { /* one per controller *//* irq statistics */ #ifdef EHCI_STATS struct ehci_stats stats; -# define COUNT (x) do { (x)++; } while (0) +# define COUNT (x) ((x)++)#else -# define COUNT (x) do {} while (0) +# define COUNT (x)#endif /* debug files */
Signature · 1 line
2.6.3
Greg Kroah-Hartman
maintainerQuoted 10 lines · Geyslan G. Bem
Don't use the 'do {} while (0)' wrapper in a single statement macro.
Caught by checkpatch: "WARNING: Single statement macros should not use a do {} while (0) loop"
Signed-off-by Geyslan G. Bem <[email protected]>---
Change in v3:
- There's no need to evaluate COUNT(x) in #ifdefEHCI_STATSfalse branch. Thus an empty #define is the choice.
Odd numbering scheme of patches, I can't figure this out...
Can you resend this whole series so I know I got it all correct?
thanks,
greg k-h
2015-12-11 13:30 GMT-03:00 Greg Kroah-Hartman <[email protected]>:
Quoted 6 lines · Geyslan G. Bem
Quoted 5 lines
Don't use the 'do {} while (0)' wrapper in a single statement macro.
Caught by checkpatch: "WARNING: Single statement macros should not use a do {} while (0) loop"
Quoted 7 lines
Quoted 5 lines
Signed-off-by Geyslan G. Bem <[email protected]>---
Change in v3:
- There's no need to evaluate COUNT(x) in #ifdefEHCI_STATSfalse branch. Thus an empty #define is the choice.Odd numbering scheme of patches, I can't figure this out...
Greg,
I sent new versions only to modified ones.
9 is v1.
4 is v3.
rest is v2.
Next time I'll send new versions for all.
Quoted 2 lines
Can you resend this whole series so I know I got it all correct?
I hope so. :-) Messing around with branches and merges here. I tell you soon.
Quoted 4 lines
thanks,
greg k-h
Signature · 4 lines
Regards, Geyslan G. Bem hackingbits.com
2015-12-11 17:55 GMT-03:00 Geyslan G. Bem <[email protected]>:
Quoted 21 lines
2015-12-11 13:30 GMT-03:00 Greg Kroah-Hartman <[email protected]>:
Quoted 6 lines · Geyslan G. Bem
Quoted 5 lines
Don't use the 'do {} while (0)' wrapper in a single statement macro.
Caught by checkpatch: "WARNING: Single statement macros should not use a do {} while (0) loop"
Quoted 7 lines
Quoted 5 lines
Signed-off-by Geyslan G. Bem <[email protected]>---
Change in v3:
- There's no need to evaluate COUNT(x) in #ifdefEHCI_STATSfalse branch. Thus an empty #define is the choice.Odd numbering scheme of patches, I can't figure this out...
Greg,
I sent new versions only to modified ones.
9 is v1.
4 is v3.
rest is v2.
Quoted 5 lines
Next time I'll send new versions for all.
Quoted 2 lines
Can you resend this whole series so I know I got it all correct?
I hope so. :-) Messing around with branches and merges here. I tell you soon.
Greg, please, grab them.
[PATCH resend 0/9] usb: host: ehci.h cleanup
Quoted 13 lines
Quoted 5 lines
thanks,
greg k-h
--
Regards,Geyslan G. Bem
hackingbits.com
Signature · 4 lines
Regards, Geyslan G. Bem hackingbits.com