From: bhargav <rougueprince47@gmail.com>
To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org
Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
rougueprince47@gmail.com
Subject: [PATCH] iio:frequency:ad9523:convert symbolic permissions to octal and remove unwanted arguments in macro
Date: Thu, 19 Feb 2026 06:32:44 +0530 [thread overview]
Message-ID: <20260219010244.191668-1-rougueprince47@gmail.com> (raw)
this fixes following warnings in checkpatch
WARNING: Argument 'x' is not used in function-like macro
WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.
WARNING: Symbolic permissions 'S_IWUSR' are not preferred. Consider using octal permissions '0200'.
WARNING: Avoid multiple line dereference - prefer 'pdata->pll1_charge_pump_current_nA'
WARNING: Avoid multiple line dereference - prefer 'pdata->pll2_charge_pump_current_nA'
Signed-off-by: bhargav <rougueprince47@gmail.com>
---
drivers/iio/frequency/ad9523.c | 38 ++++++++++++++++------------------
1 file changed, 18 insertions(+), 20 deletions(-)
diff --git a/drivers/iio/frequency/ad9523.c b/drivers/iio/frequency/ad9523.c
index 63c485e9e44c..a445b775191b 100644
--- a/drivers/iio/frequency/ad9523.c
+++ b/drivers/iio/frequency/ad9523.c
@@ -167,9 +167,9 @@
/* 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 ((ret >> 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 (((ret >> 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)
@@ -558,52 +558,52 @@ static ssize_t ad9523_show(struct device *dev,
return ret;
}
-static IIO_DEVICE_ATTR(pll1_locked, S_IRUGO,
+static IIO_DEVICE_ATTR(pll1_locked, 0444,
ad9523_show,
NULL,
AD9523_STAT_PLL1_LD);
-static IIO_DEVICE_ATTR(pll2_locked, S_IRUGO,
+static IIO_DEVICE_ATTR(pll2_locked, 0444,
ad9523_show,
NULL,
AD9523_STAT_PLL2_LD);
-static IIO_DEVICE_ATTR(pll1_reference_clk_a_present, S_IRUGO,
+static IIO_DEVICE_ATTR(pll1_reference_clk_a_present, 0444,
ad9523_show,
NULL,
AD9523_STAT_REFA);
-static IIO_DEVICE_ATTR(pll1_reference_clk_b_present, S_IRUGO,
+static IIO_DEVICE_ATTR(pll1_reference_clk_b_present, 0444,
ad9523_show,
NULL,
AD9523_STAT_REFB);
-static IIO_DEVICE_ATTR(pll1_reference_clk_test_present, S_IRUGO,
+static IIO_DEVICE_ATTR(pll1_reference_clk_test_present, 0444,
ad9523_show,
NULL,
AD9523_STAT_REF_TEST);
-static IIO_DEVICE_ATTR(vcxo_clk_present, S_IRUGO,
+static IIO_DEVICE_ATTR(vcxo_clk_present, 0444,
ad9523_show,
NULL,
AD9523_STAT_VCXO);
-static IIO_DEVICE_ATTR(pll2_feedback_clk_present, S_IRUGO,
+static IIO_DEVICE_ATTR(pll2_feedback_clk_present, 0444,
ad9523_show,
NULL,
AD9523_STAT_PLL2_FB_CLK);
-static IIO_DEVICE_ATTR(pll2_reference_clk_present, S_IRUGO,
+static IIO_DEVICE_ATTR(pll2_reference_clk_present, 0444,
ad9523_show,
NULL,
AD9523_STAT_PLL2_REF_CLK);
-static IIO_DEVICE_ATTR(sync_dividers, S_IWUSR,
+static IIO_DEVICE_ATTR(sync_dividers, 0200,
NULL,
ad9523_store,
AD9523_SYNC);
-static IIO_DEVICE_ATTR(store_eeprom, S_IWUSR,
+static IIO_DEVICE_ATTR(store_eeprom, 0200,
NULL,
ad9523_store,
AD9523_EEPROM);
@@ -649,11 +649,11 @@ static int ad9523_read_raw(struct iio_dev *indio_dev,
return IIO_VAL_INT;
case IIO_CHAN_INFO_FREQUENCY:
*val = st->vco_out_freq[st->vco_out_map[chan->channel]] /
- AD9523_CLK_DIST_DIV_REV(ret);
+ AD9523_CLK_DIST_DIV_REV;
return IIO_VAL_INT;
case IIO_CHAN_INFO_PHASE:
- code = (AD9523_CLK_DIST_DIV_PHASE_REV(ret) * 3141592) /
- AD9523_CLK_DIST_DIV_REV(ret);
+ code = (AD9523_CLK_DIST_DIV_PHASE_REV * 3141592) /
+ AD9523_CLK_DIST_DIV_REV;
*val = code / 1000000;
*val2 = code % 1000000;
return IIO_VAL_INT_PLUS_MICRO;
@@ -701,7 +701,7 @@ static int ad9523_write_raw(struct iio_dev *indio_dev,
break;
case IIO_CHAN_INFO_PHASE:
code = val * 1000000 + val2 % 1000000;
- tmp = (code * AD9523_CLK_DIST_DIV_REV(ret)) / 3141592;
+ tmp = (code * AD9523_CLK_DIST_DIV_REV) / 3141592;
tmp = clamp(tmp, 0, 63);
reg &= ~AD9523_CLK_DIST_DIV_PHASE(~0);
reg |= AD9523_CLK_DIST_DIV_PHASE(tmp);
@@ -797,8 +797,7 @@ static int ad9523_setup(struct iio_dev *indio_dev)
return ret;
ret = ad9523_write(indio_dev, AD9523_PLL1_CHARGE_PUMP_CTRL,
- AD9523_PLL1_CHARGE_PUMP_CURRENT_nA(pdata->
- pll1_charge_pump_current_nA) |
+ AD9523_PLL1_CHARGE_PUMP_CURRENT_nA(pdata->pll1_charge_pump_current_nA) |
AD9523_PLL1_CHARGE_PUMP_MODE_NORMAL |
AD9523_PLL1_BACKLASH_PW_MIN);
if (ret < 0)
@@ -842,8 +841,7 @@ static int ad9523_setup(struct iio_dev *indio_dev)
*/
ret = ad9523_write(indio_dev, AD9523_PLL2_CHARGE_PUMP,
- AD9523_PLL2_CHARGE_PUMP_CURRENT_nA(pdata->
- pll2_charge_pump_current_nA));
+ AD9523_PLL2_CHARGE_PUMP_CURRENT_nA(pdata->pll2_charge_pump_current_nA));
if (ret < 0)
return ret;
--
2.53.0
next reply other threads:[~2026-02-19 1:03 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-19 1:02 bhargav [this message]
2026-02-19 7:44 ` Andy Shevchenko
2026-02-19 20:32 ` [PATCH v2 0/3] iio: frequency: ad9523: fix checkpatch warnings bhargav
2026-02-19 20:32 ` [PATCH v2 1/3] iio: frequency: ad9523: fix implicit variable usage in macros bhargav
2026-02-19 20:36 ` Andy Shevchenko
2026-02-19 20:32 ` [PATCH v2 2/3] iio: frequency: ad9523: avoid multiple line dereferences for pdata bhargav
2026-02-19 20:38 ` Andy Shevchenko
2026-02-19 20:32 ` [PATCH v2 3/3] iio: frequency: ad9523: fix checkpatch warnings for symbolic permissions bhargav
2026-02-19 20:46 ` Andy Shevchenko
2026-02-19 21:35 ` [PATCH v3 0/3] iio: frequency: ad9523: fix checkpatch warnings bhargav
2026-02-19 21:35 ` [PATCH v3 1/3] iio: frequency: ad9523: fix implicit variable usage in macros bhargav
2026-02-20 7:21 ` Andy Shevchenko
2026-02-19 21:35 ` [PATCH v3 2/3] iio: frequency: ad9523: avoid multiple line dereferences for pdata bhargav
2026-02-19 21:35 ` [PATCH v3 3/3] iio: frequency: ad9523: fix checkpatch warnings for symbolic permissions bhargav
2026-02-20 7:24 ` Andy Shevchenko
2026-02-20 7:22 ` [PATCH v3 0/3] iio: frequency: ad9523: fix checkpatch warnings Andy Shevchenko
2026-02-22 13:50 ` Jonathan Cameron
2026-02-22 13:58 ` Jonathan Cameron
2026-02-22 21:19 ` Rogue prince
2026-02-23 8:35 ` Andy Shevchenko
2026-02-23 20:35 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260219010244.191668-1-rougueprince47@gmail.com \
--to=rougueprince47@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome