public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Jan Dabros <jsd@semihalf.com>
Cc: linux-i2c@vger.kernel.org
Subject: Re: [PATCH v1] i2c: designware: Change from u32 to unsigned int for regmap_read() calls
Date: Tue, 24 Jan 2023 14:54:52 +0200	[thread overview]
Message-ID: <e32d5647-530c-80d0-e7e5-a92e5f5a82dd@linux.intel.com> (raw)
In-Reply-To: <20230124114732.1387997-1-Shyam-sundar.S-k@amd.com>

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@amd.com>
> ---
>   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?

  reply	other threads:[~2023-01-24 12:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-24 11:47 [PATCH v1] i2c: designware: Change from u32 to unsigned int for regmap_read() calls Shyam Sundar S K
2023-01-24 12:54 ` Jarkko Nikula [this message]
2023-01-24 13:02   ` Andy Shevchenko
2023-01-26 13:44     ` Jarkko Nikula
2023-01-24 12:58 ` Andy Shevchenko
2023-01-28 18:47 ` Wolfram Sang

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=e32d5647-530c-80d0-e7e5-a92e5f5a82dd@linux.intel.com \
    --to=jarkko.nikula@linux.intel.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=jsd@semihalf.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    /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