Re: [PATCH 5/8] mtd: mtdraw: add raw page size to private data

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

 



On Fri, Sep 21, 2018 at 04:42:40PM +0200, Sam Ravnborg wrote:
> Hi Sascha.
> 
> On Fri, Sep 21, 2018 at 01:18:17PM +0200, Sascha Hauer wrote:
> > The raw page size is used many times in the driver, so add a variable
> > to the private data instead of calculating it each time again.
> > 
> > Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
> > ---
> >  drivers/mtd/mtdraw.c | 40 ++++++++++++++++++++--------------------
> >  1 file changed, 20 insertions(+), 20 deletions(-)
> > 
> > diff --git a/drivers/mtd/mtdraw.c b/drivers/mtd/mtdraw.c
> > index 089dc54eb4..6518ae34d5 100644
> > --- a/drivers/mtd/mtdraw.c
> > +++ b/drivers/mtd/mtdraw.c
> > @@ -48,6 +48,7 @@
> >   * @write_fill: number of bytes in writebuf
> >   * @write_ofs: offset in character device (mtdraw) where last write(s) stored
> >   * bytes because of unaligned writes (ie. remain of writesize+oobsize write)
> > + * @rps: raw page size (data + oob)
> From the code I would say that a (writesize + oobsize) was more correct.
> Like we use in the line above too.
> 
> > @@ -131,12 +132,11 @@ static ssize_t mtdraw_read(struct cdev *cdev, void *buf, size_t count,
> >  	int skip;
> >  
> >  	numblock = mtdraw_offset_to_block(mtdraw, offset);
> > -	skip = offset - numblock * (mtd->writesize + mtd->oobsize);
> > +	skip = offset - numblock * (mtdraw->rps);
> 
> Here the () can be dropped.

Ok, fixed. Thanks

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