linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcus Folkesson <marcus.folkesson@gmail.com>
To: Marcus Folkesson <marcus.folkesson@gmail.com>,
	Kent Gustavsson <kent@minoris.se>,
	Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Cosmin Tanislav <demonsingur@gmail.com>,
	Arnd Bergmann <arnd@arndb.de>,
	ChiYuan Huang <cy_huang@richtek.com>,
	Haibo Chen <haibo.chen@nxp.com>,
	Ramona Bolboaca <ramona.bolboaca@analog.com>,
	Ibrahim Tilki <Ibrahim.Tilki@analog.com>,
	ChiaEn Wu <chiaen_wu@richtek.com>,
	William Breathitt Gray <william.gray@linaro.org>
Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v6 5/6] iio: adc: mcp3911: avoid ambiguity parameters in macros
Date: Thu, 17 Aug 2023 14:05:17 +0200	[thread overview]
Message-ID: <20230817120518.153728-5-marcus.folkesson@gmail.com> (raw)
In-Reply-To: <20230817120518.153728-1-marcus.folkesson@gmail.com>

Name macro parameters after what they represent instead of 'x'.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---

Notes:
    v5:
        - New patch in this series
    v6:
        - change 'ch' to '(ch)'

 drivers/iio/adc/mcp3911.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/adc/mcp3911.c b/drivers/iio/adc/mcp3911.c
index 06c8c5ac7781..9167f0ffa4e3 100644
--- a/drivers/iio/adc/mcp3911.c
+++ b/drivers/iio/adc/mcp3911.c
@@ -29,8 +29,8 @@
 #define MCP3911_REG_MOD			0x06
 #define MCP3911_REG_PHASE		0x07
 #define MCP3911_REG_GAIN		0x09
-#define MCP3911_GAIN_MASK(ch)		(GENMASK(2, 0) << 3 * ch)
-#define MCP3911_GAIN_VAL(ch, val)      ((val << 3 * ch) & MCP3911_GAIN_MASK(ch))
+#define MCP3911_GAIN_MASK(ch)		(GENMASK(2, 0) << 3 * (ch))
+#define MCP3911_GAIN_VAL(ch, val)      ((val << 3 * (ch)) & MCP3911_GAIN_MASK(ch))
 
 #define MCP3911_REG_STATUSCOM		0x0a
 #define MCP3911_STATUSCOM_DRHIZ		BIT(12)
@@ -51,8 +51,8 @@
 #define MCP3911_REG_GAINCAL_CH1		0x17
 #define MCP3911_REG_VREFCAL		0x1a
 
-#define MCP3911_CHANNEL(x)		(MCP3911_REG_CHANNEL0 + x * 3)
-#define MCP3911_OFFCAL(x)		(MCP3911_REG_OFFCAL_CH0 + x * 6)
+#define MCP3911_CHANNEL(ch)		(MCP3911_REG_CHANNEL0 + (ch) * 3)
+#define MCP3911_OFFCAL(ch)		(MCP3911_REG_OFFCAL_CH0 + (ch) * 6)
 
 /* Internal voltage reference in mV */
 #define MCP3911_INT_VREF_MV		1200
-- 
2.41.0


  parent reply	other threads:[~2023-08-17 12:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-17 12:05 [PATCH v6 1/6] dt-bindings: iio: adc: mcp3911: add support for the whole MCP39xx family Marcus Folkesson
2023-08-17 12:05 ` [PATCH v6 2/6] iio: adc: mcp3911: make use of dev_err_probe() Marcus Folkesson
2023-08-17 12:05 ` [PATCH v6 3/6] iio: adc: mcp3911: simplify usage of spi->dev Marcus Folkesson
2023-08-17 12:48   ` Andy Shevchenko
2023-08-17 12:05 ` [PATCH v6 4/6] iio: adc: mcp3911: fix indentation Marcus Folkesson
2023-08-17 12:48   ` Andy Shevchenko
2023-08-17 12:05 ` Marcus Folkesson [this message]
2023-08-17 12:49   ` [PATCH v6 5/6] iio: adc: mcp3911: avoid ambiguity parameters in macros Andy Shevchenko
2023-08-17 12:05 ` [PATCH v6 6/6] iio: adc: mcp3911: add support for the whole MCP39xx family Marcus Folkesson
2023-08-17 12:58   ` Andy Shevchenko
2023-08-17 12:42 ` [PATCH v6 1/6] dt-bindings: " Andy Shevchenko
2023-08-17 12:42   ` Andy Shevchenko
2023-08-27 18:24   ` 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=20230817120518.153728-5-marcus.folkesson@gmail.com \
    --to=marcus.folkesson@gmail.com \
    --cc=Ibrahim.Tilki@analog.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=chiaen_wu@richtek.com \
    --cc=conor+dt@kernel.org \
    --cc=cy_huang@richtek.com \
    --cc=demonsingur@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=haibo.chen@nxp.com \
    --cc=jic23@kernel.org \
    --cc=kent@minoris.se \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ramona.bolboaca@analog.com \
    --cc=robh+dt@kernel.org \
    --cc=william.gray@linaro.org \
    /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;
as well as URLs for NNTP newsgroup(s).