From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-media@vger.kernel.org,
Hans Verkuil <hans.verkuil@cisco.com>,
"Lad, Prabhakar" <prabhakar.csengg@gmail.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Julia Lawall <julia.lawall@lip6.fr>
Subject: [PATCH 20/34] [media] DaVinci-VPFE-Capture: Adjust 13 checks for null pointers
Date: Wed, 12 Oct 2016 16:58:39 +0200 [thread overview]
Message-ID: <111cbf0f-7fe6-63e7-6577-0724f3789226@users.sourceforge.net> (raw)
In-Reply-To: <a99f89f2-a3be-9b5f-95c1-e0912a7d78f3@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 12 Oct 2016 10:46:28 +0200
Convert comparisons with the preprocessor symbol "NULL" to condition checks
without it.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/platform/davinci/vpfe_capture.c | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c
index e370400..9da353b 100644
--- a/drivers/media/platform/davinci/vpfe_capture.c
+++ b/drivers/media/platform/davinci/vpfe_capture.c
@@ -229,7 +229,7 @@ int vpfe_register_ccdc_device(struct ccdc_hw_device *dev)
BUG_ON(!dev->hw_ops.getfid);
mutex_lock(&ccdc_lock);
- if (NULL == ccdc_cfg) {
+ if (!ccdc_cfg) {
/*
* TODO. Will this ever happen? if so, we need to fix it.
* Proabably we need to add the request to a linked list and
@@ -265,7 +265,7 @@ EXPORT_SYMBOL(vpfe_register_ccdc_device);
*/
void vpfe_unregister_ccdc_device(struct ccdc_hw_device *dev)
{
- if (NULL == dev) {
+ if (!dev) {
printk(KERN_ERR "invalid ccdc device ptr\n");
return;
}
@@ -469,7 +469,7 @@ static int vpfe_initialize_device(struct vpfe_device *vpfe_dev)
/* now open the ccdc device to initialize it */
mutex_lock(&ccdc_lock);
- if (NULL == ccdc_dev) {
+ if (!ccdc_dev) {
v4l2_err(&vpfe_dev->v4l2_dev, "ccdc device not registered\n");
ret = -ENODEV;
goto unlock;
@@ -582,7 +582,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
goto clear_intr;
/* only for 6446 this will be applicable */
- if (NULL != ccdc_dev->hw_ops.reset)
+ if (ccdc_dev->hw_ops.reset)
ccdc_dev->hw_ops.reset();
if (field == V4L2_FIELD_NONE) {
@@ -822,7 +822,7 @@ static const struct vpfe_pixel_format *
int temp, found;
vpfe_pix_fmt = vpfe_lookup_pix_format(pixfmt->pixelformat);
- if (NULL == vpfe_pix_fmt) {
+ if (!vpfe_pix_fmt) {
/*
* use current pixel format in the vpfe device. We
* will find this pix format in the table
@@ -965,7 +965,7 @@ static int vpfe_enum_fmt_vid_cap(struct file *file, void *priv,
/* Fill in the information about format */
pix_fmt = vpfe_lookup_pix_format(pix);
- if (NULL != pix_fmt) {
+ if (pix_fmt) {
temp_index = fmt->index;
*fmt = pix_fmt->fmtdesc;
fmt->index = temp_index;
@@ -991,8 +991,7 @@ static int vpfe_s_fmt_vid_cap(struct file *file, void *priv,
/* Check for valid frame format */
pix_fmts = vpfe_check_format(vpfe_dev, &fmt->fmt.pix);
-
- if (NULL == pix_fmts)
+ if (!pix_fmts)
return -EINVAL;
/* store the pixel format in the device object */
@@ -1018,7 +1017,7 @@ static int vpfe_try_fmt_vid_cap(struct file *file, void *priv,
v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_try_fmt_vid_cap\n");
pix_fmts = vpfe_check_format(vpfe_dev, &f->fmt.pix);
- if (NULL == pix_fmts)
+ if (!pix_fmts)
return -EINVAL;
return 0;
}
@@ -1833,7 +1832,7 @@ static int vpfe_probe(struct platform_device *pdev)
vpfe_dev->pdev = &pdev->dev;
- if (NULL == pdev->dev.platform_data) {
+ if (!pdev->dev.platform_data) {
v4l2_err(pdev->dev.driver, "Unable to get vpfe config\n");
ret = -ENODEV;
goto probe_free_dev_mem;
@@ -1841,9 +1840,7 @@ static int vpfe_probe(struct platform_device *pdev)
vpfe_cfg = pdev->dev.platform_data;
vpfe_dev->cfg = vpfe_cfg;
- if (NULL == vpfe_cfg->ccdc ||
- NULL == vpfe_cfg->card_name ||
- NULL == vpfe_cfg->sub_devs) {
+ if (!vpfe_cfg->ccdc || !vpfe_cfg->card_name || !vpfe_cfg->sub_devs) {
v4l2_err(pdev->dev.driver, "null ptr in vpfe_cfg\n");
ret = -ENOENT;
goto probe_free_dev_mem;
@@ -1938,7 +1935,7 @@ static int vpfe_probe(struct platform_device *pdev)
vpfe_dev->sd = kmalloc_array(num_subdevs,
sizeof(*vpfe_dev->sd),
GFP_KERNEL);
- if (NULL == vpfe_dev->sd) {
+ if (!vpfe_dev->sd) {
ret = -ENOMEM;
goto probe_out_video_unregister;
}
--
2.10.1
next prev parent reply other threads:[~2016-10-12 14:58 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-12 14:26 [PATCH 00/34] [media] DaVinci-Video Processing: Fine-tuning for several function implementations SF Markus Elfring
2016-10-12 14:29 ` [PATCH 01/34] [media] DaVinci-VPBE: Use kmalloc_array() in vpbe_initialize() SF Markus Elfring
2016-10-12 14:30 ` [PATCH 02/34] [media] DaVinci-VPBE: Delete two error messages for a failed memory allocation SF Markus Elfring
2016-10-12 14:34 ` [PATCH 04/34] [media] DaVinci-VPBE: Combine substrings for four messages SF Markus Elfring
2016-10-12 14:35 ` [PATCH 05/34] [media] DaVinci-VPBE: Return an error code only as a constant in vpbe_probe() SF Markus Elfring
2016-10-12 14:40 ` [PATCH 06/34] [media] DaVinci-VPBE: Return an error code only by a single variable in vpbe_initialize() SF Markus Elfring
2016-11-16 14:30 ` Mauro Carvalho Chehab
2016-10-12 14:42 ` [PATCH 07/34] [media] DaVinci-VPBE: Delete an unnecessary variable initialisation " SF Markus Elfring
2016-11-16 14:35 ` Mauro Carvalho Chehab
2016-10-12 14:43 ` [PATCH 08/34] [media] DaVinci-VPBE: Return the success indication only as a constant in vpbe_set_mode() SF Markus Elfring
2016-10-12 14:44 ` [PATCH 09/34] [media] DaVinci-VPBE: Reduce the scope for a variable in vpbe_set_default_output() SF Markus Elfring
2016-10-12 14:47 ` [PATCH 10/34] [media] DaVinci-VPBE: Check return value of a setup_if_config() call in vpbe_set_output() SF Markus Elfring
2016-11-03 12:20 ` Hans Verkuil
2016-11-03 20:54 ` SF Markus Elfring
2016-11-04 8:06 ` Hans Verkuil
2016-11-06 20:00 ` [PATCH v2 " SF Markus Elfring
2016-10-12 14:48 ` [PATCH 11/34] [media] DaVinci-VPBE: Rename a jump label " SF Markus Elfring
2016-10-12 14:50 ` [PATCH 12/34] [media] DaVinci-VPBE: Delete an unnecessary variable initialisation " SF Markus Elfring
2016-10-12 14:51 ` [PATCH 13/34] [media] DaVinci-VPFE-Capture: Use kmalloc_array() in vpfe_probe() SF Markus Elfring
2016-10-12 14:52 ` [PATCH 14/34] [media] DaVinci-VPFE-Capture: Delete three error messages for a failed memory allocation SF Markus Elfring
2016-10-12 14:53 ` [PATCH 15/34] [media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_probe() SF Markus Elfring
2016-10-12 14:54 ` [PATCH 16/34] [media] DaVinci-VPFE-Capture: Delete an unnecessary variable initialisation " SF Markus Elfring
2016-10-12 14:55 ` [PATCH 17/34] [media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_enum_input() SF Markus Elfring
2016-11-03 12:22 ` Hans Verkuil
2016-11-03 21:05 ` SF Markus Elfring
2016-11-04 8:06 ` Hans Verkuil
2016-11-06 21:00 ` [PATCH v2 17/34] [media] DaVinci-VPFE-Capture: Replace a memcpy() call by an assignment " SF Markus Elfring
2016-10-12 14:56 ` [PATCH 18/34] [media] DaVinci-VPFE-Capture: Combine substrings for an error message " SF Markus Elfring
2016-10-12 14:57 ` [PATCH 19/34] [media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_open() SF Markus Elfring
2016-10-12 14:58 ` SF Markus Elfring [this message]
2016-10-12 14:59 ` [PATCH 21/34] [media] DaVinci-VPFE-Capture: Delete an unnecessary variable initialisation in 11 functions SF Markus Elfring
2016-10-12 15:00 ` [PATCH 22/34] [media] DaVinci-VPFE-Capture: Move two assignments in vpfe_s_input() SF Markus Elfring
2016-10-12 15:01 ` [PATCH 23/34] [media] DaVinci-VPFE-Capture: Delete unnecessary braces in vpfe_isr() SF Markus Elfring
2016-10-12 15:02 ` [PATCH 24/34] [media] DaVinci-VPFE-Capture: Delete an unnecessary return statement in vpfe_unregister_ccdc_device() SF Markus Elfring
2016-10-12 15:03 ` [PATCH 25/34] [media] DaVinci-VPIF-Capture: Use kcalloc() in vpif_probe() SF Markus Elfring
2016-10-12 15:04 ` [PATCH 26/34] [media] DaVinci-VPIF-Capture: Delete an error message for a failed memory allocation SF Markus Elfring
2016-10-12 15:07 ` [PATCH 28/34] [media] DaVinci-VPIF-Capture: Delete an unnecessary variable initialisation in vpif_querystd() SF Markus Elfring
2016-10-12 15:08 ` [PATCH 29/34] [media] DaVinci-VPIF-Capture: Delete an unnecessary variable initialisation in vpif_channel_isr() SF Markus Elfring
2016-10-12 15:10 ` [PATCH 30/34] [media] DaVinci-VPIF-Display: Use kcalloc() in vpif_probe() SF Markus Elfring
2016-10-12 15:12 ` [PATCH 31/34] [media] DaVinci-VPIF-Display: Delete an error message for a failed memory allocation SF Markus Elfring
2016-10-12 15:13 ` [PATCH 32/34] [media] DaVinci-VPIF-Display: Adjust 11 checks for null pointers SF Markus Elfring
2016-10-12 15:14 ` [PATCH 33/34] [media] DaVinci-VPIF-Display: Delete an unnecessary variable initialisation in vpif_channel_isr() SF Markus Elfring
2016-10-12 15:15 ` [PATCH 34/34] [media] DaVinci-VPIF-Display: Delete an unnecessary variable initialisation in process_progressive_mode() SF Markus Elfring
[not found] ` <fdf72877-08a9-1a86-aec8-627a378258da@users.sourceforge.net>
2016-10-12 17:15 ` [PATCH resent 03/34] [media] DaVinci-VPBE: Adjust 16 checks for null pointers SF Markus Elfring
[not found] ` <73a8bc6c-3dc5-c152-7b59-fd1a5e84f61c@users.sourceforge.net>
2016-10-12 17:16 ` [PATCH resent 27/34] [media] DaVinci-VPIF-Capture: Adjust ten " SF Markus Elfring
2016-10-23 17:26 ` [PATCH 00/34] [media] DaVinci-Video Processing: Fine-tuning for several function implementations Lad, Prabhakar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=111cbf0f-7fe6-63e7-6577-0724f3789226@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=hans.verkuil@cisco.com \
--cc=julia.lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=prabhakar.csengg@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).