All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] drivers/staging/msm/lcdc.c: Convert IS_ERR result to PTR_ERR
@ 2011-01-27 15:49 ` Julia Lawall
  0 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2011-01-27 15:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: kernel-janitors, Daniel Walker, Stepan Moskovchenko,
	Abhijeet Dharmapurikar, David Brown, devel, linux-kernel

This code elsewhere returns a negative constant to an indicate an error,
while IS_ERR returns the result of a >= operation.

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
@@

 if (...) { ...
- return IS_ERR(x);
+ return PTR_ERR(x);
}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 drivers/staging/msm/lcdc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/staging/msm/lcdc.c b/drivers/staging/msm/lcdc.c
--- a/drivers/staging/msm/lcdc.c
+++ b/drivers/staging/msm/lcdc.c
@@ -224,12 +224,12 @@ static int __init lcdc_driver_init(void)
 	mdp_lcdc_pclk_clk = clk_get(NULL, "mdp_lcdc_pclk_clk");
 	if (IS_ERR(mdp_lcdc_pclk_clk)) {
 		printk(KERN_ERR "error: can't get mdp_lcdc_pclk_clk!\n");
-		return IS_ERR(mdp_lcdc_pclk_clk);
+		return PTR_ERR(mdp_lcdc_pclk_clk);
 	}
 	mdp_lcdc_pad_pclk_clk = clk_get(NULL, "mdp_lcdc_pad_pclk_clk");
 	if (IS_ERR(mdp_lcdc_pad_pclk_clk)) {
 		printk(KERN_ERR "error: can't get mdp_lcdc_pad_pclk_clk!\n");
-		return IS_ERR(mdp_lcdc_pad_pclk_clk);
+		return PTR_ERR(mdp_lcdc_pad_pclk_clk);
 	}
 //	pm_qos_add_requirement(PM_QOS_SYSTEM_BUS_FREQ , "lcdc",
 //				PM_QOS_DEFAULT_VALUE);


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

* [PATCH 2/2] drivers/staging/msm/lcdc.c: Convert IS_ERR result to PTR_ERR
@ 2011-01-27 15:49 ` Julia Lawall
  0 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2011-01-27 15:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: kernel-janitors, Daniel Walker, Stepan Moskovchenko,
	Abhijeet Dharmapurikar, David Brown, devel, linux-kernel

This code elsewhere returns a negative constant to an indicate an error,
while IS_ERR returns the result of a >= operation.

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
@@

 if (...) { ...
- return IS_ERR(x);
+ return PTR_ERR(x);
}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 drivers/staging/msm/lcdc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/staging/msm/lcdc.c b/drivers/staging/msm/lcdc.c
--- a/drivers/staging/msm/lcdc.c
+++ b/drivers/staging/msm/lcdc.c
@@ -224,12 +224,12 @@ static int __init lcdc_driver_init(void)
 	mdp_lcdc_pclk_clk = clk_get(NULL, "mdp_lcdc_pclk_clk");
 	if (IS_ERR(mdp_lcdc_pclk_clk)) {
 		printk(KERN_ERR "error: can't get mdp_lcdc_pclk_clk!\n");
-		return IS_ERR(mdp_lcdc_pclk_clk);
+		return PTR_ERR(mdp_lcdc_pclk_clk);
 	}
 	mdp_lcdc_pad_pclk_clk = clk_get(NULL, "mdp_lcdc_pad_pclk_clk");
 	if (IS_ERR(mdp_lcdc_pad_pclk_clk)) {
 		printk(KERN_ERR "error: can't get mdp_lcdc_pad_pclk_clk!\n");
-		return IS_ERR(mdp_lcdc_pad_pclk_clk);
+		return PTR_ERR(mdp_lcdc_pad_pclk_clk);
 	}
 //	pm_qos_add_requirement(PM_QOS_SYSTEM_BUS_FREQ , "lcdc",
 //				PM_QOS_DEFAULT_VALUE);


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

* Re: [PATCH 2/2] drivers/staging/msm/lcdc.c: Convert IS_ERR result to PTR_ERR
  2011-01-27 15:49 ` Julia Lawall
@ 2011-01-27 19:00   ` David Brown
  -1 siblings, 0 replies; 4+ messages in thread
From: David Brown @ 2011-01-27 19:00 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Greg Kroah-Hartman, kernel-janitors, Daniel Walker,
	Stepan Moskovchenko, Abhijeet Dharmapurikar, devel, linux-kernel

On Thu, Jan 27 2011, Julia Lawall wrote:

> This code elsewhere returns a negative constant to an indicate an error,
> while IS_ERR returns the result of a >= operation.
>
> The semantic patch that fixes this problem is as follows:
> (http://coccinelle.lip6.fr/)
>
> Signed-off-by: Julia Lawall <julia@diku.dk>

Acked-by: David Brown <davidb@codeaurora.org>

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

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

* Re: [PATCH 2/2] drivers/staging/msm/lcdc.c: Convert IS_ERR result to PTR_ERR
@ 2011-01-27 19:00   ` David Brown
  0 siblings, 0 replies; 4+ messages in thread
From: David Brown @ 2011-01-27 19:00 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Greg Kroah-Hartman, kernel-janitors, Daniel Walker,
	Stepan Moskovchenko, Abhijeet Dharmapurikar, devel, linux-kernel

On Thu, Jan 27 2011, Julia Lawall wrote:

> This code elsewhere returns a negative constant to an indicate an error,
> while IS_ERR returns the result of a >= operation.
>
> The semantic patch that fixes this problem is as follows:
> (http://coccinelle.lip6.fr/)
>
> Signed-off-by: Julia Lawall <julia@diku.dk>

Acked-by: David Brown <davidb@codeaurora.org>

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

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

end of thread, other threads:[~2011-01-27 19:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-27 15:49 [PATCH 2/2] drivers/staging/msm/lcdc.c: Convert IS_ERR result to PTR_ERR Julia Lawall
2011-01-27 15:49 ` Julia Lawall
2011-01-27 19:00 ` David Brown
2011-01-27 19:00   ` David Brown

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.