diff mbox series

[v5,5/6] iio: adc: mcp3911: avoid ambiguity parameters in macros

Message ID 20230814121010.184842-5-marcus.folkesson@gmail.com (mailing list archive)
State Superseded
Headers show
Series [v5,1/6] dt-bindings: iio: adc: mcp3911: add support for the whole MCP39xx family | expand

Commit Message

Marcus Folkesson Aug. 14, 2023, 12:10 p.m. UTC
Name macro parameters after what they represent instead of 'x'.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---

Notes:
    v5:
        - New patch in this series

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

Comments

Andy Shevchenko Aug. 15, 2023, 2:56 p.m. UTC | #1
On Mon, Aug 14, 2023 at 02:10:09PM +0200, Marcus Folkesson wrote:
> Name macro parameters after what they represent instead of 'x'.

Yes, but it's not my suggestion, what I was talking about is how macro
parameters being treated.

This change doesn't make the problem go away.

Per se, this one is good for its purposes.

> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

This shouldn't be here.
Marcus Folkesson Aug. 15, 2023, 4:49 p.m. UTC | #2
On Tue, Aug 15, 2023 at 05:56:37PM +0300, Andy Shevchenko wrote:
> On Mon, Aug 14, 2023 at 02:10:09PM +0200, Marcus Folkesson wrote:
> > Name macro parameters after what they represent instead of 'x'.
> 
> Yes, but it's not my suggestion, what I was talking about is how macro
> parameters being treated.

Sorry, I clearly missunderstood what you was aiming for.
I will change to (ch) in this patch and keep it consistent in the
following.


Best regards,
Marcus Folkesson
Andy Shevchenko Aug. 15, 2023, 4:54 p.m. UTC | #3
On Tue, Aug 15, 2023 at 06:49:11PM +0200, Marcus Folkesson wrote:
> On Tue, Aug 15, 2023 at 05:56:37PM +0300, Andy Shevchenko wrote:
> > On Mon, Aug 14, 2023 at 02:10:09PM +0200, Marcus Folkesson wrote:
> > > Name macro parameters after what they represent instead of 'x'.
> > 
> > Yes, but it's not my suggestion, what I was talking about is how macro
> > parameters being treated.
> 
> Sorry, I clearly missunderstood what you was aiming for.
> I will change to (ch) in this patch and keep it consistent in the
> following.

Yep. and drop tag with my name in it.
Thank you!
diff mbox series

Patch

diff --git a/drivers/iio/adc/mcp3911.c b/drivers/iio/adc/mcp3911.c
index 1648eaa878eb..f1e02aa14e93 100644
--- a/drivers/iio/adc/mcp3911.c
+++ b/drivers/iio/adc/mcp3911.c
@@ -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