Skip to contentSkip to conversation

ahci: fix ICC mask definition

PATCH In review John Snow 2 participants 3 messages Jul 21, 2015 – Jul 30, 2015

lore
Share & tools
lore

John Snow

author
#0 lore raw

PATCH 1/1 ahci: fix ICC mask definition

There are likely others that could be updated, but we'll go with a light touch for 2.4 for now.

Without the Unsigned specifier, this shifts bits into the signed bit, which makes clang unhappy and could cause unwanted behavior.

---
 hw/ide/ahci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ide/ahci.h +1 -1
index 68d5074..79a463d 100644
@@ -127,7 +127,7 @@
 #define PORT_CMD_SPIN_UP          (1 << 1) /* Spin up device */
 #define PORT_CMD_START            (1 << 0) /* Enable port DMA engine */
 
-#define PORT_CMD_ICC_MASK         (0xf << 28) /* i/f ICC state mask */
+#define PORT_CMD_ICC_MASK        (0xfU << 28) /* i/f ICC state mask */
 #define PORT_CMD_ICC_ACTIVE       (0x1 << 28) /* Put i/f in active state */
 #define PORT_CMD_ICC_PARTIAL      (0x2 << 28) /* Put i/f in partial state */
 #define PORT_CMD_ICC_SLUMBER      (0x6 << 28) /* Put i/f in slumber state */
Signature · 1 line
2.1.0
author
#1 lore raw

Peter: I assume you still want this for 2.4 to fix the clang warnings, yes?

Quoted 27 lines · John Snow

There are likely others that could be updated, but we'll go with a light touch for 2.4 for now.

Without the Unsigned specifier, this shifts bits into the signed bit, which makes clang unhappy and could cause unwanted behavior.

---
 hw/ide/ahci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ide/ahci.h +1 -1
index 68d5074..79a463d 100644
@@ -127,7 +127,7 @@
 #define PORT_CMD_SPIN_UP          (1 << 1) /* Spin up device */
 #define PORT_CMD_START            (1 << 0) /* Enable port DMA engine */
 
-#define PORT_CMD_ICC_MASK         (0xf << 28) /* i/f ICC state mask */
+#define PORT_CMD_ICC_MASK        (0xfU << 28) /* i/f ICC state mask */
 #define PORT_CMD_ICC_ACTIVE       (0x1 << 28) /* Put i/f in active state */
 #define PORT_CMD_ICC_PARTIAL      (0x2 << 28) /* Put i/f in partial state */
 #define PORT_CMD_ICC_SLUMBER      (0x6 << 28) /* Put i/f in slumber state */
#2 lore raw
Quoted 1 line · John Snow

Peter: I assume you still want this for 2.4 to fix the clang warnings, yes?

Yeah, it's safe enough. (I don't actually require these clang warnings all fixed for 2.4; but it's a nice-to-have.)

thanks
-- PMM