Skip to content

Commit

Permalink
xen-blkback: remove redundant assignment to variable i
Browse files Browse the repository at this point in the history
Variable i is being assigned a value that is never read, it is being
re-assigned later in a for-loop. The assignment is redundant and can
be removed.

Cleans up clang scan build warning:
drivers/block/xen-blkback/blkback.c:934:14: warning: Although the value
stored to 'i' is used in the enclosing expression, the value is never
actually read from 'i' [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20220317234646.78158-1-colin.i.king@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Colin Ian King authored and Jens Axboe committed Mar 21, 2022
1 parent ae53aea commit 93b4e74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/xen-blkback/blkback.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ static int xen_blkbk_parse_indirect(struct blkif_request *req,
if (rc)
goto unmap;

for (n = 0, i = 0; n < nseg; n++) {
for (n = 0; n < nseg; n++) {
uint8_t first_sect, last_sect;

if ((n % SEGS_PER_INDIRECT_FRAME) == 0) {
Expand Down

0 comments on commit 93b4e74

Please sign in to comment.