Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1678374 > unrolled thread
| Started by | Larry Finger <Larry.Finger@lwfinger.net> |
|---|---|
| First post | 2017-06-30 03:30 +0200 |
| Last post | 2017-06-30 05:20 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
Inconsistency in scripts/checkpatch.pl Larry Finger <Larry.Finger@lwfinger.net> - 2017-06-30 03:30 +0200
Re: Inconsistency in scripts/checkpatch.pl Joe Perches <joe@perches.com> - 2017-06-30 05:20 +0200
| From | Larry Finger <Larry.Finger@lwfinger.net> |
|---|---|
| Date | 2017-06-30 03:30 +0200 |
| Subject | Inconsistency in scripts/checkpatch.pl |
| Message-ID | <tXSUV-74w-17@gated-at.bofh.it> |
Andy and Joe, In some new rtlwifi code, I get the following for one of the new macros: CHECK: Macro argument '__h2c' may be better as '(__h2c)' to avoid precedence issues #45005: FILE: drivers/net/wireless/realtek/rtlwifi/halmac/halmac_original_h2c_nic.h:1163: +#define AOAC_RSVD_PAGE3_GET_LOC_AOAC_REPORT(__h2c) \ + LE_BITS_TO_4BYTE(__h2c + 0X00, 16, 8) When I make that change, I get CHECK: No space is necessary after a cast #45004: FILE: drivers/net/wireless/realtek/rtlwifi/halmac/halmac_original_h2c_nic.h:1162: + LE_BITS_TO_4BYTE((__h2c) + 0X00, 16, 8) Which CHECK should I fix? To my eye, the second form is the false positive. Larry
[toc] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2017-06-30 05:20 +0200 |
| Message-ID | <tXUDp-8jG-19@gated-at.bofh.it> |
| In reply to | #1678374 |
On Thu, 2017-06-29 at 20:26 -0500, Larry Finger wrote: > Andy and Joe, > > In some new rtlwifi code, I get the following for one of the new macros: > > CHECK: Macro argument '__h2c' may be better as '(__h2c)' to avoid precedence issues > #45005: FILE: > drivers/net/wireless/realtek/rtlwifi/halmac/halmac_original_h2c_nic.h:1163: > +#define AOAC_RSVD_PAGE3_GET_LOC_AOAC_REPORT(__h2c) \ > + LE_BITS_TO_4BYTE(__h2c + 0X00, 16, 8) > > When I make that change, I get > > CHECK: No space is necessary after a cast > #45004: FILE: > drivers/net/wireless/realtek/rtlwifi/halmac/halmac_original_h2c_nic.h:1162: > + LE_BITS_TO_4BYTE((__h2c) + 0X00, 16, 8) > > Which CHECK should I fix? The first. Only if you want to. > To my eye, the second form is the false positive. I agree. Ignore the 2nd warning for awhile. . A few trivial notes: o 0X00 is kinda ugly to me. 0x00 is nicer. o I presume that 0x00 could be a #define somewhere o AOAC_RSVD_PAGE3_GET_LOC_AOAC_REPORT is a rather long identifier at 35 chars.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web