Patchwork nfc: NULL vs zero in nci_activate_target()

login
register
mail settings
Submitter Dan Carpenter
Date Jan. 26, 2012, 6:13 a.m.
Message ID <20120126061330.GA15856@elgon.mountain>
Download mbox | patch
Permalink /patch/137879/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Dan Carpenter - Jan. 26, 2012, 6:13 a.m.
This is a pointer so it should be NULL instead of zero.  Sparse
complains about this stuff:
net/nfc/nci/core.c:447:37: warning: Using plain integer as NULL pointer

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Samuel Ortiz - Jan. 26, 2012, 8:23 p.m.
Hi Dan,

On Thu, Jan 26, 2012 at 09:13:31AM +0300, Dan Carpenter wrote:
> This is a pointer so it should be NULL instead of zero.  Sparse
> complains about this stuff:
> net/nfc/nci/core.c:447:37: warning: Using plain integer as NULL pointer
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>

Cheers,
Samuel.

Patch

diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 12d1d4d..a47e90c 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -444,7 +444,7 @@  static int nci_activate_target(struct nfc_dev *nfc_dev, __u32 target_idx,
 {
 	struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
 	struct nci_rf_discover_select_param param;
-	struct nfc_target *target = 0;
+	struct nfc_target *target = NULL;
 	int i;
 	int rc = 0;