All of lore.kernel.org
 help / color / mirror / Atom feed
From: zhong jiang <zhongjiang@huawei.com>
To: davem@davemloft.net
Cc: benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au,
	linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ide: Use NULL to compare with pointer-typed value rather than 0
Date: Sat, 18 Aug 2018 14:16:17 +0800	[thread overview]
Message-ID: <5B77B9B1.9070203@huawei.com> (raw)
In-Reply-To: <1534512227-39484-1-git-send-email-zhongjiang@huawei.com>

On 2018/8/17 21:23, zhong jiang wrote:
> We should use NULL to compare with pointer-typed value rather than
> 0. The issue is detected with the help of Coccinelle.
>
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
>  drivers/ide/pmac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
> index c5b902b..673734b 100644
> --- a/drivers/ide/pmac.c
> +++ b/drivers/ide/pmac.c
> @@ -1682,7 +1682,7 @@ static int pmac_ide_init_dma(ide_hwif_t *hwif, const struct ide_port_info *d)
>  	/* We won't need pci_dev if we switch to generic consistent
>  	 * DMA routines ...
>  	 */
> -	if (dev == NULL || pmif->dma_regs == 0)
> +	if (dev == NULL || pmif->dma_regs == NULL)
>  		return -ENODEV;
>  	/*
>  	 * Allocate space for the DBDMA commands.
 Maybe if (!dev || !pmif->dma_regs) is better,  Will repost in v2.

Thanks,
zhong jiang

WARNING: multiple messages have this Message-ID (diff)
From: zhong jiang <zhongjiang@huawei.com>
To: <davem@davemloft.net>
Cc: <benh@kernel.crashing.org>, <paulus@samba.org>,
	<mpe@ellerman.id.au>, <linux-ide@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ide: Use NULL to compare with pointer-typed value rather than 0
Date: Sat, 18 Aug 2018 14:16:17 +0800	[thread overview]
Message-ID: <5B77B9B1.9070203@huawei.com> (raw)
In-Reply-To: <1534512227-39484-1-git-send-email-zhongjiang@huawei.com>

On 2018/8/17 21:23, zhong jiang wrote:
> We should use NULL to compare with pointer-typed value rather than
> 0. The issue is detected with the help of Coccinelle.
>
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
>  drivers/ide/pmac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
> index c5b902b..673734b 100644
> --- a/drivers/ide/pmac.c
> +++ b/drivers/ide/pmac.c
> @@ -1682,7 +1682,7 @@ static int pmac_ide_init_dma(ide_hwif_t *hwif, const struct ide_port_info *d)
>  	/* We won't need pci_dev if we switch to generic consistent
>  	 * DMA routines ...
>  	 */
> -	if (dev == NULL || pmif->dma_regs == 0)
> +	if (dev == NULL || pmif->dma_regs == NULL)
>  		return -ENODEV;
>  	/*
>  	 * Allocate space for the DBDMA commands.
 Maybe if (!dev || !pmif->dma_regs) is better,  Will repost in v2.

Thanks,
zhong jiang


  reply	other threads:[~2018-08-18  6:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-17 13:23 [PATCH] ide: Use NULL to compare with pointer-typed value rather than 0 zhong jiang
2018-08-17 13:23 ` zhong jiang
2018-08-18  6:16 ` zhong jiang [this message]
2018-08-18  6:16   ` zhong jiang

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=5B77B9B1.9070203@huawei.com \
    --to=zhongjiang@huawei.com \
    --cc=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.