Skip to content

Commit

Permalink
i2c: riic: Use GENMASK() macro for bitmask definitions
Browse files Browse the repository at this point in the history
Replace raw bitmask values with the `GENMASK()` macro in the `i2c-riic`
driver to improve readability and maintain consistency.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
  • Loading branch information
Lad Prabhakar authored and Wolfram Sang committed Jan 14, 2025
1 parent 0094d6b commit 7225216
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/i2c/busses/i2c-riic.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#define ICCR2_RS BIT(2)
#define ICCR2_ST BIT(1)

#define ICMR1_CKS_MASK 0x70
#define ICMR1_CKS_MASK GENMASK(6, 4)
#define ICMR1_BCWP BIT(3)
#define ICMR1_CKS(_x) ((((_x) << 4) & ICMR1_CKS_MASK) | ICMR1_BCWP)

Expand All @@ -74,7 +74,7 @@

#define ICSR2_NACKF BIT(4)

#define ICBR_RESERVED 0xe0 /* Should be 1 on writes */
#define ICBR_RESERVED GENMASK(7, 5) /* Should be 1 on writes */

#define RIIC_INIT_MSG -1

Expand Down

0 comments on commit 7225216

Please sign in to comment.