All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Darren Garnier <dgarnier@reinrag.net>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/4] mtd: fix erasesize math for non power-of-2 devices
Date: Tue, 3 Sep 2013 20:16:49 +0200	[thread overview]
Message-ID: <20130903181649.GD30088@pengutronix.de> (raw)
In-Reply-To: <32D9025B-5882-4030-A3DA-0CC66CEBD93C@reinrag.net>

Hi Darren,

On Mon, Sep 02, 2013 at 10:22:20PM -0400, Darren Garnier wrote:
> 
> +#define ALIGNED_OFFSET(offset, bs) ((bs & (bs-1)) == 0) ? \
> +									offset & ~(bs-1) : \
> +									bs * div_u64(offset,bs)
> +#define ALIGNED_COUNT(count, bs) ((bs & (bs-1)) == 0) ? \
> +									ALIGN(count,bs) : \
> +									bs * div_u64(count+(bs-1),bs)

Can you convert this into a function? It makes it easier and to read and
more obvious what's happening here. Please use the is_power_of_2 macro
and add whitespaces left and right to operators.

Otherwise looks good. I didn't know such flashes exist...

Sascha

-- 
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

      parent reply	other threads:[~2013-09-03 18:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03  2:22 [PATCH 1/4] mtd: fix erasesize math for non power-of-2 devices Darren Garnier
2013-09-03 18:04 ` Robert Jarzmik
2013-09-04  6:24   ` Sascha Hauer
2013-09-03 18:16 ` 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=20130903181649.GD30088@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=dgarnier@reinrag.net \
    /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.