From: Michal Orzel Date: Sat, 23 Apr 2022 11:38:08 +0000 (+0200) Subject: block/blk-map: Remove redundant assignment X-Git-Tag: v6.1-rc5~1167^2~47 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ab89db979017255c2163880de5c63d8c9726aef;p=platform%2Fkernel%2Flinux-starfive.git block/blk-map: Remove redundant assignment Get rid of redundant assignment to a variable ret from function bio_map_user_iov as it is being assigned a value that is never read. It is being re-assigned in the first instruction after the while loop Reported by clang-tidy [deadcode.DeadStores] Signed-off-by: Michal Orzel Link: https://lore.kernel.org/r/20220423113811.13335-2-michalorzel.eng@gmail.com Signed-off-by: Jens Axboe --- diff --git a/block/blk-map.c b/block/blk-map.c index 7ffde64..df8b066 100644 --- a/block/blk-map.c +++ b/block/blk-map.c @@ -262,10 +262,9 @@ static int bio_map_user_iov(struct request *rq, struct iov_iter *iter, npages = DIV_ROUND_UP(offs + bytes, PAGE_SIZE); - if (unlikely(offs & queue_dma_alignment(rq->q))) { - ret = -EINVAL; + if (unlikely(offs & queue_dma_alignment(rq->q))) j = 0; - } else { + else { for (j = 0; j < npages; j++) { struct page *page = pages[j]; unsigned int n = PAGE_SIZE - offs;