CHECK: Macro argument reuse

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

The driver I'm working on has channels which can be configured similarly but with small changes. In order to simplify the code, I used macros with arguments for the parts that are different.
Unfortunately this leads to warnings during the checkpatch with --strict .

CHECK: Macro argument reuse 'num' - possible side-effects?
+#define ADE9078_POWER_FACTOR_CHANNEL(num, name) {		\
+	.type = IIO_POWER,						\
+	.channel = num,							\
+	.address = ADE9078_ADDR_ADJUST(ADE9078_REG_APF, num),	\
+	.extend_name = name "_factor",				\
+	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |		\
+			             BIT(IIO_CHAN_INFO_SCALE),		\
+	.scan_index = -1						\
+}

Is there any way to fix this warning without adding more arguments?
In this case, can it be ignored?

Regards,
Ciprian





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux