public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] mfd: asic3: Delete redundant variable definition
@ 2020-04-03  8:11 Markus Elfring
  2020-04-03  9:25 ` Lee Jones
  0 siblings, 1 reply; 7+ messages in thread
From: Markus Elfring @ 2020-04-03  8:11 UTC (permalink / raw)
  To: Tang Bin, Lee Jones; +Cc: linux-kernel, kernel-janitors

> In this function, 'ret' is always assigned, even if 'pdata->leds'
> don't carry out,

I notice possibilities again to improve such a commit message.


> it has already been assigned a value in the above code, including '0',

The variable assignment will eventually be performed only in if branches.


> so it's redundant.

I suggest to reconsider this interpretation of the source code here.
Would you like to move the mentioned statement into an else branch
at the end?

Regards,
Markus

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH] mfd:asic3:Delete redundant variable definition
@ 2020-04-03  4:20 Tang Bin
  2020-04-16  7:08 ` Lee Jones
  0 siblings, 1 reply; 7+ messages in thread
From: Tang Bin @ 2020-04-03  4:20 UTC (permalink / raw)
  To: lee.jones; +Cc: linux-kernel, Tang Bin

In this function, 'ret' is always assigned, even if 'pdata->leds'
don't carry out,it has already been assigned a value in the above
code, including '0',so it's redundant.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
---
 drivers/mfd/asic3.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index a6bd2134c..cee7454b3 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -924,7 +924,6 @@ static int __init asic3_mfd_probe(struct platform_device *pdev,
 			goto out;
 	}
 
-	ret = 0;
 	if (pdata->leds) {
 		int i;
 
-- 
2.20.1.windows.1




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

end of thread, other threads:[~2020-04-17  9:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-03  8:11 [PATCH] mfd: asic3: Delete redundant variable definition Markus Elfring
2020-04-03  9:25 ` Lee Jones
2020-04-03 10:12   ` Markus Elfring
  -- strict thread matches above, loose matches on Subject: below --
2020-04-03  4:20 [PATCH] mfd:asic3:Delete " Tang Bin
2020-04-16  7:08 ` Lee Jones
2020-04-16  9:57   ` Tang Bin
2020-04-17  9:27     ` Lee Jones

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