linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: jz4780: remove redundant assignment to variable i
@ 2020-06-10 12:59 Colin King
  2020-07-04  6:32 ` Wolfram Sang
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2020-06-10 12:59 UTC (permalink / raw)
  To: Paul Cercueil, linux-i2c; +Cc: kernel-janitors, linux-kernel

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

The variable i is being initialized with a value that is
never read and it is being updated later with a new value. The
initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/i2c/busses/i2c-jz4780.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-jz4780.c b/drivers/i2c/busses/i2c-jz4780.c
index ba831df6661e..fcdabfa3b5ee 100644
--- a/drivers/i2c/busses/i2c-jz4780.c
+++ b/drivers/i2c/busses/i2c-jz4780.c
@@ -691,7 +691,7 @@ static inline int jz4780_i2c_xfer_write(struct jz4780_i2c *i2c,
 static int jz4780_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msg,
 			   int count)
 {
-	int i = -EIO;
+	int i;
 	int ret = 0;
 	struct jz4780_i2c *i2c = adap->algo_data;
 
-- 
2.27.0.rc0


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

* Re: [PATCH] i2c: jz4780: remove redundant assignment to variable i
  2020-06-10 12:59 [PATCH] i2c: jz4780: remove redundant assignment to variable i Colin King
@ 2020-07-04  6:32 ` Wolfram Sang
  2020-07-06 23:52   ` Paul Cercueil
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfram Sang @ 2020-07-04  6:32 UTC (permalink / raw)
  To: Colin King; +Cc: Paul Cercueil, linux-i2c, kernel-janitors, linux-kernel

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

On Wed, Jun 10, 2020 at 01:59:01PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable i is being initialized with a value that is
> never read and it is being updated later with a new value. The
> initialization is redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

What about 'ret'? Doesn't the same reasoning apply for it?


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

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

* Re: [PATCH] i2c: jz4780: remove redundant assignment to variable i
  2020-07-04  6:32 ` Wolfram Sang
@ 2020-07-06 23:52   ` Paul Cercueil
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Cercueil @ 2020-07-06 23:52 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Colin King, linux-i2c, kernel-janitors, linux-kernel

Hi,

Le sam. 4 juil. 2020 à 8:32, Wolfram Sang <wsa@kernel.org> a écrit :
> On Wed, Jun 10, 2020 at 01:59:01PM +0100, Colin King wrote:
>>  From: Colin Ian King <colin.king@canonical.com>
>> 
>>  The variable i is being initialized with a value that is
>>  never read and it is being updated later with a new value. The
>>  initialization is redundant and can be removed.
>> 
>>  Addresses-Coverity: ("Unused value")
>>  Signed-off-by: Colin Ian King <colin.king@canonical.com>
> 
> What about 'ret'? Doesn't the same reasoning apply for it?
> 

That's correct.

Colin, could you respin the patch and do the same for the 'ret' 
variable?

Thanks,
-Paul



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

end of thread, other threads:[~2020-07-06 23:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-10 12:59 [PATCH] i2c: jz4780: remove redundant assignment to variable i Colin King
2020-07-04  6:32 ` Wolfram Sang
2020-07-06 23:52   ` Paul Cercueil

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).