The two functions blk_find_first and blk_find_next use a for loop with the content being a 'return 0' which means that the 'increment' code is unreachable so remove it and also remove the variable ret which is assigned to but its value is never used.
This issue found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodb...@linaro.org> --- drivers/block/blk-uclass.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c index f3ac8db9464..b38c21ffbe2 100644 --- a/drivers/block/blk-uclass.c +++ b/drivers/block/blk-uclass.c @@ -613,11 +613,8 @@ static int blk_flags_check(struct udevice *dev, enum blk_flag_t req_flags) int blk_find_first(enum blk_flag_t flags, struct udevice **devp) { - int ret; - - for (ret = uclass_find_first_device(UCLASS_BLK, devp); - *devp && !blk_flags_check(*devp, flags); - ret = uclass_find_next_device(devp)) + for (uclass_find_first_device(UCLASS_BLK, devp); + *devp && !blk_flags_check(*devp, flags);) return 0; return -ENODEV; @@ -625,11 +622,8 @@ int blk_find_first(enum blk_flag_t flags, struct udevice **devp) int blk_find_next(enum blk_flag_t flags, struct udevice **devp) { - int ret; - - for (ret = uclass_find_next_device(devp); - *devp && !blk_flags_check(*devp, flags); - ret = uclass_find_next_device(devp)) + for (uclass_find_next_device(devp); + *devp && !blk_flags_check(*devp, flags);) return 0; return -ENODEV; -- 2.39.5