Re: [PATCH v1] i2c: designware: Change from u32 to unsigned int for regmap_read() calls

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

 



On 1/24/23 13:47, Shyam Sundar S K wrote:
regmap_read() API signature expects the caller to send "unsigned int"
type to return back the read value, but there are some occurrences of 'u32'
across i2c-designware-* files.

Change them to match the regmap_read() signature.

Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@xxxxxxx>
---
  drivers/i2c/busses/i2c-designware-common.c | 11 ++++++-----
  drivers/i2c/busses/i2c-designware-core.h   |  2 +-
  drivers/i2c/busses/i2c-designware-master.c | 13 +++++++------
  drivers/i2c/busses/i2c-designware-slave.c  |  4 ++--
  4 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-common.c b/drivers/i2c/busses/i2c-designware-common.c
index a3240ece55b2..ae808e91b17f 100644
--- a/drivers/i2c/busses/i2c-designware-common.c
+++ b/drivers/i2c/busses/i2c-designware-common.c
@@ -388,7 +388,7 @@ u32 i2c_dw_scl_lcnt(u32 ic_clk, u32 tLOW, u32 tf, int offset)
int i2c_dw_set_sda_hold(struct dw_i2c_dev *dev)
  {
-	u32 reg;
+	unsigned int reg;
  	int ret;
Hmm.. I'm not sure about these. We know registers are 32-bit and change to unsigned int is a step being more ambiguous. I'm wearing my old embedded developer hat who likes to see explicit types when dealing with HW.

Andy: what was your rationale to propose changing u32 to unsigned int in another i2c-designware patch? Has gcc started complaining if regmap_read() is used with u32 type?



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux