From 4a3b73bc53e286b022fbe1edf92d9c90e97ac63f Mon Sep 17 00:00:00 2001 From: np Date: Tue, 12 Jun 2018 06:46:03 +0000 Subject: [PATCH] cxgbe(4): Remove homemade version of htobe32 from the driver. It was needed only for ia64 where it was implemented as a call to bswapXX, which was always a real function. htobeXX with a constant argument is calculated at compile-time everywhere else. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/osdep.h | 3 --- sys/dev/cxgbe/t4_main.c | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/dev/cxgbe/osdep.h b/sys/dev/cxgbe/osdep.h index f6d065ac38eb..5cd3e88803ad 100644 --- a/sys/dev/cxgbe/osdep.h +++ b/sys/dev/cxgbe/osdep.h @@ -67,11 +67,8 @@ typedef uint64_t __be64; #if BYTE_ORDER == BIG_ENDIAN #define __BIG_ENDIAN_BITFIELD -#define htobe32_const(x) (x) #elif BYTE_ORDER == LITTLE_ENDIAN #define __LITTLE_ENDIAN_BITFIELD -#define htobe32_const(x) (((x) >> 24) | (((x) >> 8) & 0xff00) | \ - ((((x) & 0xffffff) << 8) & 0xff0000) | ((((x) & 0xff) << 24) & 0xff000000)) #else #error "Must set BYTE_ORDER" #endif diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 103d85397e96..2c707360405e 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -3213,7 +3213,7 @@ struct fw_info { .fw_mod_name = "t4fw", .fw_hdr = { .chip = FW_HDR_CHIP_T4, - .fw_ver = htobe32_const(FW_VERSION(T4)), + .fw_ver = htobe32(FW_VERSION(T4)), .intfver_nic = FW_INTFVER(T4, NIC), .intfver_vnic = FW_INTFVER(T4, VNIC), .intfver_ofld = FW_INTFVER(T4, OFLD), @@ -3229,7 +3229,7 @@ struct fw_info { .fw_mod_name = "t5fw", .fw_hdr = { .chip = FW_HDR_CHIP_T5, - .fw_ver = htobe32_const(FW_VERSION(T5)), + .fw_ver = htobe32(FW_VERSION(T5)), .intfver_nic = FW_INTFVER(T5, NIC), .intfver_vnic = FW_INTFVER(T5, VNIC), .intfver_ofld = FW_INTFVER(T5, OFLD), @@ -3245,7 +3245,7 @@ struct fw_info { .fw_mod_name = "t6fw", .fw_hdr = { .chip = FW_HDR_CHIP_T6, - .fw_ver = htobe32_const(FW_VERSION(T6)), + .fw_ver = htobe32(FW_VERSION(T6)), .intfver_nic = FW_INTFVER(T6, NIC), .intfver_vnic = FW_INTFVER(T6, VNIC), .intfver_ofld = FW_INTFVER(T6, OFLD),