coreboot-kgpe-d16/util/inteltool
Paul Menzel 17c05f23e2 inteltool: pcie.c: Use `0xffULL` instead of `0xff` to avoid shift overflow
When building inteltool with Clang, it warns about the following.

    $ clang --version
    Debian clang version 3.2-1~exp6 (tags/RELEASE_32/final) (based on LLVM 3.2)
    Target: i386-pc-linux-gnu
    Thread model: posix
    $ CC=clang make
    […]
    clang -O2 -g -Wall -W   -c -o pcie.o pcie.c
    pcie.c:297:40: warning: signed shift result (0xFF0000000) requires 37 bits to represent, but 'int' only has 32 bits [-Wshift-overflow]
                    pciexbar_phys = pciexbar_reg & (0xff << 28);
                                                    ~~~~ ^  ~~
    pcie.c:301:41: warning: signed shift result (0xFF8000000) requires 37 bits to represent, but 'int' only has 32 bits [-Wshift-overflow]
                    pciexbar_phys = pciexbar_reg & (0x1ff << 27);
                                                    ~~~~~ ^  ~~
    pcie.c:305:41: warning: signed shift result (0xFFC000000) requires 37 bits to represent, but 'int' only has 32 bits [-Wshift-overflow]
                    pciexbar_phys = pciexbar_reg & (0x3ff << 26);
                                                    ~~~~~ ^  ~~
    3 warnings generated.
    […]

Specifying the length by using the suffix `0xffULL` fixes these issues
as now enough bits are available.

These issues were introduced in commit 1162f25a [1].

    commit 1162f25a49
    Author: Stefan Reinauer <stepan@coresystems.de>
    Date:   Thu Dec 4 15:18:20 2008 +0000

        Patch to util/inteltool:
        * PMBASE dumping now knows the registers.
        * Add support for i965, i975, ICH8M
        * Add support for Darwin OS using DirectIO

[1] http://review.coreboot.org/gitweb?p=coreboot.git;a=commit;h=1162f25a49e8f39822123d664cda10fef466b351

Change-Id: I7b9a15b04ef3bcae64e06266667597d0f9f07b79
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: http://review.coreboot.org/3015
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.huber@secunet.com>
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-04-15 19:03:19 +02:00
..
Makefile inteltool: Allow to override Makefile variables 2013-04-01 22:40:45 +02:00
amb.c inteltool: Use portable type `uint64_t` instead of `u64` 2013-04-14 23:00:35 +02:00
cpu.c inteltool: cpu.c: Use conversion specifier `u` for unsigned integers 2013-04-05 20:17:03 +02:00
gpio.c inteltool: Add Cougar/Panther Point GPIO defaults 2013-04-01 22:39:30 +02:00
inteltool.8
inteltool.c inteltool: remove unused file descriptor variable and ifdefs 2013-04-08 18:17:59 +02:00
inteltool.h inteltool: Add option to show differences in GPIO setup 2013-04-01 22:39:04 +02:00
memory.c inteltool: use inttypes for prints in memory.c 2013-04-05 20:21:35 +02:00
pcie.c inteltool: pcie.c: Use `0xffULL` instead of `0xff` to avoid shift overflow 2013-04-15 19:03:19 +02:00
powermgt.c inteltool: Support PM registers on Cougar/Panther Point 2013-04-01 21:00:16 +02:00
rootcmplx.c inteltool: Add Cougar/Panther Point IDs to rootcmplx.c 2013-03-30 18:17:08 +01:00