From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org,
Brian Norris <computersforpeace@gmail.com>,
Kamal Dasu <kdasu.kdev@gmail.com>,
Richard Weinberger <richard@nod.at>,
David Woodhouse <dwmw2@infradead.org>,
Marek Vasut <marek.vasut@gmail.com>,
Vignesh Raghavendra <vigneshr@ti.com>,
linux-mtd@lists.infradead.org (open list:BROADCOM STB NAND FLASH
DRIVER),
bcm-kernel-feedback-list@broadcom.com (open list:BROADCOM STB
NAND FLASH DRIVER), linux-kernel@vger.kernel.org (open list)
Subject: Re: [PATCH] mtd: rawnand: brcmnand: Fix sparse warning in has_flash_dma()
Date: Sat, 19 Oct 2019 11:39:00 +0200 [thread overview]
Message-ID: <20191019113824.15fa4f52@xps13> (raw)
In-Reply-To: <20191018233844.23838-1-f.fainelli@gmail.com>
Hi Florian,
Florian Fainelli <f.fainelli@gmail.com> wrote on Fri, 18 Oct 2019
16:38:44 -0700:
> Sparse rightfully complained about has_flash_dma():
> +drivers/mtd/nand/brcmnand/brcmnand.c:951:40: warning: Using plain integer as NULL pointer [sparse]
I don't get why would sparse complain about this... Anyway I prefer
the !!(<pointer>) alternative if you don't mind. Otherwise the "!=
NULL" comparison feels wrong.
>
> Fixes: 27c5b17cd1b1 ("mtd: nand: add NAND driver "library" for Broadcom STB NAND controller")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> drivers/mtd/nand/raw/brcmnand/brcmnand.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
> index 15ef30b368a5..73f7a0945399 100644
> --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
> +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
> @@ -909,7 +909,7 @@ static inline void brcmnand_set_wp(struct brcmnand_controller *ctrl, bool en)
>
> static inline bool has_flash_dma(struct brcmnand_controller *ctrl)
> {
> - return ctrl->flash_dma_base;
> + return ctrl->flash_dma_base != NULL;
> }
>
> static inline void disable_ctrl_irqs(struct brcmnand_controller *ctrl)
Thanks,
Miquèl
next prev parent reply other threads:[~2019-10-19 9:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-18 23:38 [PATCH] mtd: rawnand: brcmnand: Fix sparse warning in has_flash_dma() Florian Fainelli
2019-10-19 9:39 ` Miquel Raynal [this message]
2019-10-21 16:41 ` Florian Fainelli
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=20191019113824.15fa4f52@xps13 \
--to=miquel.raynal@bootlin.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=f.fainelli@gmail.com \
--cc=kdasu.kdev@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=richard@nod.at \
--cc=vigneshr@ti.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).