[PATCH] nGene: use NULL when pointer is needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Márton Németh <nm127@xxxxxxxxxxx>

Use NULL when calling a function with pointer parameter, initializing a
pointer and returning a pointer. This will remove the following sparse
warning at different locations (see "make C=1"):
 * warning: Using plain integer as NULL pointer

Signed-off-by: Márton Németh <nm127@xxxxxxxxxxx>
---
diff -r 37581bb7e6f1 linux/drivers/media/dvb/ngene/ngene-core.c
--- a/linux/drivers/media/dvb/ngene/ngene-core.c	Wed Feb 24 22:48:50 2010 -0300
+++ b/linux/drivers/media/dvb/ngene/ngene-core.c	Sun Feb 28 15:28:56 2010 +0100
@@ -994,7 +994,7 @@
 					     msg[0].buf, msg[0].len))
 			goto done;
 	if (num == 1 && (msg[0].flags & I2C_M_RD))
-		if (!ngene_command_i2c_read(dev, msg[0].addr, 0, 0,
+		if (!ngene_command_i2c_read(dev, msg[0].addr, NULL, 0,
 					    msg[0].buf, msg[0].len, 0))
 			goto done;

@@ -1793,7 +1793,7 @@
 	if (chan->users > 0)
 #endif
 		dvb_dmx_swfilter(&chan->demux, buf, len);
-	return 0;
+	return NULL;
 }

 u8 fill_ts[188] = { 0x47, 0x1f, 0xff, 0x10 };
@@ -1900,7 +1900,7 @@
 		       state);
 	if (!state) {
 		spin_lock_irq(&chan->state_lock);
-		chan->pBufferExchange = 0;
+		chan->pBufferExchange = NULL;
 		dvb_ringbuffer_flush(&dev->tsout_rbuf);
 		spin_unlock_irq(&chan->state_lock);
 	}
@@ -2226,7 +2226,7 @@
 	dvbdemux->feednum = 256;
 	dvbdemux->start_feed = start_feed;
 	dvbdemux->stop_feed = stop_feed;
-	dvbdemux->write_to_decoder = 0;
+	dvbdemux->write_to_decoder = NULL;
 	dvbdemux->dmx.capabilities = (DMX_TS_FILTERING |
 				      DMX_SECTION_FILTERING |
 				      DMX_MEMORY_BASED_FILTERING);
@@ -2383,8 +2383,8 @@
 		return;
 	free_ringbuffer(dev, rb);
 	for (j = 0; j < tb->NumBuffers; j++, Cur = Cur->Next) {
-		Cur->Buffer2 = 0;
-		Cur->scList2 = 0;
+		Cur->Buffer2 = NULL;
+		Cur->scList2 = NULL;
 		Cur->ngeneBuffer.Address_of_first_entry_2 = 0;
 		Cur->ngeneBuffer.Number_of_entries_2 = 0;
 	}
@@ -2430,7 +2430,7 @@
 	u64 PARingBufferNext;
 	struct SBufferHeader *Cur, *Next;

-	descr->Head = 0;
+	descr->Head = NULL;
 	descr->MemSize = 0;
 	descr->PAHead = 0;
 	descr->NumBuffers = 0;
@@ -3619,7 +3619,7 @@
 		if (chan->fe) {
 			dvb_unregister_frontend(chan->fe);
 			dvb_frontend_detach(chan->fe);
-			chan->fe = 0;
+			chan->fe = NULL;
 		}
 		dvbdemux->dmx.close(&dvbdemux->dmx);
 		dvbdemux->dmx.remove_frontend(&dvbdemux->dmx,
@@ -3765,7 +3765,7 @@
 		release_channel(&dev->channel[i]);
 	ngene_stop(dev);
 	ngene_release_buffers(dev);
-	pci_set_drvdata(pdev, 0);
+	pci_set_drvdata(pdev, NULL);
 	pci_disable_device(pdev);
 }

@@ -3840,7 +3840,7 @@
 	ngene_release_buffers(dev);
 fail0:
 	pci_disable_device(pci_dev);
-	pci_set_drvdata(pci_dev, 0);
+	pci_set_drvdata(pci_dev, NULL);
 	return stat;
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux