Re: [PATCH 1/4] mtd: fix erasesize math for non power-of-2 devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Darren Garnier <dgarnier@xxxxxxxxxxx> writes:

> Signed-off-by: Darren Garnier <dgarnier@xxxxxxxxxxx>

Hi Darren,

First of all, do any device exist where erasesize is non power-of-2, and if so
which one do you have in mind ?

Secondly, if such devices exist, I'd wish to have that explained in the commit
message, to know what motivated your patch.

> +#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)
These lines look a bit over 80 caracters to me, or is it my editor ...
Moreover the (bs & (bs-1)) == 0 should be replaced by IS_ALIGNED(bs).

Cheers.

--
Robert

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




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux