MLK-20668-1 fs: fat: fix wrong casting to unsigned value of sect_to_cluster()
After the commit265edc03d5("fs/fat: Clean up open-coded sector <-> cluster conversions"), it is hung up writing new file to FAT16 disk with more than 19 files in armv7. It is because result value of sect_to_cluster() is not proper by casting from signed value to unsigned value. Fix the wrong casting of sect_to_cluster(). Reported-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Reviewed-by: Lukasz Majewski <lukma@denx.de> (cherry picked from commit6e2151c729)
This commit is contained in:
parent
81385a5b07
commit
615283d0eb
|
|
@ -181,7 +181,7 @@ static inline u32 clust_to_sect(fsdata *fsdata, u32 clust)
|
|||
return fsdata->data_begin + clust * fsdata->clust_size;
|
||||
}
|
||||
|
||||
static inline u32 sect_to_clust(fsdata *fsdata, u32 sect)
|
||||
static inline u32 sect_to_clust(fsdata *fsdata, int sect)
|
||||
{
|
||||
return (sect - fsdata->data_begin) / fsdata->clust_size;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue