RE: [PATCH v2 2/3] i2c: rzv2m: Replace lowercase macros with static inline functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> Sent: Friday, May 26, 2023 2:33 PM
> To: Wolfram Sang <wsa@xxxxxxxxxx>
> Cc: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>; Andy Shevchenko
> <andriy.shevchenko@xxxxxxxxxxxxxxx>; Philipp Zabel
> <p.zabel@xxxxxxxxxxxxxx>; linux-i2c@xxxxxxxxxxxxxxx; Geert Uytterhoeven
> <geert+renesas@xxxxxxxxx>; Prabhakar Mahadev Lad <prabhakar.mahadev-
> lad.rj@xxxxxxxxxxxxxx>; linux-renesas-soc@xxxxxxxxxxxxxxx; Pavel Machek
> <pavel@xxxxxxx>
> Subject: [PATCH v2 2/3] i2c: rzv2m: Replace lowercase macros with static
> inline functions
> 
> Convert macros bit_setl and bit_clrl with static inline functions as
> normally we'd put macro names in all uppercase.
> 
> Reported-by: Pavel Machek <pavel@xxxxxxx>
> Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> ---
> v1->v2:
>  * Updated commit header and description.
>  * Replaced macros bit_setl and bit_clrl with static inline functions.
> ---
>  drivers/i2c/busses/i2c-rzv2m.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-rzv2m.c b/drivers/i2c/busses/i2c-
> rzv2m.c index 56d0faee5c46..8518ae5dfeee 100644
> --- a/drivers/i2c/busses/i2c-rzv2m.c
> +++ b/drivers/i2c/busses/i2c-rzv2m.c
> @@ -50,9 +50,6 @@
>  #define IICB0MDSC	BIT(7)		/* Bus Mode */
>  #define IICB0SLSE	BIT(1)		/* Start condition output */
> 
> -#define bit_setl(addr, val)		writel(readl(addr) | (val), (addr))
> -#define bit_clrl(addr, val)		writel(readl(addr) & ~(val), (addr))
> -
>  struct rzv2m_i2c_priv {
>  	void __iomem *base;
>  	struct i2c_adapter adap;
> @@ -78,6 +75,16 @@ static const struct bitrate_config bitrate_configs[]
> = {
>  	[RZV2M_I2C_400K] = { 52, 900 },
>  };
> 
> +static inline void bit_setl(void __iomem *addr, u32 val) {
> +	writel(readl(addr) | (val), (addr));

Oops, forgot to remove parens.

I will resend the patch.

Cheers,
Biju

> +}
> +
> +static inline void bit_clrl(void __iomem *addr, u32 val) {
> +	writel(readl(addr) & ~(val), (addr));
> +}
> +
>  static irqreturn_t rzv2m_i2c_tia_irq_handler(int this_irq, void
> *dev_id)  {
>  	struct rzv2m_i2c_priv *priv = dev_id;
> --
> 2.25.1





[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux