Re: [PATCH] v850: Round up length passed to slram driver to a multiple of SLRAM_BLK_SZ

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

 



Miles Bader <[email protected]> wrote:
>
>  +
>  +/* From drivers/mtd/devices/slram.c */
>  +#define SLRAM_BLK_SZ 0x4000
>  +
>   /* Set the root filesystem to be the given memory region.
>      Some parameter may be appended to CMD_LINE.  */
>   void set_mem_root (void *addr, size_t len, char *cmd_line)
>   {
>  +	/* Some sort of idiocy in MTD means we must supply a length that's
>  +	   a multiple of SLRAM_BLK_SZ.  We just round up the real length,
>  +	   as the file system shouldn't attempt to access anything beyond
>  +	   the end of the image anyway.  */
>  +	len = (((len - 1) + SLRAM_BLK_SZ) / SLRAM_BLK_SZ) * SLRAM_BLK_SZ;

If SLRAM_BLK_SZ will always be a power of two, there's kernel.h:ALIGN()..
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux