mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Adrian Remonda <adrianremonda@gmail.com>
Cc: devel@driverdev.osuosl.org, christian.gromm@microchip.com,
	linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org
Subject: Re: [PATCHv5 2/5] Staging: most: mostcore/core.c. Fix "Using plain integer as NULL pointer" warnings
Date: Wed, 5 Aug 2015 10:56:30 +0530	[thread overview]
Message-ID: <20150805052630.GB4958@sudip-pc> (raw)
In-Reply-To: <1438713895-5961-3-git-send-email-adrianremonda@gmail.com>

On Tue, Aug 04, 2015 at 08:44:52PM +0200, Adrian Remonda wrote:
> This patch fixes the warning generated by sparse: "Using plain integer
> as NULL pointer" by replacing the offending 0 with NULL.
> 
> Signed-off-by: Adrian Remonda <adrianremonda@gmail.com>
> ---
>  drivers/staging/most/mostcore/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c
> index b8871364169c..383e06968b41 100644
> --- a/drivers/staging/most/mostcore/core.c
> +++ b/drivers/staging/most/mostcore/core.c
> @@ -982,7 +982,7 @@ static ssize_t store_add_link(struct most_aim_obj *aim_obj,
>  	if (ret)
>  		return ret;
>  
> -	if (mdev_devnod == 0 || *mdev_devnod == 0) {
> +	if (mdev_devnod == NULL || *mdev_devnod == 0) {
Usually we write the NULL test as:
if (!mdev_devnod || *mdev_devnod == 0)

regards
sudip

  parent reply	other threads:[~2015-08-05  5:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04 18:44 [PATCHv5 0/5] Staging: most: several warnings fix reported by sparse Adrian Remonda
2015-08-04 18:44 ` [PATCHv5 1/5] Staging: most: mostcore/core.c. Fix "missing static keyword" warnings Adrian Remonda
2015-08-04 18:44   ` [PATCHv5 2/5] Staging: most: mostcore/core.c. Fix "Using plain integer as NULL pointer" warnings Adrian Remonda
2015-08-04 18:44     ` [PATCHv5 3/5] Staging: most: hdm-usb/hdm_usb.c. Fix "missing static keyword" warnings Adrian Remonda
2015-08-04 18:44       ` [PATCHv5 4/5] Staging: most: hdm-dim2/dim2_hal.c. Fix "Using plain integer as NULL pointer" warnings Adrian Remonda
2015-08-04 18:44         ` [PATCHv5 5/5] Staging: most: aim-cdev/cdev.c. Fix "missing static keyword" warnings Adrian Remonda
2015-08-05 20:04       ` [PATCHv5 3/5] Staging: most: hdm-usb/hdm_usb.c. " Christian Gromm
2015-08-05  5:26     ` Sudip Mukherjee [this message]
2015-08-05  5:24   ` [PATCHv5 1/5] Staging: most: mostcore/core.c. " Sudip Mukherjee

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=20150805052630.GB4958@sudip-pc \
    --to=sudipm.mukherjee@gmail.com \
    --cc=adrianremonda@gmail.com \
    --cc=christian.gromm@microchip.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®