public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] i2c: xiic: Correct the datatype for rx_watermark
@ 2022-05-17  5:34 Shubhrajyoti Datta
  2022-05-17 12:03 ` Michal Simek
  2022-05-21  6:18 ` Wolfram Sang
  0 siblings, 2 replies; 3+ messages in thread
From: Shubhrajyoti Datta @ 2022-05-17  5:34 UTC (permalink / raw)
  To: linux-i2c; +Cc: michal.simek, git, Shubhrajyoti Datta

The message length data type should be u16 as per the i2c_msg structure.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
---
v2:
Typecast xiic_setreg

 drivers/i2c/busses/i2c-xiic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index aa6e37a9f275..9a1c3f8b7048 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -578,7 +578,7 @@ static int xiic_busy(struct xiic_i2c *i2c)
 
 static void xiic_start_recv(struct xiic_i2c *i2c)
 {
-	u8 rx_watermark;
+	u16 rx_watermark;
 	struct i2c_msg *msg = i2c->rx_msg = i2c->tx_msg;
 
 	/* Clear and enable Rx full interrupt. */
@@ -593,7 +593,7 @@ static void xiic_start_recv(struct xiic_i2c *i2c)
 	rx_watermark = msg->len;
 	if (rx_watermark > IIC_RX_FIFO_DEPTH)
 		rx_watermark = IIC_RX_FIFO_DEPTH;
-	xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, rx_watermark - 1);
+	xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, (u8)(rx_watermark - 1));
 
 	if (!(msg->flags & I2C_M_NOSTART))
 		/* write the address */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] i2c: xiic: Correct the datatype for rx_watermark
  2022-05-17  5:34 [PATCH v2] i2c: xiic: Correct the datatype for rx_watermark Shubhrajyoti Datta
@ 2022-05-17 12:03 ` Michal Simek
  2022-05-21  6:18 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Simek @ 2022-05-17 12:03 UTC (permalink / raw)
  To: Shubhrajyoti Datta, linux-i2c; +Cc: michal.simek, git



On 5/17/22 07:34, Shubhrajyoti Datta wrote:
> The message length data type should be u16 as per the i2c_msg structure.
> 
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
> ---
> v2:
> Typecast xiic_setreg
> 
>   drivers/i2c/busses/i2c-xiic.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
> index aa6e37a9f275..9a1c3f8b7048 100644
> --- a/drivers/i2c/busses/i2c-xiic.c
> +++ b/drivers/i2c/busses/i2c-xiic.c
> @@ -578,7 +578,7 @@ static int xiic_busy(struct xiic_i2c *i2c)
>   
>   static void xiic_start_recv(struct xiic_i2c *i2c)
>   {
> -	u8 rx_watermark;
> +	u16 rx_watermark;
>   	struct i2c_msg *msg = i2c->rx_msg = i2c->tx_msg;
>   
>   	/* Clear and enable Rx full interrupt. */
> @@ -593,7 +593,7 @@ static void xiic_start_recv(struct xiic_i2c *i2c)
>   	rx_watermark = msg->len;
>   	if (rx_watermark > IIC_RX_FIFO_DEPTH)
>   		rx_watermark = IIC_RX_FIFO_DEPTH;
> -	xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, rx_watermark - 1);
> +	xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, (u8)(rx_watermark - 1));
>   
>   	if (!(msg->flags & I2C_M_NOSTART))
>   		/* write the address */

Acked-by: Michal Simek <michal.simek@amd.com>

Thanks,
Michal

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] i2c: xiic: Correct the datatype for rx_watermark
  2022-05-17  5:34 [PATCH v2] i2c: xiic: Correct the datatype for rx_watermark Shubhrajyoti Datta
  2022-05-17 12:03 ` Michal Simek
@ 2022-05-21  6:18 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2022-05-21  6:18 UTC (permalink / raw)
  To: Shubhrajyoti Datta; +Cc: linux-i2c, michal.simek, git

[-- Attachment #1: Type: text/plain, Size: 252 bytes --]

On Tue, May 17, 2022 at 11:04:52AM +0530, Shubhrajyoti Datta wrote:
> The message length data type should be u16 as per the i2c_msg structure.
> 
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-21  6:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-17  5:34 [PATCH v2] i2c: xiic: Correct the datatype for rx_watermark Shubhrajyoti Datta
2022-05-17 12:03 ` Michal Simek
2022-05-21  6:18 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox