Re: [PATCH] drivers/mtd/devices/spear_smi.c: failure test for null rather than negative integer
On Wed, 2012-07-11 at 10:58 +0200, Julia Lawall wrote: > From: Julia Lawall > > dev_get_platdata returns a pointer, so the failure value would be NULL > rather than a negative integer. > > The semantic match that finds this problem is: (http://coccinelle.lip6.fr/) Pushed to l2-mtd.git, thanks! -- Best Regards, Artem Bityutskiy signature.asc Description: This is a digitally signed message part
Re: [PATCH] drivers/mtd/devices/spear_smi.c: failure test for null rather than negative integer
On Wed, 2012-07-11 at 10:58 +0200, Julia Lawall wrote: From: Julia Lawall julia.law...@lip6.fr dev_get_platdata returns a pointer, so the failure value would be NULL rather than a negative integer. The semantic match that finds this problem is: (http://coccinelle.lip6.fr/) Pushed to l2-mtd.git, thanks! -- Best Regards, Artem Bityutskiy signature.asc Description: This is a digitally signed message part
Re: [PATCH] drivers/mtd/devices/spear_smi.c: failure test for null rather than negative integer
On Wednesday 11 July 2012 10:58:38 Julia Lawall wrote: > From: Julia Lawall > > dev_get_platdata returns a pointer, so the failure value would be NULL > rather than a negative integer. > > The semantic match that finds this problem is: (http://coccinelle.lip6.fr/) > > // > @@ > expression x,e; > statement S1,S2; > @@ > > *x = dev_get_platdata(...) > ... when != x = e > *if (x < 0) S1 else S2 > // > > Signed-off-by: Julia Lawall Acked-by: Stefan Roese Thanks, Stefan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] drivers/mtd/devices/spear_smi.c: failure test for null rather than negative integer
On Wednesday 11 July 2012 10:58:38 Julia Lawall wrote: From: Julia Lawall julia.law...@lip6.fr dev_get_platdata returns a pointer, so the failure value would be NULL rather than a negative integer. The semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // smpl @@ expression x,e; statement S1,S2; @@ *x = dev_get_platdata(...) ... when != x = e *if (x 0) S1 else S2 // /smpl Signed-off-by: Julia Lawall julia.law...@lip6.fr Acked-by: Stefan Roese s...@denx.de Thanks, Stefan -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] drivers/mtd/devices/spear_smi.c: failure test for null rather than negative integer
Adding spear-devel mailing list in cc. @Shiraz: Can you update ST's mailing list address in entire MAINTAINERS file, so that people can include ST's list easily? On 11/07/12 09:58, Julia Lawall wrote: > From: Julia Lawall > > dev_get_platdata returns a pointer, so the failure value would be NULL > rather than a negative integer. > > The semantic match that finds this problem is: (http://coccinelle.lip6.fr/) > > // > @@ > expression x,e; > statement S1,S2; > @@ > > *x = dev_get_platdata(...) > ... when != x = e > *if (x < 0) S1 else S2 > // > > Signed-off-by: Julia Lawall > > --- > drivers/mtd/devices/spear_smi.c |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c > index b85f183..7c10466 100644 > --- a/drivers/mtd/devices/spear_smi.c > +++ b/drivers/mtd/devices/spear_smi.c > @@ -935,7 +935,7 @@ static int __devinit spear_smi_probe(struct > platform_device *pdev) > } > } else { > pdata = dev_get_platdata(>dev); > - if (pdata < 0) { > + if (!pdata) { > ret = -ENODEV; > dev_err(>dev, "no platform data\n"); > goto err; Reviewed-by: Viresh Kumar -- Viresh -- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] drivers/mtd/devices/spear_smi.c: failure test for null rather than negative integer
From: Julia Lawall dev_get_platdata returns a pointer, so the failure value would be NULL rather than a negative integer. The semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // @@ expression x,e; statement S1,S2; @@ *x = dev_get_platdata(...) ... when != x = e *if (x < 0) S1 else S2 // Signed-off-by: Julia Lawall --- drivers/mtd/devices/spear_smi.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c index b85f183..7c10466 100644 --- a/drivers/mtd/devices/spear_smi.c +++ b/drivers/mtd/devices/spear_smi.c @@ -935,7 +935,7 @@ static int __devinit spear_smi_probe(struct platform_device *pdev) } } else { pdata = dev_get_platdata(>dev); - if (pdata < 0) { + if (!pdata) { ret = -ENODEV; dev_err(>dev, "no platform data\n"); goto err; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] drivers/mtd/devices/spear_smi.c: failure test for null rather than negative integer
From: Julia Lawall julia.law...@lip6.fr dev_get_platdata returns a pointer, so the failure value would be NULL rather than a negative integer. The semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // smpl @@ expression x,e; statement S1,S2; @@ *x = dev_get_platdata(...) ... when != x = e *if (x 0) S1 else S2 // /smpl Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/mtd/devices/spear_smi.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c index b85f183..7c10466 100644 --- a/drivers/mtd/devices/spear_smi.c +++ b/drivers/mtd/devices/spear_smi.c @@ -935,7 +935,7 @@ static int __devinit spear_smi_probe(struct platform_device *pdev) } } else { pdata = dev_get_platdata(pdev-dev); - if (pdata 0) { + if (!pdata) { ret = -ENODEV; dev_err(pdev-dev, no platform data\n); goto err; -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] drivers/mtd/devices/spear_smi.c: failure test for null rather than negative integer
Adding spear-devel mailing list in cc. @Shiraz: Can you update ST's mailing list address in entire MAINTAINERS file, so that people can include ST's list easily? On 11/07/12 09:58, Julia Lawall wrote: From: Julia Lawall julia.law...@lip6.fr dev_get_platdata returns a pointer, so the failure value would be NULL rather than a negative integer. The semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // smpl @@ expression x,e; statement S1,S2; @@ *x = dev_get_platdata(...) ... when != x = e *if (x 0) S1 else S2 // /smpl Signed-off-by: Julia Lawall julia.law...@lip6.fr --- drivers/mtd/devices/spear_smi.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c index b85f183..7c10466 100644 --- a/drivers/mtd/devices/spear_smi.c +++ b/drivers/mtd/devices/spear_smi.c @@ -935,7 +935,7 @@ static int __devinit spear_smi_probe(struct platform_device *pdev) } } else { pdata = dev_get_platdata(pdev-dev); - if (pdata 0) { + if (!pdata) { ret = -ENODEV; dev_err(pdev-dev, no platform data\n); goto err; Reviewed-by: Viresh Kumar viresh.ku...@linaro.org -- Viresh -- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/