X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fmtd%2Fmtdchar.c;h=5b6acfcb2b880be00cc77be7abafbf0c71b264da;hb=314dfd7987c71d7ba0c43ac3bf3d243c102ce025;hp=aa18d45b264bb2d3aef9c71792401ac1d7ccece5;hpb=a4cfae13cef6a700a04b13ba1d819c0641b1b26f;p=powerpc.git diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index aa18d45b26..5b6acfcb2b 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c @@ -5,7 +5,6 @@ * */ -#include #include #include #include @@ -63,22 +62,19 @@ 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: return -EINVAL; } - if (offset >= 0 && offset < mtd->size) + if (offset >= 0 && offset <= mtd->size) return file->f_pos = offset; return -EINVAL;