Linux IIO development
 help / color / mirror / Atom feed
* CHECK: Macro argument reuse
@ 2022-02-02 10:48 Hegbeli, Ciprian
  2022-02-05 17:43 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Hegbeli, Ciprian @ 2022-02-02 10:48 UTC (permalink / raw)
  To: linux-iio@vger.kernel.org

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-05 17:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-02 10:48 CHECK: Macro argument reuse Hegbeli, Ciprian
2022-02-05 17:43 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox