linux-mips
[Top] [All Lists]

[PATCH 07/11] MIPS: Netlogic: Fix sign extension in PIC write

To: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: [PATCH 07/11] MIPS: Netlogic: Fix sign extension in PIC write
From: "Jayachandran C" <jchandra@broadcom.com>
Date: Mon, 10 Jun 2013 13:11:06 +0530
Cc: "Jayachandran C" <jchandra@broadcom.com>
In-reply-to: <1370850070-5127-1-git-send-email-jchandra@broadcom.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1370850070-5127-1-git-send-email-jchandra@broadcom.com>
Sender: linux-mips-bounce@linux-mips.org
This does not cause a problem yet, but we do not want to write 1
to reserved bits.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
---
 arch/mips/include/asm/netlogic/xlp-hal/pic.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/include/asm/netlogic/xlp-hal/pic.h 
b/arch/mips/include/asm/netlogic/xlp-hal/pic.h
index a981f46..4b5108d 100644
--- a/arch/mips/include/asm/netlogic/xlp-hal/pic.h
+++ b/arch/mips/include/asm/netlogic/xlp-hal/pic.h
@@ -315,7 +315,7 @@ nlm_pic_send_ipi(uint64_t base, int hwt, int irq, int nmi)
 {
        uint64_t ipi;
 
-       ipi = (nmi << 31) | (irq << 20);
+       ipi = ((uint64_t)nmi << 31) | (irq << 20);
        ipi |= ((hwt >> 4) << 16) | (1 << (hwt & 0xf)); /* cpuset and mask */
        nlm_write_pic_reg(base, PIC_IPI_CTL, ipi);
 }
-- 
1.7.9.5



<Prev in Thread] Current Thread [Next in Thread>