All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: include "int ret" with macro
@ 2014-06-25  1:54 ` Zhao Qiang
  0 siblings, 0 replies; 6+ messages in thread
From: Zhao Qiang @ 2014-06-25  1:54 UTC (permalink / raw)
  To: linuxppc-dev, broonie, linux-spi, B07421; +Cc: Zhao Qiang

ret is unused when CONFIG_FSL_SOC defined,
so include it with "#ifndef CONFIG_FSL_SOC".

Signed-off-by: Zhao Qiang <B45475@freescale.com>
---
 drivers/spi/spi-fsl-lib.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-fsl-lib.c b/drivers/spi/spi-fsl-lib.c
index e5d45fc..44aace1 100644
--- a/drivers/spi/spi-fsl-lib.c
+++ b/drivers/spi/spi-fsl-lib.c
@@ -198,8 +198,9 @@ int of_mpc8xxx_spi_probe(struct platform_device *ofdev)
 	struct mpc8xxx_spi_probe_info *pinfo;
 	struct fsl_spi_platform_data *pdata;
 	const void *prop;
+#ifndef CONFIG_FSL_SOC
 	int ret = -ENOMEM;
-
+#endif
 	pinfo = devm_kzalloc(&ofdev->dev, sizeof(*pinfo), GFP_KERNEL);
 	if (!pinfo)
 		return -ENOMEM;
-- 
1.8.5

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

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

* [PATCH] spi: include "int ret" with macro
@ 2014-06-25  1:54 ` Zhao Qiang
  0 siblings, 0 replies; 6+ messages in thread
From: Zhao Qiang @ 2014-06-25  1:54 UTC (permalink / raw)
  To: linuxppc-dev, broonie, linux-spi, B07421; +Cc: Zhao Qiang

ret is unused when CONFIG_FSL_SOC defined,
so include it with "#ifndef CONFIG_FSL_SOC".

Signed-off-by: Zhao Qiang <B45475@freescale.com>
---
 drivers/spi/spi-fsl-lib.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-fsl-lib.c b/drivers/spi/spi-fsl-lib.c
index e5d45fc..44aace1 100644
--- a/drivers/spi/spi-fsl-lib.c
+++ b/drivers/spi/spi-fsl-lib.c
@@ -198,8 +198,9 @@ int of_mpc8xxx_spi_probe(struct platform_device *ofdev)
 	struct mpc8xxx_spi_probe_info *pinfo;
 	struct fsl_spi_platform_data *pdata;
 	const void *prop;
+#ifndef CONFIG_FSL_SOC
 	int ret = -ENOMEM;
-
+#endif
 	pinfo = devm_kzalloc(&ofdev->dev, sizeof(*pinfo), GFP_KERNEL);
 	if (!pinfo)
 		return -ENOMEM;
-- 
1.8.5

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

* RE: [PATCH] spi: include "int ret" with macro
  2014-06-25  1:54 ` Zhao Qiang
@ 2014-06-25  8:44     ` David Laight
  -1 siblings, 0 replies; 6+ messages in thread
From: David Laight @ 2014-06-25  8:44 UTC (permalink / raw)
  To: 'Zhao Qiang',
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	broonie-DgEjT+Ai2ygdnm+yROfE0A, linux-spi-u79uwXL29TY76Z2rM5mHXA,
	B07421-KZfg59tc24xl57MIdRCFDg

From: Zhao Qiang
> ret is unused when CONFIG_FSL_SOC defined,
> so include it with "#ifndef CONFIG_FSL_SOC".
> 
> Signed-off-by: Zhao Qiang <B45475@freescale.com>
> ---
>  drivers/spi/spi-fsl-lib.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/spi-fsl-lib.c b/drivers/spi/spi-fsl-lib.c
> index e5d45fc..44aace1 100644
> --- a/drivers/spi/spi-fsl-lib.c
> +++ b/drivers/spi/spi-fsl-lib.c
> @@ -198,8 +198,9 @@ int of_mpc8xxx_spi_probe(struct platform_device *ofdev)
>  	struct mpc8xxx_spi_probe_info *pinfo;
>  	struct fsl_spi_platform_data *pdata;
>  	const void *prop;
> +#ifndef CONFIG_FSL_SOC
>  	int ret = -ENOMEM;
> -
> +#endif

