Skip to contentSkip to conversation

checkpatch err - questioning adding parens

DISCUSSION Alison Schofield 2 participants 2 messages Oct 8, 2015

lore
Share & tools
lore
#0 lore raw

Looking at this checkpatch ERROR and hesitating to change because it looks worse to my eyes.

ERROR: Macros with complex values should be enclosed in parentheses
FILE: sm750_cursor.c:40:

Here's a short snippet (defines actually go on ~25 lines)

This...

	#define HWC_ADDRESS                         0x0
	#define HWC_ADDRESS_ENABLE                  31:31
	#define HWC_ADDRESS_ENABLE_DISABLE          0
	#define HWC_ADDRESS_ENABLE_ENABLE           1

would become this..

	#define HWC_ADDRESS                         (0x0)
	#define HWC_ADDRESS_ENABLE                  (31:31)
	#define HWC_ADDRESS_ENABLE_DISABLE          (0)
	#define HWC_ADDRESS_ENABLE_ENABLE           (1)

It is an ERROR... so what's my direction?

Thanks,
alisons

#1 lore raw
Quoted 14 lines · Alison Schofield

Looking at this checkpatch ERROR and hesitating to change because it looks worse to my eyes.

ERROR: Macros with complex values should be enclosed in parentheses
FILE: sm750_cursor.c:40:

Here's a short snippet (defines actually go on ~25 lines)

This...

	#define HWC_ADDRESS                         0x0
	#define HWC_ADDRESS_ENABLE                  31:31
	#define HWC_ADDRESS_ENABLE_DISABLE          0
	#define HWC_ADDRESS_ENABLE_ENABLE           1
Quoted 7 lines

would become this..

	#define HWC_ADDRESS                         (0x0)
	#define HWC_ADDRESS_ENABLE                  (31:31)
	#define HWC_ADDRESS_ENABLE_DISABLE          (0)
	#define HWC_ADDRESS_ENABLE_ENABLE           (1)

It is an ERROR... so what's my direction?

Just ignore it, it's a "false positive" in checkpatch, sorry about that.

thanks,

greg k-h