Patchwork [U-Boot,v2,1/2] ubi: Only read the actual size of the VID header

login
register
mail settings
Submitter Joe Hershberger
Date Nov. 5, 2012, 4:46 p.m.
Message ID <1352133991-8712-1-git-send-email-joe.hershberger@ni.com>
Download mbox | patch
Permalink /patch/197223/
State New
Delegated to: Joe Hershberger
Headers show

Comments

Joe Hershberger - Nov. 5, 2012, 4:46 p.m.
If sub-page reads are supported, this will save reading unneeded data

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
---

 drivers/mtd/ubi/io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Stefan Roese - Nov. 6, 2012, 8:19 a.m.
On 11/05/2012 05:46 PM, Joe Hershberger wrote:
> If sub-page reads are supported, this will save reading unneeded data
> 
> Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
> ---
> 
>  drivers/mtd/ubi/io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
> index 8423894..23660e3 100644
> --- a/drivers/mtd/ubi/io.c
> +++ b/drivers/mtd/ubi/io.c
> @@ -916,7 +916,7 @@ int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum,
>  
>  	p = (char *)vid_hdr - ubi->vid_hdr_shift;
>  	err = ubi_io_read(ubi, p, pnum, ubi->vid_hdr_aloffset,
> -			  ubi->vid_hdr_alsize);
> +			  UBI_VID_HDR_SIZE);
>  	if (err) {
>  		if (err != UBI_IO_BITFLIPS && err != -EBADMSG)
>  			return err;

Joe, are you pushing this change to Linux as well? I would really like
to see Artem commenting on this.

Thanks,
Stefan
Joe Hershberger - Nov. 6, 2012, 11:47 p.m.
Hi Stefan,

On Tue, Nov 6, 2012 at 2:19 AM, Stefan Roese <sr@denx.de> wrote:
> On 11/05/2012 05:46 PM, Joe Hershberger wrote:
>> If sub-page reads are supported, this will save reading unneeded data
>>
>> Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
>> ---
>>
>>  drivers/mtd/ubi/io.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
>> index 8423894..23660e3 100644
>> --- a/drivers/mtd/ubi/io.c
>> +++ b/drivers/mtd/ubi/io.c
>> @@ -916,7 +916,7 @@ int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum,
>>
>>       p = (char *)vid_hdr - ubi->vid_hdr_shift;
>>       err = ubi_io_read(ubi, p, pnum, ubi->vid_hdr_aloffset,
>> -                       ubi->vid_hdr_alsize);
>> +                       UBI_VID_HDR_SIZE);
>>       if (err) {
>>               if (err != UBI_IO_BITFLIPS && err != -EBADMSG)
>>                       return err;
>
> Joe, are you pushing this change to Linux as well? I would really like
> to see Artem commenting on this.

Yes.  We will post this to Linux as well.

-Joe

Patch

diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
index 8423894..23660e3 100644
--- a/drivers/mtd/ubi/io.c
+++ b/drivers/mtd/ubi/io.c
@@ -916,7 +916,7 @@  int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum,
 
 	p = (char *)vid_hdr - ubi->vid_hdr_shift;
 	err = ubi_io_read(ubi, p, pnum, ubi->vid_hdr_aloffset,
-			  ubi->vid_hdr_alsize);
+			  UBI_VID_HDR_SIZE);
 	if (err) {
 		if (err != UBI_IO_BITFLIPS && err != -EBADMSG)
 			return err;