You are removing the blank line after the definition of the locals,
and the initialiser isn't needed.

>  	pinfo = devm_kzalloc(&ofdev->dev, sizeof(*pinfo), GFP_KERNEL);
>  	if (!pinfo)
>  		return -ENOMEM;
> --

I think it might be preferable to define 'ret' inside the conditional
where it is used - which requires an extra {...} block.

A 'sneaky' way to avoid the warning is to 'return ret' when the kzalloc() fails.

	David



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

* RE: [PATCH] spi: include "int ret" with macro
@ 2014-06-25  8:44     ` David Laight
  0 siblings, 0 replies; 6+ messages in thread
From: David Laight @ 2014-06-25  8:44 UTC (permalink / raw)
  To: 'Zhao Qiang', linuxppc-dev, broonie, linux-spi, B07421

RnJvbTogWmhhbyBRaWFuZw0KPiByZXQgaXMgdW51c2VkIHdoZW4gQ09ORklHX0ZTTF9TT0MgZGVm
aW5lZCwNCj4gc28gaW5jbHVkZSBpdCB3aXRoICIjaWZuZGVmIENPTkZJR19GU0xfU09DIi4NCj4g
DQo+IFNpZ25lZC1vZmYtYnk6IFpoYW8gUWlhbmcgPEI0NTQ3NUBmcmVlc2NhbGUuY29tPg0KPiAt
LS0NCj4gIGRyaXZlcnMvc3BpL3NwaS1mc2wtbGliLmMgfCAzICsrLQ0KPiAgMSBmaWxlIGNoYW5n
ZWQsIDIgaW5zZXJ0aW9ucygrKSwgMSBkZWxldGlvbigtKQ0KPiANCj4gZGlmZiAtLWdpdCBhL2Ry
aXZlcnMvc3BpL3NwaS1mc2wtbGliLmMgYi9kcml2ZXJzL3NwaS9zcGktZnNsLWxpYi5jDQo+IGlu
ZGV4IGU1ZDQ1ZmMuLjQ0YWFjZTEgMTAwNjQ0DQo+IC0tLSBhL2RyaXZlcnMvc3BpL3NwaS1mc2wt
bGliLmMNCj4gKysrIGIvZHJpdmVycy9zcGkvc3BpLWZzbC1saWIuYw0KPiBAQCAtMTk4LDggKzE5
OCw5IEBAIGludCBvZl9tcGM4eHh4X3NwaV9wcm9iZShzdHJ1Y3QgcGxhdGZvcm1fZGV2aWNlICpv
ZmRldikNCj4gIAlzdHJ1Y3QgbXBjOHh4eF9zcGlfcHJvYmVfaW5mbyAqcGluZm87DQo+ICAJc3Ry
dWN0IGZzbF9zcGlfcGxhdGZvcm1fZGF0YSAqcGRhdGE7DQo+ICAJY29uc3Qgdm9pZCAqcHJvcDsN
Cj4gKyNpZm5kZWYgQ09ORklHX0ZTTF9TT0MNCj4gIAlpbnQgcmV0ID0gLUVOT01FTTsNCj4gLQ0K
PiArI2VuZGlmDQoNCllvdSBhcmUgcmVtb3ZpbmcgdGhlIGJsYW5rIGxpbmUgYWZ0ZXIgdGhlIGRl
ZmluaXRpb24gb2YgdGhlIGxvY2FscywNCmFuZCB0aGUgaW5pdGlhbGlzZXIgaXNuJ3QgbmVlZGVk
Lg0KDQo+ICAJcGluZm8gPSBkZXZtX2t6YWxsb2MoJm9mZGV2LT5kZXYsIHNpemVvZigqcGluZm8p
LCBHRlBfS0VSTkVMKTsNCj4gIAlpZiAoIXBpbmZvKQ0KPiAgCQlyZXR1cm4gLUVOT01FTTsNCj4g
LS0NCg0KSSB0aGluayBpdCBtaWdodCBiZSBwcmVmZXJhYmxlIHRvIGRlZmluZSAncmV0JyBpbnNp
ZGUgdGhlIGNvbmRpdGlvbmFsDQp3aGVyZSBpdCBpcyB1c2VkIC0gd2hpY2ggcmVxdWlyZXMgYW4g
ZXh0cmEgey4uLn0gYmxvY2suDQoNCkEgJ3NuZWFreScgd2F5IHRvIGF2b2lkIHRoZSB3YXJuaW5n
IGlzIHRvICdyZXR1cm4gcmV0JyB3aGVuIHRoZSBremFsbG9jKCkgZmFpbHMuDQoNCglEYXZpZA0K
DQoNCg==

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

* Re: [PATCH] spi: include "int ret" with macro
  2014-06-24  7:55 Zhao Qiang
@ 2014-06-24 18:55 ` Scott Wood
  0 siblings, 0 replies; 6+ messages in thread
