RE: [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code

2012-08-22 Thread Kukjin Kim
Julia Lawall wrote:
 
 From: Julia Lawall julia.law...@lip6.fr
 
 Initialize return variable before exiting on an error path.
 
 A simplified version of the semantic match that finds this problem is as
 follows: (http://coccinelle.lip6.fr/)
 
 // smpl
 (
 if@p1 (\(ret  0\|ret != 0\))
  { ... return ret; }
 |
 ret@p1 = 0
 )
 ... when != ret = e1
 when != ret
 *if(...)
 {
   ... when != ret = e2
   when forall
  return ret;
 }
 
 // /smpl
 
 Signed-off-by: Julia Lawall julia.law...@lip6.fr
 
Acked-by: Kukjin Kim kgene@samsung.com

(Cc'ed Mark Brown who is handling spi for a moment)

 ---
 Perhaps -EINVAL is not the right value in this case.
 
Well, if (pin_cs  0) is true, it is really invalid value. So I think, it
makes sense :-)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim kgene@samsung.com, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

  drivers/spi/spi-s3c24xx.c |1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/drivers/spi/spi-s3c24xx.c b/drivers/spi/spi-s3c24xx.c
 index 8ee7d79..a2a080b 100644
 --- a/drivers/spi/spi-s3c24xx.c
 +++ b/drivers/spi/spi-s3c24xx.c
 @@ -611,6 +611,7 @@ static int __devinit s3c24xx_spi_probe(struct
 platform_device *pdev)
   if (!pdata-set_cs) {
   if (pdata-pin_cs  0) {
   dev_err(pdev-dev, No chipselect pin\n);
 + err = -EINVAL;
   goto err_register;
   }
 

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code

2012-08-22 Thread Mark Brown
On Wed, Aug 22, 2012 at 06:38:36PM +0900, Kukjin Kim wrote:
 Julia Lawall wrote:

  Signed-off-by: Julia Lawall julia.law...@lip6.fr

 Acked-by: Kukjin Kim kgene@samsung.com

 (Cc'ed Mark Brown who is handling spi for a moment)

Please resend the patch to me so I can apply this.


signature.asc
Description: Digital signature


Re: [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code

2012-08-22 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr

Initialize return variable before exiting on an error path.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// smpl
(
if@p1 (\(ret  0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
when != ret
*if(...)
{
  ... when != ret = e2
  when forall
 return ret;
}

// /smpl

Signed-off-by: Julia Lawall julia.law...@lip6.fr

---
Perhaps -EINVAL is not the right value in this case.

 drivers/spi/spi-s3c24xx.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-s3c24xx.c b/drivers/spi/spi-s3c24xx.c
index 8ee7d79..a2a080b 100644
--- a/drivers/spi/spi-s3c24xx.c
+++ b/drivers/spi/spi-s3c24xx.c
@@ -611,6 +611,7 @@ static int __devinit s3c24xx_spi_probe(struct 
platform_device *pdev)
if (!pdata-set_cs) {
if (pdata-pin_cs  0) {
dev_err(pdev-dev, No chipselect pin\n);
+   err = -EINVAL;
goto err_register;
}


--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code

2012-08-22 Thread Mark Brown
On Wed, Aug 22, 2012 at 01:42:47PM +0200, Julia Lawall wrote:
 From: Julia Lawall julia.law...@lip6.fr
 
 Initialize return variable before exiting on an error path.

Applied, thanks.


signature.asc
Description: Digital signature


[PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code

2012-08-19 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr

Initialize return variable before exiting on an error path.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// smpl
(
if@p1 (\(ret  0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
when != ret
*if(...)
{
  ... when != ret = e2
  when forall
 return ret;
}

// /smpl

Signed-off-by: Julia Lawall julia.law...@lip6.fr

---
Perhaps -EINVAL is not the right value in this case.

 drivers/spi/spi-s3c24xx.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-s3c24xx.c b/drivers/spi/spi-s3c24xx.c
index 8ee7d79..a2a080b 100644
--- a/drivers/spi/spi-s3c24xx.c
+++ b/drivers/spi/spi-s3c24xx.c
@@ -611,6 +611,7 @@ static int __devinit s3c24xx_spi_probe(struct 
platform_device *pdev)
if (!pdata-set_cs) {
if (pdata-pin_cs  0) {
dev_err(pdev-dev, No chipselect pin\n);
+   err = -EINVAL;
goto err_register;
}
 

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html