linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] dsa: b53: remove redundant if
@ 2016-07-31  7:42 Heinrich Schuchardt
  2016-07-31 10:03 ` Sergei Shtylyov
  0 siblings, 1 reply; 4+ messages in thread
From: Heinrich Schuchardt @ 2016-07-31  7:42 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: netdev, linux-kernel, Heinrich Schuchardt

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

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 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

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

* Re: [PATCH 1/1] dsa: b53: remove redundant if
  2016-07-31  7:42 [PATCH 1/1] dsa: b53: remove redundant if Heinrich Schuchardt
@ 2016-07-31 10:03 ` Sergei Shtylyov
  2016-07-31 11:42   ` [PATCH 1/1 v2] " Heinrich Schuchardt
  0 siblings, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2016-07-31 10:03 UTC (permalink / raw)
  To: Heinrich Schuchardt, Florian Fainelli; +Cc: netdev, linux-kernel

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 <xypron.glpk@gmx.de>
[...]

MBR, Sergei

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

* [PATCH 1/1 v2] dsa: b53: remove redundant if
  2016-07-31 10:03 ` Sergei Shtylyov
@ 2016-07-31 11:42   ` Heinrich Schuchardt
  2016-08-01 20:45     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Heinrich Schuchardt @ 2016-07-31 11:42 UTC (permalink / raw)
  To: Sergei Shtylyov, Florian Fainelli
  Cc: netdev, linux-kernel, Heinrich Schuchardt

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

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 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

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

* Re: [PATCH 1/1 v2] dsa: b53: remove redundant if
  2016-07-31 11:42   ` [PATCH 1/1 v2] " Heinrich Schuchardt
@ 2016-08-01 20:45     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2016-08-01 20:45 UTC (permalink / raw)
  To: xypron.glpk; +Cc: sergei.shtylyov, f.fainelli, netdev, linux-kernel

From: Heinrich Schuchardt <xypron.glpk@gmx.de>
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 <xypron.glpk@gmx.de>

Applied.

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

end of thread, other threads:[~2016-08-01 20:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-31  7:42 [PATCH 1/1] dsa: b53: remove redundant if Heinrich Schuchardt
2016-07-31 10:03 ` Sergei Shtylyov
2016-07-31 11:42   ` [PATCH 1/1 v2] " Heinrich Schuchardt
2016-08-01 20:45     ` David Miller

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