kernel-ark/arch/sparc
Sam Ravnborg e8dc7c4882 sparc64: fix warnings in psycho_common after ull conversion
After conversion to use unsigned long long for u64
I saw following warnings:

  CC      arch/sparc/kernel/psycho_common.o
arch/sparc/kernel/psycho_common.c: In function `psycho_check_stc_error':
arch/sparc/kernel/psycho_common.c:104: warning: long long unsigned int format, long unsigned int arg (arg 4)
arch/sparc/kernel/psycho_common.c:104: warning: long long unsigned int format, long unsigned int arg (arg 5)
arch/sparc/kernel/psycho_common.c:114: warning: long long unsigned int format, long unsigned int arg (arg 4)
arch/sparc/kernel/psycho_common.c:114: warning: long long unsigned int format, long unsigned int arg (arg 5)
arch/sparc/kernel/psycho_common.c:114: warning: long long unsigned int format, long unsigned int arg (arg 6)
arch/sparc/kernel/psycho_common.c:114: warning: long long unsigned int format, long unsigned int arg (arg 7)
arch/sparc/kernel/psycho_common.c: In function `psycho_dump_iommu_tags_and_data':
arch/sparc/kernel/psycho_common.c:187: warning: long long unsigned int format, long unsigned int arg (arg 8)
arch/sparc/kernel/psycho_common.c:193: warning: long long unsigned int format, long unsigned int arg (arg 6)
arch/sparc/kernel/psycho_common.c: In function `psycho_pcierr_intr':
arch/sparc/kernel/psycho_common.c:333: warning: long long unsigned int format, long unsigned int arg (arg 3)
arch/sparc/kernel/psycho_common.c:333: warning: long long unsigned int format, long unsigned int arg (arg 4)

This is due to different integer promotion in my 32 bit hosted gcc.
The fix is to force a few constants to ULL.

The following stands out from the rest:
+#define  PSYCHO_IOMMU_TAG_VPAGE         0x7ffffULL
+#define  PSYCHO_IOMMU_DATA_PPAGE 0xfffffffULL

They were needed otherwise the expression:

    (data_val & PSYCHO_IOMMU_DATA_PPAGE) << IOMMU_PAGE_SHIFT)

were promoted to a unsigned long and not a unsigned long long as expected.

I tried the alternative solution and made IOMMU_PAGE_SHIFT an ULL but that did not help.
The only way gcc would make this expression an unsigned long long was to
define PSYCHO_IOMMU_DATA_PPAGE as ULL. The alternative to add a cast was
not considered a valid solution.

We had this issue in two places and this were the only places the above
two constants are used.

A small coding style diff sneaked in too. 

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-08 11:37:19 -08:00
..
boot sparc,sparc64: unify boot/ 2008-12-04 09:17:21 -08:00
configs sparc: Update 64-bit defconfig. 2009-01-02 21:54:25 -08:00
include/asm Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2009-01-07 17:23:53 -08:00
kernel sparc64: fix warnings in psycho_common after ull conversion 2009-01-08 11:37:19 -08:00
lib sparc: Commonize memcmp assembler. 2008-12-09 04:09:07 -08:00
math-emu sparc64: unify math-emu 2008-12-04 09:16:56 -08:00
mm sparc64: Use unsigned long long for u64. 2009-01-06 13:19:28 -08:00
oprofile sparc64: Provide oprofile pseudo-NMI on Niagara. 2008-12-04 09:17:10 -08:00
prom sparc: Use sparc64 version of prom/printf.c 2008-12-08 01:00:14 -08:00
Kconfig sparc: Use 64BIT config entry 2009-01-04 23:03:10 -08:00
Kconfig.debug sparc: unify Kconfig.debug 2008-12-04 09:16:48 -08:00
Makefile sparc: unify kernel/init_task 2008-12-04 13:28:09 -08:00