Skip to contentSkip to conversation

input/tps6507x-ts: zero vs NULL

PATCH In review Dan Carpenter 2 participants 3 messages May 31, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 input/tps6507x-ts: zero vs NULL

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

drivers/input/touchscreen/tps6507x-ts.c +2 -2
index b99db09..1e57e4e 100644
@@ -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);
 
maintainer
#1 lore raw
Quoted 23 lines · Dan Carpenter

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

drivers/input/touchscreen/tps6507x-ts.c +1 -1
index b99db09..1e57e4e 100644
@@ -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);

drivers/input/touchscreen/tps6507x-ts.c static int __devexit tps6507x_ts_remove(struct platform_device *pdev) · line 365

Quoted 2 lines
drivers/input/touchscreen/tps6507x-ts.c +0 -0
@@ -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()?

drivers/input/touchscreen/tps6507x-ts.c static int __devexit tps6507x_ts_remove(struct platform_device *pdev) · line 368

Quoted 4 lines
drivers/input/touchscreen/tps6507x-ts.c +1 -1
 	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.

Quoted 2 lines
drivers/input/touchscreen/tps6507x-ts.c +0 -0
 	input_free_device(input_dev);
 
Signature · 1 line
Dmitry
#2 lore raw
Quoted 18 lines · Dmitry Torokhov
Quoted 12 lines · Dan Carpenter
drivers/input/touchscreen/tps6507x-ts.c +1 -1
@@ -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);

drivers/input/touchscreen/tps6507x-ts.c static int __devexit tps6507x_ts_remove(struct platform_device *pdev) · line 365

Quoted 2 lines
drivers/input/touchscreen/tps6507x-ts.c +0 -0
@@ -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.

Quoted 8 lines

drivers/input/touchscreen/tps6507x-ts.c static int __devexit tps6507x_ts_remove(struct platform_device *pdev) · line 368

Quoted 4 lines
drivers/input/touchscreen/tps6507x-ts.c +1 -1
 	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