From: Sascha Hauer <s.hauer@pengutronix.de>
To: Oleksij Rempel <linux@rempel-privat.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/2] cfi_flash: size_ratio should not be 0
Date: Mon, 27 May 2013 10:30:20 +0200 [thread overview]
Message-ID: <20130527083020.GZ20989@pengutronix.de> (raw)
In-Reply-To: <1369209220-14529-3-git-send-email-linux@rempel-privat.de>
On Wed, May 22, 2013 at 09:53:40AM +0200, Oleksij Rempel wrote:
> We will get size = 0 if size_ratio = 0
>
> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Applied, thanks
Sascha
> ---
> drivers/mtd/nor/cfi_flash.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nor/cfi_flash.c b/drivers/mtd/nor/cfi_flash.c
> index 4b4e29d..85e96ce 100644
> --- a/drivers/mtd/nor/cfi_flash.c
> +++ b/drivers/mtd/nor/cfi_flash.c
> @@ -371,7 +371,8 @@ static ulong flash_get_size (struct flash_info *info)
> size_ratio = info->portwidth / info->chipwidth;
> /* if the chip is x8/x16 reduce the ratio by half */
> if ((info->interface == FLASH_CFI_X8X16)
> - && (info->chipwidth == FLASH_CFI_BY8)) {
> + && (info->chipwidth == FLASH_CFI_BY8)
> + && (size_ratio != 1)) {
> size_ratio >>= 1;
> }
> debug ("size_ratio %d port %d bits chip %d bits\n",
> --
> 1.8.1.2
>
>
> _______________________________________________
> 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
prev parent reply other threads:[~2013-05-27 8:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-22 7:53 [PATCH 0/2] cfi fixes Oleksij Rempel
2013-05-22 7:53 ` [PATCH 1/2 v2] cfi_flash: add shift option for some cfi memory chips Oleksij Rempel
2013-05-23 13:13 ` Sascha Hauer
2013-05-22 7:53 ` [PATCH 2/2] cfi_flash: size_ratio should not be 0 Oleksij Rempel
2013-05-23 13:13 ` Sascha Hauer
2013-05-23 13:37 ` Oleksij Rempel
2013-05-27 8:30 ` Sascha Hauer [this message]
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=20130527083020.GZ20989@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=linux@rempel-privat.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