linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][i3c-next] i3c: fix incorrect update to max_read_ds
@ 2018-11-07 20:42 Colin King
  2018-11-08  9:09 ` Boris Brezillon
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2018-11-07 20:42 UTC (permalink / raw)
  To: Boris Brezillon, linux-i3c; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently max_read_ds is being updated twice, which is incorrect.
The second assignment should be to max_write_ds instead. Fix this.

Detected by CoverityScan, CID#1475379 ("Unused value")

Fixes: 50cacdabeae1 ("i3c: Add core I3C infrastructure")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/i3c/master.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 68d6553dbd75..0ea7bb045fad 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -1093,7 +1093,7 @@ static int i3c_master_getmxds_locked(struct i3c_master_controller *master,
 	}
 
 	info->max_read_ds = getmaxds->maxrd;
-	info->max_read_ds = getmaxds->maxwr;
+	info->max_write_ds = getmaxds->maxwr;
 	if (dest.payload.len == 5)
 		info->max_read_turnaround = getmaxds->maxrdturn[0] |
 					    ((u32)getmaxds->maxrdturn[1] << 8) |
-- 
2.19.1


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

* Re: [PATCH][i3c-next] i3c: fix incorrect update to max_read_ds
  2018-11-07 20:42 [PATCH][i3c-next] i3c: fix incorrect update to max_read_ds Colin King
@ 2018-11-08  9:09 ` Boris Brezillon
  2018-11-08  9:10   ` Colin Ian King
  0 siblings, 1 reply; 3+ messages in thread
From: Boris Brezillon @ 2018-11-08  9:09 UTC (permalink / raw)
  To: Colin King; +Cc: kernel-janitors, linux-kernel

On Wed,  7 Nov 2018 20:42:08 +0000
Hi Colin,

Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently max_read_ds is being updated twice, which is incorrect.
> The second assignment should be to max_write_ds instead. Fix this.
> 
> Detected by CoverityScan, CID#1475379 ("Unused value")
> 
> Fixes: 50cacdabeae1 ("i3c: Add core I3C infrastructure")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/i3c/master.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> index 68d6553dbd75..0ea7bb045fad 100644
> --- a/drivers/i3c/master.c
> +++ b/drivers/i3c/master.c
> @@ -1093,7 +1093,7 @@ static int i3c_master_getmxds_locked(struct i3c_master_controller *master,
>  	}
>  
>  	info->max_read_ds = getmaxds->maxrd;
> -	info->max_read_ds = getmaxds->maxwr;
> +	info->max_write_ds = getmaxds->maxwr;

Thanks for the fix.

Since the I3C driver is not merged yet, would you mind if I squash your
changes in the commit introducing the bug?

Regards,

Boris

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

* Re: [PATCH][i3c-next] i3c: fix incorrect update to max_read_ds
  2018-11-08  9:09 ` Boris Brezillon
@ 2018-11-08  9:10   ` Colin Ian King
  0 siblings, 0 replies; 3+ messages in thread
From: Colin Ian King @ 2018-11-08  9:10 UTC (permalink / raw)
  To: Boris Brezillon; +Cc: kernel-janitors, linux-kernel

On 08/11/2018 09:09, Boris Brezillon wrote:
> On Wed,  7 Nov 2018 20:42:08 +0000
> Hi Colin,
> 
> Colin King <colin.king@canonical.com> wrote:
> 
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Currently max_read_ds is being updated twice, which is incorrect.
>> The second assignment should be to max_write_ds instead. Fix this.
>>
>> Detected by CoverityScan, CID#1475379 ("Unused value")
>>
>> Fixes: 50cacdabeae1 ("i3c: Add core I3C infrastructure")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>  drivers/i3c/master.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
>> index 68d6553dbd75..0ea7bb045fad 100644
>> --- a/drivers/i3c/master.c
>> +++ b/drivers/i3c/master.c
>> @@ -1093,7 +1093,7 @@ static int i3c_master_getmxds_locked(struct i3c_master_controller *master,
>>  	}
>>  
>>  	info->max_read_ds = getmaxds->maxrd;
>> -	info->max_read_ds = getmaxds->maxwr;
>> +	info->max_write_ds = getmaxds->maxwr;
> 
> Thanks for the fix.
> 
> Since the I3C driver is not merged yet, would you mind if I squash your
> changes in the commit introducing the bug?

Sure, that's fine with me.

Colin
> 
> Regards,
> 
> Boris
> 


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

end of thread, other threads:[~2018-11-08  9:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-07 20:42 [PATCH][i3c-next] i3c: fix incorrect update to max_read_ds Colin King
2018-11-08  9:09 ` Boris Brezillon
2018-11-08  9:10   ` Colin Ian King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).