coreboot-kgpe-d16/src
Paul Menzel 87fe2360c4 commonlib/lz4_wrapper: Use correct casts to ensure valid calculations
Commit 09f2921b (cbfs: Add LZ4 in-place decompression support for
pre-RAM stages) breaks building cbfstool with gcc (Debian 4.9.2-10)
4.9.2 in Debian 8.3 (jessie) with a 32-bit user space. It works fine
in a 64-bit user space.

```
/home/joey/src/coreboot/src/commonlib/lz4_wrapper.c:164:18: note: in expansion of macro 'MIN'
    size_t size = MIN((uint32_t)b.size, dst + dstn - out);
                  ^
/home/joey/src/coreboot/src/commonlib/include/commonlib/helpers.h:29:35: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
 #define MIN(a,b) ((a) < (b) ? (a) : (b))
                                   ^
```

The problem is arithmetic on void*, so explicitly cast to the wanted
types as suggested by user *redi* in #gcc@irc.freenode.net.

Change-Id: I85bee25a69c432ef8bb934add7fd2e2e31f03662
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://review.coreboot.org/13771
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
2016-02-24 19:26:49 +01:00
..
acpi acpi/: add missing license header 2016-01-14 22:52:11 +01:00
arch die() when attempting to use bounce buffer on non-i386. 2016-02-22 18:38:48 +01:00
commonlib commonlib/lz4_wrapper: Use correct casts to ensure valid calculations 2016-02-24 19:26:49 +01:00
console console: Add higher baud rates 2016-02-22 02:39:07 +01:00
cpu cpu/qemu-power8: don't enable it for qemu-x86 2016-02-19 20:03:52 +01:00
device nb/intel/sandybridge/raminit: Add XMP support 2016-02-20 05:11:37 +01:00
drivers acpi/tpm: Gracefully handle missing TPM module. 2016-02-18 01:48:10 +01:00
ec ASL: Remove unused modulo recipient. 2016-02-09 22:56:00 +01:00
include cbfs: Add LZ4 in-place decompression support for pre-RAM stages 2016-02-22 21:38:37 +01:00
lib cbfs: Add LZ4 in-place decompression support for pre-RAM stages 2016-02-22 21:38:37 +01:00
mainboard southbridge/intel/ibexpeak: Use common gpio.c 2016-02-23 00:28:26 +01:00
northbridge nb/intel/sandybridge/raminit: Add XMP support 2016-02-20 05:11:37 +01:00
soc urara: Increase bootblock size 2016-02-22 21:38:20 +01:00
southbridge southbridge/intel/ibexpeak: Use common gpio.c 2016-02-23 00:28:26 +01:00
superio superio/nuvoton/nct5572d: Add PS/2 presence detect 2016-02-09 20:34:15 +01:00
vendorcode cbfs: Add LZ4 in-place decompression support for pre-RAM stages 2016-02-22 21:38:37 +01:00
Kconfig cbfs: Add LZ4 in-place decompression support for pre-RAM stages 2016-02-22 21:38:37 +01:00