Skip to contentSkip to conversation

cxl: Fix double shift of CXL_FW_CANCEL

PATCH In review Davidlohr Bueso 3 participants 4 messages Jul 12, 2023 CXL

lore
Share & tools
lore

Davidlohr Bueso

author maintainer
#0 lore raw

PATCH 1/1 cxl: Fix double shift of CXL_FW_CANCEL

Directly use the bit number for bitops, which already has a shift built in. This bug is benign as its done consistently and it doesn't clash with any other flags.

Fixes 9521875bbe00 ("cxl: add a firmware update mechanism using the sysfs firmware loader")
---
 drivers/cxl/cxlmem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/cxlmem.h +1 -1
index 79e99c873ca2..499113328586 100644
@@ -323,7 +323,7 @@ struct cxl_mbox_activate_fw {
 
 /* FW state bits */
 #define CXL_FW_STATE_BITS		32
-#define CXL_FW_CANCEL		BIT(0)
+#define CXL_FW_CANCEL			0
 
 /**
  * struct cxl_fw_state - Firmware upload / activation state
Signature · 1 line
2.41.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Davidlohr Bueso

Directly use the bit number for bitops, which already has a shift built in. This bug is benign as its done consistently and it doesn't clash with any other flags.

Ah good catch!

Quoted 3 lines
Fixes 9521875bbe00 ("cxl: add a firmware update mechanism using the sysfs firmware loader")
Quoted 17 lines

---
 drivers/cxl/cxlmem.h | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/cxlmem.h +0 -0
index 79e99c873ca2..499113328586 100644
@@ -323,7 +323,7 @@ struct cxl_mbox_activate_fw {


 /* FW state bits */
 #define CXL_FW_STATE_BITS              32

drivers/cxl/cxlmem.h +1 -1
-#define CXL_FW_CANCEL          BIT(0)
+#define CXL_FW_CANCEL                  0


 /**
  * struct cxl_fw_state - Firmware upload / activation state

author maintainer
#2 lore raw
Quoted 6 lines · Vishal L
Quoted 3 lines · Davidlohr Bueso

Directly use the bit number for bitops, which already has a shift built in. This bug is benign as its done consistently and it doesn't clash with any other flags.

Ah good catch!

Actually this is a duplicate. I just noticed, scrolling the list, that Dan Carpenter has already sent a fix for this. His patch should be picked up. Sorry for the noise.

Thanks,
Davidlohr

maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Davidlohr Bueso
Quoted 6 lines · Davidlohr Bueso

Directly use the bit number for bitops, which already has a shift built in. This bug is benign as its done consistently and it doesn't clash with any other flags.

Fixes 9521875bbe00 ("cxl: add a firmware update mechanism using the sysfs firmware loader")
Quoted 17 lines
---
  drivers/cxl/cxlmem.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/cxlmem.h +1 -1
index 79e99c873ca2..499113328586 100644
@@ -323,7 +323,7 @@ struct cxl_mbox_activate_fw {
 
  /* FW state bits */
  #define CXL_FW_STATE_BITS		32
-#define CXL_FW_CANCEL		BIT(0)
+#define CXL_FW_CANCEL			0
 
  /**
   * struct cxl_fw_state - Firmware upload / activation state