* [PATCH] xen-blkback: remove redundant assignment to variable i
@ 2022-03-17 23:46 Colin Ian King
2022-03-18 0:25 ` Chaitanya Kulkarni
2022-03-21 10:00 ` Roger Pau Monné
0 siblings, 2 replies; 3+ messages in thread
From: Colin Ian King @ 2022-03-17 23:46 UTC (permalink / raw)
To: Roger Pau Monné, Jens Axboe, xen-devel, linux-block
Cc: kernel-janitors, linux-kernel, llvm
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>
---
drivers/block/xen-blkback/blkback.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index d1e26461a64e..de42458195bc 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -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) {
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] xen-blkback: remove redundant assignment to variable i
2022-03-17 23:46 [PATCH] xen-blkback: remove redundant assignment to variable i Colin Ian King
@ 2022-03-18 0:25 ` Chaitanya Kulkarni
2022-03-21 10:00 ` Roger Pau Monné
1 sibling, 0 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2022-03-18 0:25 UTC (permalink / raw)
To: Colin Ian King, Roger Pau Monné, Jens Axboe,
xen-devel@lists.xenproject.org, linux-block@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev
On 3/17/22 4:46 PM, Colin Ian King wrote:
> 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>
Looks good.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
-ck
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xen-blkback: remove redundant assignment to variable i
2022-03-17 23:46 [PATCH] xen-blkback: remove redundant assignment to variable i Colin Ian King
2022-03-18 0:25 ` Chaitanya Kulkarni
@ 2022-03-21 10:00 ` Roger Pau Monné
1 sibling, 0 replies; 3+ messages in thread
From: Roger Pau Monné @ 2022-03-21 10:00 UTC (permalink / raw)
To: Colin Ian King
Cc: Jens Axboe, xen-devel, linux-block, kernel-janitors, linux-kernel,
llvm
On Thu, Mar 17, 2022 at 11:46:46PM +0000, Colin Ian King wrote:
> 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>
Thanks, Roger.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-21 10:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-17 23:46 [PATCH] xen-blkback: remove redundant assignment to variable i Colin Ian King
2022-03-18 0:25 ` Chaitanya Kulkarni
2022-03-21 10:00 ` Roger Pau Monné
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox