]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: frequency: ad9523: fix implicit variable macros
authorBhargav Joshi <rougueprince47@gmail.com>
Thu, 26 Feb 2026 23:10:55 +0000 (04:40 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 28 Feb 2026 12:15:19 +0000 (12:15 +0000)
The macros AD9523_CLK_DIST_DIV_PHASE_REV(x) and
AD9523_CLK_DIST_DIV_REV(x) implicitly relied on the variable named 'ret'
instead of using passed argument '(x)'. Update the macros to explicitly
use the argument '(x)' for their operations.

This also resolves the following checkpatch.pl warning: Argument '(x)'
is not used in function-like macro.

Signed-off-by: Bhargav Joshi <rougueprince47@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/frequency/ad9523.c

index 63c485e9e44cdd598418b8c89c71102643a1ad1a..5725ab62e0fddd45b0e47d2cb3bfc6f637dd8b66 100644 (file)
 
 /* AD9523_CHANNEL_CLOCK_DIST */
 #define AD9523_CLK_DIST_DIV_PHASE(x)           (((x) & 0x3F) << 18)
-#define AD9523_CLK_DIST_DIV_PHASE_REV(x)       ((ret >> 18) & 0x3F)
+#define AD9523_CLK_DIST_DIV_PHASE_REV(x)       (((x) >> 18) & 0x3F)
 #define AD9523_CLK_DIST_DIV(x)                 ((((x) - 1) & 0x3FF) << 8)
-#define AD9523_CLK_DIST_DIV_REV(x)             (((ret >> 8) & 0x3FF) + 1)
+#define AD9523_CLK_DIST_DIV_REV(x)             ((((x) >> 8) & 0x3FF) + 1)
 #define AD9523_CLK_DIST_INV_DIV_OUTPUT_EN      (1 << 7)
 #define AD9523_CLK_DIST_IGNORE_SYNC_EN         (1 << 6)
 #define AD9523_CLK_DIST_PWR_DOWN_EN            (1 << 5)