aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/cx18
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-08-28 06:50:28 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-09-23 08:20:57 -0400
commitaf28c99628ebfbdc3fff3d92c7044d3a51b7ccea (patch)
treeff56a13fbd5ed6c2bb20a746464fd49fb0199c48 /drivers/media/pci/cx18
parent2d3da59ff163b2aa805de0fc65ba933a735b00cd (diff)
media: drivers: Adjust checks for null pointers
The script “checkpatch.pl” pointed information out like the following. Comparison to NULL could be written !… Thus fix the affected source code places. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Diffstat (limited to 'drivers/media/pci/cx18')
-rw-r--r--drivers/media/pci/cx18/cx18-driver.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c
index 6efa93168059..8f314ca320c7 100644
--- a/drivers/media/pci/cx18/cx18-driver.c
+++ b/drivers/media/pci/cx18/cx18-driver.c
@@ -255,7 +255,7 @@ static void request_module_async(struct work_struct *work)
255 request_module("cx18-alsa"); 255 request_module("cx18-alsa");
256 256
257 /* Initialize cx18-alsa for this instance of the cx18 device */ 257 /* Initialize cx18-alsa for this instance of the cx18 device */
258 if (cx18_ext_init != NULL) 258 if (cx18_ext_init)
259 cx18_ext_init(dev); 259 cx18_ext_init(dev);
260} 260}
261 261
@@ -291,11 +291,11 @@ int cx18_msleep_timeout(unsigned int msecs, int intr)
291/* Release ioremapped memory */ 291/* Release ioremapped memory */
292static void cx18_iounmap(struct cx18 *cx) 292static void cx18_iounmap(struct cx18 *cx)
293{ 293{
294 if (cx == NULL) 294 if (!cx)
295 return; 295 return;
296 296
297 /* Release io memory */ 297 /* Release io memory */
298 if (cx->enc_mem != NULL) { 298 if (cx->enc_mem) {
299 CX18_DEBUG_INFO("releasing enc_mem\n"); 299 CX18_DEBUG_INFO("releasing enc_mem\n");
300 iounmap(cx->enc_mem); 300 iounmap(cx->enc_mem);
301 cx->enc_mem = NULL; 301 cx->enc_mem = NULL;
@@ -649,15 +649,15 @@ static void cx18_process_options(struct cx18 *cx)
649 CX18_INFO("User specified %s card\n", cx->card->name); 649 CX18_INFO("User specified %s card\n", cx->card->name);
650 else if (cx->options.cardtype != 0) 650 else if (cx->options.cardtype != 0)
651 CX18_ERR("Unknown user specified type, trying to autodetect card\n"); 651 CX18_ERR("Unknown user specified type, trying to autodetect card\n");
652 if (cx->card == NULL) { 652 if (!cx->card) {
653 if (cx->pci_dev->subsystem_vendor == CX18_PCI_ID_HAUPPAUGE) { 653 if (cx->pci_dev->subsystem_vendor == CX18_PCI_ID_HAUPPAUGE) {
654 cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT); 654 cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT);
655 CX18_INFO("Autodetected Hauppauge card\n"); 655 CX18_INFO("Autodetected Hauppauge card\n");
656 } 656 }
657 } 657 }
658 if (cx->card == NULL) { 658 if (!cx->card) {
659 for (i = 0; (cx->card = cx18_get_card(i)); i++) { 659 for (i = 0; (cx->card = cx18_get_card(i)); i++) {
660 if (cx->card->pci_list == NULL) 660 if (!cx->card->pci_list)
661 continue; 661 continue;
662 for (j = 0; cx->card->pci_list[j].device; j++) { 662 for (j = 0; cx->card->pci_list[j].device; j++) {
663 if (cx->pci_dev->device != 663 if (cx->pci_dev->device !=
@@ -676,7 +676,7 @@ static void cx18_process_options(struct cx18 *cx)
676 } 676 }
677done: 677done:
678 678
679 if (cx->card == NULL) { 679 if (!cx->card) {
680 cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT); 680 cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT);
681 CX18_ERR("Unknown card: vendor/device: [%04x:%04x]\n", 681 CX18_ERR("Unknown card: vendor/device: [%04x:%04x]\n",
682 cx->pci_dev->vendor, cx->pci_dev->device); 682 cx->pci_dev->vendor, cx->pci_dev->device);
@@ -698,7 +698,7 @@ static int cx18_create_in_workq(struct cx18 *cx)
698 snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in", 698 snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in",
699 cx->v4l2_dev.name); 699 cx->v4l2_dev.name);
700 cx->in_work_queue = alloc_ordered_workqueue("%s", 0, cx->in_workq_name); 700 cx->in_work_queue = alloc_ordered_workqueue("%s", 0, cx->in_workq_name);
701 if (cx->in_work_queue == NULL) { 701 if (!cx->in_work_queue) {
702 CX18_ERR("Unable to create incoming mailbox handler thread\n"); 702 CX18_ERR("Unable to create incoming mailbox handler thread\n");
703 return -ENOMEM; 703 return -ENOMEM;
704 } 704 }
@@ -1254,7 +1254,7 @@ static void cx18_cancel_out_work_orders(struct cx18 *cx)
1254{ 1254{
1255 int i; 1255 int i;
1256 for (i = 0; i < CX18_MAX_STREAMS; i++) 1256 for (i = 0; i < CX18_MAX_STREAMS; i++)
1257 if (&cx->streams[i].video_dev != NULL) 1257 if (&cx->streams[i].video_dev)
1258 cancel_work_sync(&cx->streams[i].out_work_order); 1258 cancel_work_sync(&cx->streams[i].out_work_order);
1259} 1259}
1260 1260
@@ -1299,7 +1299,7 @@ static void cx18_remove(struct pci_dev *pci_dev)
1299 1299
1300 pci_disable_device(cx->pci_dev); 1300 pci_disable_device(cx->pci_dev);
1301 1301
1302 if (cx->vbi.sliced_mpeg_data[0] != NULL) 1302 if (cx->vbi.sliced_mpeg_data[0])
1303 for (i = 0; i < CX18_VBI_FRAMES; i++) 1303 for (i = 0; i < CX18_VBI_FRAMES; i++)
1304 kfree(cx->vbi.sliced_mpeg_data[i]); 1304 kfree(cx->vbi.sliced_mpeg_data[i]);
1305 1305