Skip to content

Commit c4597fd

Browse files
Dan Carpenteringomolnar
authored andcommitted
x86/apic/uv: Silence a shift wrapping warning
'm_io' is stored in 6 bits so it's a number in the 0-63 range. Static analysis tools complain that 1 << 63 will wrap so I have changed it to 1ULL << m_io. This code is over three years old so presumably the bug doesn't happen very frequently in real life or someone would have complained by now. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: Alex Thorlton <athorlton@sgi.com> Cc: Dimitri Sivanich <sivanich@sgi.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Travis <travis@sgi.com> Cc: Nathan Zimmer <nzimmer@sgi.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: kernel-janitors@vger.kernel.org Fixes: b15cc4a ("x86, uv, uv3: Update x2apic Support for SGI UV3") Link: http://lkml.kernel.org/r/20161123221908.GA23997@mwanda Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 7b2dd36 commit c4597fd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/x86/kernel/apic/x2apic_uv_x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -815,9 +815,9 @@ static __init void map_mmioh_high_uv3(int index, int min_pnode, int max_pnode)
815815
l = li;
816816
}
817817
addr1 = (base << shift) +
818-
f * (unsigned long)(1 << m_io);
818+
f * (1ULL << m_io);
819819
addr2 = (base << shift) +
820-
(l + 1) * (unsigned long)(1 << m_io);
820+
(l + 1) * (1ULL << m_io);
821821
pr_info("UV: %s[%03d..%03d] NASID 0x%04x ADDR 0x%016lx - 0x%016lx\n",
822822
id, fi, li, lnasid, addr1, addr2);
823823
if (max_io < l)

0 commit comments

Comments
 (0)