linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 2/2] input/tps6507x-ts: zero vs NULL
@ 2010-05-31 12:02 Dan Carpenter
  2010-05-31 19:10 ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2010-05-31 12:02 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Todd Fischer, Samuel Ortiz, linux-input, linux-kernel,
	kernel-janitors

This patch silences a sparse warning:

drivers/input/touchscreen/tps6507x-ts.c:345:19:
	warning: Using plain integer as NULL pointer
drivers/input/touchscreen/tps6507x-ts.c:367:19:
	warning: Using plain integer as NULL pointer

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c
index b99db09..1e57e4e 100644
--- a/drivers/input/touchscreen/tps6507x-ts.c
+++ b/drivers/input/touchscreen/tps6507x-ts.c
@@ -342,7 +342,7 @@ err2:
 	cancel_delayed_work(&tsc->work);
 	flush_workqueue(tsc->wq);
 	destroy_workqueue(tsc->wq);
-	tsc->wq = 0;
+	tsc->wq = NULL;
 	input_free_device(input_dev);
 err1:
 	kfree(tsc);
@@ -364,7 +364,7 @@ static int __devexit tps6507x_ts_remove(struct platform_device *pdev)
 	cancel_delayed_work(&tsc->work);
 	flush_workqueue(tsc->wq);
 	destroy_workqueue(tsc->wq);
-	tsc->wq = 0;
+	tsc->wq = NULL;
 
 	input_free_device(input_dev);
 

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

* Re: [patch 2/2] input/tps6507x-ts: zero vs NULL
  2010-05-31 12:02 [patch 2/2] input/tps6507x-ts: zero vs NULL Dan Carpenter
@ 2010-05-31 19:10 ` Dmitry Torokhov
  2010-05-31 21:07   ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2010-05-31 19:10 UTC (permalink / raw)
  To: Dan Carpenter, Todd Fischer, Samuel Ortiz, linux-input,
	linux-kernel, kernel-j

On Mon, May 31, 2010 at 02:02:15PM +0200, Dan Carpenter wrote:
> This patch silences a sparse warning:
> 
> drivers/input/touchscreen/tps6507x-ts.c:345:19:
> 	warning: Using plain integer as NULL pointer
> drivers/input/touchscreen/tps6507x-ts.c:367:19:
> 	warning: Using plain integer as NULL pointer
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c
> index b99db09..1e57e4e 100644
> --- a/drivers/input/touchscreen/tps6507x-ts.c
> +++ b/drivers/input/touchscreen/tps6507x-ts.c
> @@ -342,7 +342,7 @@ err2:
>  	cancel_delayed_work(&tsc->work);
>  	flush_workqueue(tsc->wq);
>  	destroy_workqueue(tsc->wq);
> -	tsc->wq = 0;
> +	tsc->wq = NULL;
>  	input_free_device(input_dev);
>  err1:
>  	kfree(tsc);
> @@ -364,7 +364,7 @@ static int __devexit tps6507x_ts_remove(struct platform_device *pdev)
>  	cancel_delayed_work(&tsc->work);
>  	flush_workqueue(tsc->wq);

Why isn't it cancel_delayed_work_sync()?

>  	destroy_workqueue(tsc->wq);
> -	tsc->wq = 0;
> +	tsc->wq = NULL;
>  

Setting tsc to 0/NULL does not make much sense as it is being freed a
couple of lines below.

>  	input_free_device(input_dev);
>  

-- 
Dmitry

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

* Re: [patch 2/2] input/tps6507x-ts: zero vs NULL
  2010-05-31 19:10 ` Dmitry Torokhov
@ 2010-05-31 21:07   ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2010-05-31 21:07 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Todd Fischer, Samuel Ortiz, linux-input, linux-kernel,
	kernel-janitors

On Mon, May 31, 2010 at 12:10:29PM -0700, Dmitry Torokhov wrote:
> On Mon, May 31, 2010 at 02:02:15PM +0200, Dan Carpenter wrote:
> > --- a/drivers/input/touchscreen/tps6507x-ts.c
> > +++ b/drivers/input/touchscreen/tps6507x-ts.c
> > @@ -342,7 +342,7 @@ err2:
> >  	cancel_delayed_work(&tsc->work);
> >  	flush_workqueue(tsc->wq);
> >  	destroy_workqueue(tsc->wq);
> > -	tsc->wq = 0;
> > +	tsc->wq = NULL;
> >  	input_free_device(input_dev);
> >  err1:
> >  	kfree(tsc);
> > @@ -364,7 +364,7 @@ static int __devexit tps6507x_ts_remove(struct platform_device *pdev)
> >  	cancel_delayed_work(&tsc->work);
> >  	flush_workqueue(tsc->wq);
> 
> Why isn't it cancel_delayed_work_sync()?
> 

Good point.

> >  	destroy_workqueue(tsc->wq);
> > -	tsc->wq = 0;
> > +	tsc->wq = NULL;
> >  
> 
> Setting tsc to 0/NULL does not make much sense as it is being freed a
> couple of lines below.
> 

That's true.  I'll send an updated patch tomorrow.

regards,
dan carpenter

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

end of thread, other threads:[~2010-05-31 21:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-31 12:02 [patch 2/2] input/tps6507x-ts: zero vs NULL Dan Carpenter
2010-05-31 19:10 ` Dmitry Torokhov
2010-05-31 21:07   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).