提交 ea59830d 编写于 作者: J Josef 'Jeff' Sipek 提交者: David Woodhouse

[MTD] Use SEEK_{SET,CUR,END} instead of hardcoded values in mtdchar lseek()

Signed-off-by: NJosef 'Jeff' Sipek <jeffpc@josefsipek.net>
Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
上级 de591dac
...@@ -62,15 +62,12 @@ static loff_t mtd_lseek (struct file *file, loff_t offset, int orig) ...@@ -62,15 +62,12 @@ static loff_t mtd_lseek (struct file *file, loff_t offset, int orig)
struct mtd_info *mtd = mfi->mtd; struct mtd_info *mtd = mfi->mtd;
switch (orig) { switch (orig) {
case 0: case SEEK_SET:
/* SEEK_SET */
break; break;
case 1: case SEEK_CUR:
/* SEEK_CUR */
offset += file->f_pos; offset += file->f_pos;
break; break;
case 2: case SEEK_END:
/* SEEK_END */
offset += mtd->size; offset += mtd->size;
break; break;
default: default:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册