diff mbox series

aoe: remove redundant assignment on variable n

Message ID 20220113000545.1307091-1-colin.i.king@gmail.com (mailing list archive)
State New, archived
Headers show
Series aoe: remove redundant assignment on variable n | expand

Commit Message

Colin Ian King Jan. 13, 2022, 12:05 a.m. UTC
The variable n is being bit-wise or'd with a value and reassigned
before being returned. The update of n is redundant, replace
the |= operator with | instead. Cleans up clang scan warning:

drivers/block/aoe/aoecmd.c:125:9: warning: Although the value stored
to 'n' is used in the enclosing expression, the value is never
actually read from 'n' [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/block/aoe/aoecmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jens Axboe Jan. 13, 2022, 8 p.m. UTC | #1
On Thu, 13 Jan 2022 00:05:45 +0000, Colin Ian King wrote:
> The variable n is being bit-wise or'd with a value and reassigned
> before being returned. The update of n is redundant, replace
> the |= operator with | instead. Cleans up clang scan warning:
> 
> drivers/block/aoe/aoecmd.c:125:9: warning: Although the value stored
> to 'n' is used in the enclosing expression, the value is never
> actually read from 'n' [deadcode.DeadStores]
> 
> [...]

Applied, thanks!

[1/1] aoe: remove redundant assignment on variable n
      commit: a6431e351c6ec5bb6800787d259b343088f369a3

Best regards,
diff mbox series

Patch

diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 588889bea7c3..6af111f568e4 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -122,7 +122,7 @@  newtag(struct aoedev *d)
 	register ulong n;
 
 	n = jiffies & 0xffff;
-	return n |= (++d->lasttag & 0x7fff) << 16;
+	return n | (++d->lasttag & 0x7fff) << 16;
 }
 
 static u32