tools: zynqmpbif: Use compiler builtin instead of linux-specific __swab32
authorBin Meng <bmeng.cn@gmail.com>
Sun, 27 Oct 2019 12:19:42 +0000 (05:19 -0700)
committerTom Rini <trini@konsulko.com>
Mon, 28 Oct 2019 17:32:51 +0000 (13:32 -0400)
__swab32() is a Linux specific macro defined in linux/swab.h. Let's
use the compiler equivalent builtin function __builtin_bswap32() for
better portability.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
tools/zynqmpbif.c

index 8c47107c7b9456aab5a369520a9aa6534215f883..82ce0ac1a5200b17ad8c21fbe64ac5816b62b950 100644 (file)
@@ -517,7 +517,7 @@ static int bif_add_bit(struct bif_entry *bf)
        debug("Bitstream Length: 0x%x\n", bitlen);
        for (i = 0; i < bitlen; i += sizeof(uint32_t)) {
                uint32_t *bitbin32 = (uint32_t *)&bitbin[i];
-               *bitbin32 = __swab32(*bitbin32);
+               *bitbin32 = __builtin_bswap32(*bitbin32);
        }
 
        if (!bf->dest_dev)