[PATCH 1/1] dsa: b53: remove redundant if

Subsystems: broadcom b53/sf2 ethernet switch driver, networking drivers, networking [dsa], the rest

STALE3657d

4 messages, 3 authors, 2016-08-01 · open the first message on its own page

[PATCH 1/1] dsa: b53: remove redundant if

From: Heinrich Schuchardt <hidden>
Date: 2016-07-31 07:43:13

For pdata == null the code leaves with an error.
There is need to check the condition again.

Signed-off-by: Heinrich Schuchardt <redacted>
---
 drivers/net/dsa/b53/b53_mmap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/dsa/b53/b53_mmap.c b/drivers/net/dsa/b53/b53_mmap.c
index 21f1068..77ffc43 100644
--- a/drivers/net/dsa/b53/b53_mmap.c
+++ b/drivers/net/dsa/b53/b53_mmap.c
@@ -233,8 +233,7 @@ static int b53_mmap_probe(struct platform_device *pdev)
 	if (!dev)
 		return -ENOMEM;
 
-	if (pdata)
-		dev->pdata = pdata;
+	dev->pdata = pdata;
 
 	platform_set_drvdata(pdev, dev);
 
-- 
2.8.1

Re: [PATCH 1/1] dsa: b53: remove redundant if

From: Sergei Shtylyov <hidden>
Date: 2016-07-31 10:03:30

Hello.

On 7/31/2016 10:42 AM, Heinrich Schuchardt wrote:
For pdata == null the code leaves with an error.
There is need to check the condition again.
    No need, you mean?
Signed-off-by: Heinrich Schuchardt <redacted>
[...]

MBR, Sergei

[PATCH 1/1 v2] dsa: b53: remove redundant if

From: Heinrich Schuchardt <hidden>
Date: 2016-07-31 11:42:54

For pdata == null the code leaves with an error.
There is no need to check the condition again.

Signed-off-by: Heinrich Schuchardt <redacted>
---
 drivers/net/dsa/b53/b53_mmap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/dsa/b53/b53_mmap.c b/drivers/net/dsa/b53/b53_mmap.c
index 21f1068..77ffc43 100644
--- a/drivers/net/dsa/b53/b53_mmap.c
+++ b/drivers/net/dsa/b53/b53_mmap.c
@@ -233,8 +233,7 @@ static int b53_mmap_probe(struct platform_device *pdev)
 	if (!dev)
 		return -ENOMEM;
 
-	if (pdata)
-		dev->pdata = pdata;
+	dev->pdata = pdata;
 
 	platform_set_drvdata(pdev, dev);
 
-- 
2.8.1

Re: [PATCH 1/1 v2] dsa: b53: remove redundant if

From: David Miller <davem@davemloft.net>
Date: 2016-08-01 20:47:00

From: Heinrich Schuchardt <redacted>
Date: Sun, 31 Jul 2016 13:42:33 +0200
For pdata == null the code leaves with an error.
There is no need to check the condition again.

Signed-off-by: Heinrich Schuchardt <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help