Skip to contentSkip to conversation

staging:kpc2000:Fix integer as null pointer warning

PATCH In review Harsh Jain 2 participants 4 messages Jun 28, 2019 – Jul 1, 2019 Staging

lore
Share & tools
lore

Harsh Jain

author
#0 lore raw

cover staging:kpc2000:Fix integer as null pointer warning

It fixes sparse warning in kpc2000 driver.

Harsh Jain (2):
staging:kpc2000:Fix symbol not declared warning staging:kpc2000:Fix integer as null pointer warning

 drivers/staging/kpc2000/kpc_i2c/i2c_driver.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/2 staging:kpc2000:Fix symbol not declared warning

It fixes "symbol was not declared. Should it be static?" sparse warning.

---
 drivers/staging/kpc2000/kpc_i2c/i2c_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/kpc2000/kpc_i2c/i2c_driver.c +2 -2
index 0fb068b2408d..204f33d0dc69 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);
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH 2/2 staging:kpc2000:Fix integer as null pointer warning

It fixes "Using plain integer as NULL pointer"
sparse warning.

---
 drivers/staging/kpc2000/kpc_i2c/i2c_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/kpc2000/kpc_i2c/i2c_driver.c +2 -2
index 204f33d0dc69..155da641e3a2 100644
@@ -679,9 +679,9 @@ static 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
#3 lore raw

Re: [PATCH 1/2] staging:kpc2000:Fix symbol not declared warning

In reply to Harsh Jain
Quoted 6 lines · Harsh Jain

It fixes "symbol was not declared. Should it be static?" sparse warning.

---
 drivers/staging/kpc2000/kpc_i2c/i2c_driver.c | 4 ++--

This file isn't even in the linux-next tree at all, it has moved weeks ago.

Always be sure to work against linux-next so that you do not create things that are not able to be accepted.

thanks,

greg k-h