mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 3/3] nand: mrvl: don't double cast error pointer
Date: Mon, 25 Jul 2016 10:20:59 +0200	[thread overview]
Message-ID: <20160725082059.GX20657@pengutronix.de> (raw)
In-Reply-To: <1469192421-15748-3-git-send-email-l.stach@pengutronix.de>

On Fri, Jul 22, 2016 at 03:00:21PM +0200, Lucas Stach wrote:
> Fixes:
> In function 'alloc_nand_resource':
> warning: return makes pointer from integer without a cast
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/mtd/nand/nand_mrvl_nfc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/nand_mrvl_nfc.c b/drivers/mtd/nand/nand_mrvl_nfc.c
> index 578790da2612..1341f084d8f8 100644
> --- a/drivers/mtd/nand/nand_mrvl_nfc.c
> +++ b/drivers/mtd/nand/nand_mrvl_nfc.c
> @@ -1138,7 +1138,7 @@ static struct mrvl_nand_host *alloc_nand_resource(struct device_d *dev)
>  	host->dev = dev;
>  	iores = dev_request_mem_resource(dev, 0);
>  	if (IS_ERR(iores))
> -		return PTR_ERR(iores);
> +		return iores;

Better use ERR_CAST() here. It makes it more explicit that an error is
returned here.

Sascha

>  	host->mmio_base = IOMEM(iores->start);
>  	if (IS_ERR(host->mmio_base)) {
>  		free(host);
> -- 
> 2.8.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2016-07-25  8:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-22 13:00 [PATCH 1/3] state: only build circular backend if MTD is enabled Lucas Stach
2016-07-22 13:00 ` [PATCH 2/3] commands: fbtest: select IMAGE_RENDERER Lucas Stach
2016-07-22 13:00 ` [PATCH 3/3] nand: mrvl: don't double cast error pointer Lucas Stach
2016-07-25  8:20   ` Sascha Hauer [this message]
2016-07-25  8:27     ` Sascha Hauer

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=20160725082059.GX20657@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=l.stach@pengutronix.de \
    /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