Skip to content

Commit 67efb77

Browse files
ColinIanKingrichardweinberger
authored andcommitted
mtd: ubi: remove redundant check on bytes_left at end of function
In function ubi_nvmem_reg_read the while-loop can only be exiting of bytes_left is zero or an error has occurred. There is an exit return path if an error occurs, so the bytes_left can only be zero after that point. Hence the check for a non-zero bytes_left at the end of the function is redundant and can be removed. Remove the check and just return 0. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent 0759329 commit 67efb77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mtd/ubi/nvmem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static int ubi_nvmem_reg_read(void *priv, unsigned int from,
5555
if (err)
5656
return err;
5757

58-
return bytes_left == 0 ? 0 : -EIO;
58+
return 0;
5959
}
6060

6161
static int ubi_nvmem_add(struct ubi_volume_info *vi)

0 commit comments

Comments
 (0)