Skip to contentSkip to conversation

staging:kpc2000:Fix sparse warnings

PATCH In review Harsh Jain 2 participants 2 messages Jun 27, 2019 – Jun 28, 2019 Staging

lore
Share & tools
lore

Harsh Jain

author
#0 lore raw

PATCH 1/1 staging:kpc2000:Fix sparse warnings

From: root <[email protected]>

Fix following sparse warning
symbol was not declared. Should it be static?
Using plain integer as NULL pointer

---
 drivers/staging/kpc2000/kpc_i2c/i2c_driver.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/kpc2000/kpc_i2c/i2c_driver.c +4 -4
index 0fb068b2408d..155da641e3a2 100644
@@ -614,7 +614,7 @@ static const struct i2c_algorithm smbus_algorithm = {
 /********************************
  *** Part 2 - Driver Handlers ***
  ********************************/
-int pi2c_probe(struct platform_device *pldev)
+static int pi2c_probe(struct platform_device *pldev)
 {
     int err;
     struct i2c_device *priv;
@@ -664,7 +664,7 @@ int pi2c_probe(struct platform_device *pldev)
     return 0;
 }
 
-int pi2c_remove(struct platform_device *pldev)
+static int pi2c_remove(struct platform_device *pldev)
 {
     struct i2c_device *lddev;
     dev_dbg(&pldev->dev, "pi2c_remove(pldev = %p '%s')\n", pldev, pldev->name);
@@ -679,9 +679,9 @@ int pi2c_remove(struct platform_device *pldev)
     //pci_set_drvdata(dev, NULL);
     
     //cdev_del(&lddev->cdev);
-    if(lddev != 0) {
+    if(lddev != NULL) {
         kfree(lddev);
-        pldev->dev.platform_data = 0;
+        pldev->dev.platform_data = NULL;
     }
     
     return 0;
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 1 line · Harsh Jain

From: root <[email protected]>

Interesting user name :)

Quoted 3 lines

Fix following sparse warning
symbol was not declared. Should it be static?
Using plain integer as NULL pointer

Don't do multiple things in the same patch. Please break thsi up into two different patches and fix up your email address.

Also never do kernel development as root on your system, it's easy to break things...

thanks,

greg k-h