From: Scott Wood @ 2014-06-24 18:55 UTC (permalink / raw)
  To: Zhao Qiang; +Cc: B07421, linuxppc-dev

On Tue, 2014-06-24 at 15:55 +0800, Zhao Qiang wrote:
> ret is unused when CONFIG_FSL_SOC defined,
> so include it with "#ifndef CONFIG_FSL_SOC".
> 
> Signed-off-by: Zhao Qiang <B45475@freescale.com>
> ---
>  drivers/spi/spi-fsl-lib.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

This needs to be sent to the SPI list and maintainer.

-Scott

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

* [PATCH] spi: include "int ret" with macro
@ 2014-06-24  7:55 Zhao Qiang
  2014-06-24 18:55 ` Scott Wood
  0 siblings, 1 reply; 6+ messages in thread
From: Zhao Qiang @ 2014-06-24  7:55 UTC (permalink / raw)
  To: linuxppc-dev, B07421; +Cc: Zhao Qiang

ret is unused when CONFIG_FSL_SOC defined,
so include it with "#ifndef CONFIG_FSL_SOC".

Signed-off-by: Zhao Qiang <B45475@freescale.com>
---
 drivers/spi/spi-fsl-lib.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-fsl-lib.c b/drivers/spi/spi-fsl-lib.c
index e5d45fc..44aace1 100644
--- a/drivers/spi/spi-fsl-lib.c
+++ b/drivers/spi/spi-fsl-lib.c
@@ -198,8 +198,9 @@ int of_mpc8xxx_spi_probe(struct platform_device *ofdev)
 	struct mpc8xxx_spi_probe_info *pinfo;
 	struct fsl_spi_platform_data *pdata;
 	const void *prop;
+#ifndef CONFIG_FSL_SOC
 	int ret = -ENOMEM;
-
+#endif
 	pinfo = devm_kzalloc(&ofdev->dev, sizeof(*pinfo), GFP_KERNEL);
 	if (!pinfo)
 		return -ENOMEM;
-- 
1.8.5

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

end of thread, other threads:[~2014-06-25  8:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-25  1:54 [PATCH] spi: include "int ret" with macro Zhao Qiang
2014-06-25  1:54 ` Zhao Qiang
     [not found] ` <1403661276-16598-1-git-send-email-B45475-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-06-25  8:44   ` David Laight
2014-06-25  8:44     ` David Laight
  -- strict thread matches above, loose matches on Subject: below --
2014-06-24  7:55 Zhao Qiang
2014-06-24 18:55 ` Scott Wood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.