irqchip: gicv3-its: Fix device ID encoding
authorAndre Przywara <[email protected]>
Fri, 27 Mar 2015 14:15:03 +0000 (14:15 +0000)
committerJason Cooper <[email protected]>
Sun, 29 Mar 2015 19:25:49 +0000 (19:25 +0000)
When building ITS commands which have the device ID in it, we
should mask off the whole upper 32 bits of the first command word
before inserting the new value in there.

Signed-off-by: Andre Przywara <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Jason Cooper <[email protected]>
drivers/irqchip/irq-gic-v3-its.c

index 7318dba11957d7c8790a46ec47bc82cbb5fdebf3..fa0c43660c8b5a6486ead4d5f487a67f6e430e7e 100644 (file)
@@ -169,7 +169,7 @@ static void its_encode_cmd(struct its_cmd_block *cmd, u8 cmd_nr)
 
 static void its_encode_devid(struct its_cmd_block *cmd, u32 devid)
 {
-       cmd->raw_cmd[0] &= ~(0xffffUL << 32);
+       cmd->raw_cmd[0] &= BIT_ULL(32) - 1;
        cmd->raw_cmd[0] |= ((u64)devid) << 32;
 }