Skip to content
Snippets Groups Projects
Commit 6b8f185f authored by Wu, Josh's avatar Wu, Josh Committed by Tom Rini
Browse files

fs: fat: don't call disk_write with zero sector num


In the set_cluster() function, it will convert the buffer size to sector
numbers. Then call disk_write() to write by sector.
For remaining buffer, the size is less than a sector, call disk_write()
again to write them in one sector.

But if the total buffer size is less then one sector, the original code
will call disk_write() with zero sector number. It is unnecessary.
So this patch fix this. Now it will not call disk_write() if total buffer size
is less than one sector.

Signed-off-by: default avatarJosh Wu <josh.wu@atmel.com>
parent 7ea50d52
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment