From: Vladimir Zapolskiy <vz@mleia.com>
To: zhong jiang <zhongjiang@huawei.com>, davem@davemloft.net
Cc: slemieux.tyco@gmail.com, keescook@chromium.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] ethernet: lpc_eth: Use NULL to compare with pointer-typed value rather than 0
Date: Fri, 17 Aug 2018 18:29:01 +0300 [thread overview]
Message-ID: <edc2f14f-8694-3160-47b1-ccb5be8a3484@mleia.com> (raw)
In-Reply-To: <1534511933-39236-3-git-send-email-zhongjiang@huawei.com>
Hi zhong jiang,
On 08/17/2018 04:18 PM, 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.
> ---
> drivers/net/ethernet/nxp/lpc_eth.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
> index 08381ef..04d9e62 100644
> --- a/drivers/net/ethernet/nxp/lpc_eth.c
> +++ b/drivers/net/ethernet/nxp/lpc_eth.c
> @@ -1350,7 +1350,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
> "IRAM not big enough for net buffers, using SDRAM instead.\n");
> }
>
> - if (pldat->dma_buff_base_v == 0) {
> + if (pldat->dma_buff_base_v == NULL) {
That's a valid finding, but please use a common 0 and NULL comparison in form of
if (!pldat->dma_buff_base_v)
To the change above please feel free to add my
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
> ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
> if (ret)
> goto err_out_free_irq;
>
next prev parent reply other threads:[~2018-08-17 15:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-17 13:18 [PATCH 0/2] ethernet: " zhong jiang
2018-08-17 13:18 ` [PATCH 1/2] ethernet: declance: " zhong jiang
2018-08-17 13:18 ` [PATCH 2/2] ethernet: lpc_eth: " zhong jiang
2018-08-17 15:29 ` Vladimir Zapolskiy [this message]
2018-08-18 5:59 ` zhong jiang
2018-08-18 6:29 [PATCH 0/2] ethernet: " zhong jiang
2018-08-18 6:29 ` [PATCH 2/2] ethernet: lpc_eth: " 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=edc2f14f-8694-3160-47b1-ccb5be8a3484@mleia.com \
--to=vz@mleia.com \
--cc=davem@davemloft.net \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=slemieux.tyco@gmail.com \
--cc=zhongjiang@huawei.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
all inboxes | Powered by JetHome®