public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] nvmet: remove redundant assignment after left shift
@ 2022-03-18  1:30 Colin Ian King
  2022-03-18 17:40 ` Keith Busch
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Colin Ian King @ 2022-03-18  1:30 UTC (permalink / raw)
  To: Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni, linux-nvme
  Cc: kernel-janitors, linux-kernel, llvm

The left shift is followed by a re-assignment back to cc_css,
the assignment is redundant. Fix this by replacing the <<=
operator with << instead.

Cleans up clang scan build warning:
drivers/nvme/target/core.c:1124:10: warning: Although the value
stored to 'cc_css' is used in the enclosing expression, the
value is never actually read from 'cc_css' [deadcode.DeadStores]

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

diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index 724a6d373340..75876f70a7eb 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -1121,7 +1121,7 @@ static inline u8 nvmet_cc_iocqes(u32 cc)
 
 static inline bool nvmet_css_supported(u8 cc_css)
 {
-	switch (cc_css <<= NVME_CC_CSS_SHIFT) {
+	switch (cc_css << NVME_CC_CSS_SHIFT) {
 	case NVME_CC_CSS_NVM:
 	case NVME_CC_CSS_CSI:
 		return true;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvmet: remove redundant assignment after left shift
  2022-03-18  1:30 [PATCH] nvmet: remove redundant assignment after left shift Colin Ian King
@ 2022-03-18 17:40 ` Keith Busch
  2022-03-20 12:45 ` Sagi Grimberg
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Keith Busch @ 2022-03-18 17:40 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni, linux-nvme,
	kernel-janitors, linux-kernel, llvm

On Fri, Mar 18, 2022 at 01:30:14AM +0000, Colin Ian King wrote:
> The left shift is followed by a re-assignment back to cc_css,
> the assignment is redundant. Fix this by replacing the <<=
> operator with << instead.
> 
> Cleans up clang scan build warning:
> drivers/nvme/target/core.c:1124:10: warning: Although the value
> stored to 'cc_css' is used in the enclosing expression, the
> value is never actually read from 'cc_css' [deadcode.DeadStores]

Looks good.

Reviewed-by: Keith Busch <kbusch@kernel.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvmet: remove redundant assignment after left shift
  2022-03-18  1:30 [PATCH] nvmet: remove redundant assignment after left shift Colin Ian King
  2022-03-18 17:40 ` Keith Busch
@ 2022-03-20 12:45 ` Sagi Grimberg
  2022-03-21  7:17 ` Chaitanya Kulkarni
  2022-03-23  8:20 ` Christoph Hellwig
  3 siblings, 0 replies; 5+ messages in thread
From: Sagi Grimberg @ 2022-03-20 12:45 UTC (permalink / raw)
  To: Colin Ian King, Christoph Hellwig, Chaitanya Kulkarni, linux-nvme
  Cc: kernel-janitors, linux-kernel, llvm

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvmet: remove redundant assignment after left shift
  2022-03-18  1:30 [PATCH] nvmet: remove redundant assignment after left shift Colin Ian King
  2022-03-18 17:40 ` Keith Busch
  2022-03-20 12:45 ` Sagi Grimberg
@ 2022-03-21  7:17 ` Chaitanya Kulkarni
  2022-03-23  8:20 ` Christoph Hellwig
  3 siblings, 0 replies; 5+ messages in thread
From: Chaitanya Kulkarni @ 2022-03-21  7:17 UTC (permalink / raw)
  To: Colin Ian King
  Cc: kernel-janitors@vger.kernel.org, Chaitanya Kulkarni,
	linux-nvme@lists.infradead.org, Christoph Hellwig, Sagi Grimberg,
	linux-kernel@vger.kernel.org, llvm@lists.linux.dev

On 3/17/22 18:30, Colin Ian King wrote:
> The left shift is followed by a re-assignment back to cc_css,
> the assignment is redundant. Fix this by replacing the <<=
> operator with << instead.
> 
> Cleans up clang scan build warning:
> drivers/nvme/target/core.c:1124:10: warning: Although the value
> stored to 'cc_css' is used in the enclosing expression, the
> value is never actually read from 'cc_css' [deadcode.DeadStores]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
>

Thanks, looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvmet: remove redundant assignment after left shift
  2022-03-18  1:30 [PATCH] nvmet: remove redundant assignment after left shift Colin Ian King
                   ` (2 preceding siblings ...)
  2022-03-21  7:17 ` Chaitanya Kulkarni
@ 2022-03-23  8:20 ` Christoph Hellwig
  3 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2022-03-23  8:20 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni, linux-nvme,
	kernel-janitors, linux-kernel, llvm

Thanks,

applied to nvme-5.18.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-03-23  8:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-18  1:30 [PATCH] nvmet: remove redundant assignment after left shift Colin Ian King
2022-03-18 17:40 ` Keith Busch
2022-03-20 12:45 ` Sagi Grimberg
2022-03-21  7:17 ` Chaitanya Kulkarni
2022-03-23  8:20 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox