Skip to contentSkip to conversation

mfd: remove unnecessary check

PATCH Applied Maninder Singh 3 participants 6 messages Jun 30, 2015 – Jul 2, 2015 Multifunction devices (MFD)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: remove unnecessary check

o Making pdata NULL check to (!pdata) as coding statndard and all other checks in file.
o Removing redundant check of pdata, because we already check for pdata, and also derefernced before this check

---
 drivers/mfd/t7l66xb.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/t7l66xb.c +2 -2
index c09fb5d..854b05f 100644
@@ -318,7 +318,7 @@ static int t7l66xb_probe(struct platform_device *dev)
 	struct resource *iomem, *rscr;
 	int ret;
 
-	if (pdata == NULL)
+	if (!pdata)
 		return -EINVAL;
 
 	iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
@@ -371,7 +371,7 @@ static int t7l66xb_probe(struct platform_device *dev)
 
 	clk_prepare_enable(t7l66xb->clk48m);
 
-	if (pdata && pdata->enable)
+	if (pdata->enable)
 		pdata->enable(dev);
 
 	/* Mask all interrupts */
Signature · 1 line
1.7.9.5
Applied
#1 lore raw
Quoted 10 lines · Maninder Singh

o Making pdata NULL check to (!pdata) as coding statndard and all other checks in file.
o Removing redundant check of pdata, because we already check for pdata, and also derefernced before this check

---
 drivers/mfd/t7l66xb.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied, with a properly formatted subject line.

Quoted 22 lines
drivers/mfd/t7l66xb.c +2 -2
index c09fb5d..854b05f 100644
@@ -318,7 +318,7 @@ static int t7l66xb_probe(struct platform_device *dev)
 	struct resource *iomem, *rscr;
 	int ret;
 
-	if (pdata == NULL)
+	if (!pdata)
 		return -EINVAL;
 
 	iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
@@ -371,7 +371,7 @@ static int t7l66xb_probe(struct platform_device *dev)
 
 	clk_prepare_enable(t7l66xb->clk48m);
 
-	if (pdata && pdata->enable)
+	if (pdata->enable)
 		pdata->enable(dev);
 
 	/* Mask all interrupts */
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#2 lore raw
Quoted 7 lines · Lee Jones
Quoted 5 lines · Maninder Singh

o Making pdata NULL check to (!pdata) as coding statndard and all other checks in file.
o Removing redundant check of pdata, because we already check for pdata, and also derefernced before this check

Quoted 7 lines
Quoted 5 lines
---
 drivers/mfd/t7l66xb.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied, with a properly formatted subject line.

Should have probably been more forthcomming with some advice.

Next time, please use git log --oneline -- <subsystem> to see what the accepted format is.

Quoted 23 lines
Quoted 22 lines
drivers/mfd/t7l66xb.c +2 -2
index c09fb5d..854b05f 100644
@@ -318,7 +318,7 @@ static int t7l66xb_probe(struct platform_device *dev)
 	struct resource *iomem, *rscr;
 	int ret;
 
-	if (pdata == NULL)
+	if (!pdata)
 		return -EINVAL;
 
 	iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
@@ -371,7 +371,7 @@ static int t7l66xb_probe(struct platform_device *dev)
 
 	clk_prepare_enable(t7l66xb->clk48m);
 
-	if (pdata && pdata->enable)
+	if (pdata->enable)
 		pdata->enable(dev);
 
 	/* Mask all interrupts */
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#3 lore raw

2015-07-01 16:40 GMT+09:00 Lee Jones <[email protected]>:

Quoted 14 lines · Lee Jones
Quoted 13 lines · Maninder Singh
Quoted 11 lines

o Making pdata NULL check to (!pdata) as coding statndard and all other checks in file.
o Removing redundant check of pdata, because we already check for pdata, and also derefernced before this check

---
 drivers/mfd/t7l66xb.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 6 lines
Quoted 1 line

Applied, with a properly formatted subject line.

Should have probably been more forthcomming with some advice.

Next time, please use git log --oneline -- <subsystem> to see what the accepted format is.

... and a spell-check could be useful as well :). The reviewed-by tag was not sent on LKML and the person (Vaneet Narang) was not even CC-ed so I think it should be dropped.

Best regards,
Krzysztof

#4 lore raw
Quoted 17 lines · Krzysztof Kozlowski

2015-07-01 16:40 GMT+09:00 Lee Jones <[email protected]>:

Quoted 16 lines · Lee Jones
Quoted 14 lines · Maninder Singh
Quoted 11 lines

o Making pdata NULL check to (!pdata) as coding statndard and all other checks in file.
o Removing redundant check of pdata, because we already check for pdata, and also derefernced before this check

---
 drivers/mfd/t7l66xb.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied, with a properly formatted subject line.

Quoted 8 lines
Quoted 4 lines

Should have probably been more forthcomming with some advice.

Next time, please use git log --oneline -- <subsystem> to see what the accepted format is.

... and a spell-check could be useful as well :). The reviewed-by tag was not sent on LKML and the person (Vaneet Narang) was not even CC-ed so I think it should be dropped.

Fair points. Patch dropped.

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#5 lore raw

2015-07-01 23:08 GMT+09:00 Lee Jones <[email protected]>:

Quoted 21 lines · Krzysztof Kozlowski
Quoted 20 lines

2015-07-01 16:40 GMT+09:00 Lee Jones <[email protected]>:

Quoted 18 lines · Lee Jones
Quoted 7 lines · Maninder Singh
Quoted 6 lines

o Making pdata NULL check to (!pdata) as coding statndard and all other checks in file.
o Removing redundant check of pdata, because we already check for pdata, and also derefernced before this check

Quoted 7 lines
Quoted 5 lines
---
 drivers/mfd/t7l66xb.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied, with a properly formatted subject line.

Should have probably been more forthcomming with some advice.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Next time, please use git log --oneline -- <subsystem> to see what the accepted format is.

... and a spell-check could be useful as well :). The reviewed-by tag was not sent on LKML and the person (Vaneet Narang) was not even CC-ed so I think it should be dropped.

Fair points. Patch dropped.

I meant the reviewed-by tag should be dropped :) .

So now... Maninder Singh, could you resent the patch with this minor issues fixed?

Best regards,
Krzysztof