mirror of
https://gitee.com/openharmony/kernel_linux
synced 2025-02-21 20:23:48 +00:00
[MTD] Use SEEK_{SET,CUR,END} instead of hardcoded values in mtdchar lseek()
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
This commit is contained in:
parent
de591dacf3
commit
ea59830db0
@ -62,15 +62,12 @@ static loff_t mtd_lseek (struct file *file, loff_t offset, int orig)
|
||||
struct mtd_info *mtd = mfi->mtd;
|
||||
|
||||
switch (orig) {
|
||||
case 0:
|
||||
/* SEEK_SET */
|
||||
case SEEK_SET:
|
||||
break;
|
||||
case 1:
|
||||
/* SEEK_CUR */
|
||||
case SEEK_CUR:
|
||||
offset += file->f_pos;
|
||||
break;
|
||||
case 2:
|
||||
/* SEEK_END */
|
||||
case SEEK_END:
|
||||
offset += mtd->size;
|
||||
break;
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user