From e40303eb0ff6389fab499ddc55a8203276451232 Mon Sep 17 00:00:00 2001 From: Sunil Kumar Kori Date: Mon, 9 Mar 2020 14:39:27 +0530 Subject: [PATCH] net/ionic: use standard boolean type MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Any DPDK public header file which includes stdbool.h may conflict with local definition of bool, if any, which further results in compilation error. To avoid, used standard stdbool.h instead of defining bool internally. I observed this issue during a development where I included rte_uuid.h into rte_ethdev.h. As rte_ethdev.h is included to PMD driver, it started throwing error as given below: CC ionic_rxtx.o In file included from .../dpdk/build/include/rte_uuid.h:17:0, from .../dpdk/build/include/rte_ethdev.h:161, from .../dpdk/build/include/rte_ethdev_driver.h:18, from .../dpdk/drivers/net/ionic/ionic_rxtx.c:34: .../dpdk/drivers/net/ionic/ionic_osdep.h:48:17: error: two or more data types in declaration specifiers typedef uint8_t bool; ^ In file included from .../dpdk/drivers/net/ionic/ionic_dev.h:8:0, from .../dpdk/drivers/net/ionic/ionic.h:13, from .../dpdk/drivers/net/ionic/ionic_mac_api.h:8, from .../dpdk/drivers/net/ionic/ionic_rxtx.c:45: .../dpdk/drivers/net/ionic/ionic_osdep.h:48:1: warning: useless type name in empty declaration typedef uint8_t bool; ^~~~~~~ cc1: warning: unrecognized command line option ‘-Wno-address-of-packed-member’ .../dpdk/mk/internal/rte.compile-pre.mk:114: recipe for target 'ionic_rxtx.o' failed Fixes: 5ef518098ec6 ("net/ionic: register and initialize adapter") Cc: stable@dpdk.org Signed-off-by: Sunil Kumar Kori Acked-by: Alfredo Cardigliano --- drivers/net/ionic/ionic_dev.c | 2 ++ drivers/net/ionic/ionic_dev.h | 2 ++ drivers/net/ionic/ionic_mac_api.c | 2 ++ drivers/net/ionic/ionic_main.c | 2 ++ drivers/net/ionic/ionic_osdep.h | 6 ------ drivers/net/ionic/ionic_rx_filter.c | 1 + 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/net/ionic/ionic_dev.c b/drivers/net/ionic/ionic_dev.c index aba388115d..5c2820b7a1 100644 --- a/drivers/net/ionic/ionic_dev.c +++ b/drivers/net/ionic/ionic_dev.c @@ -2,6 +2,8 @@ * Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. */ +#include + #include #include "ionic_dev.h" diff --git a/drivers/net/ionic/ionic_dev.h b/drivers/net/ionic/ionic_dev.h index 8c1ec13a68..532255a603 100644 --- a/drivers/net/ionic/ionic_dev.h +++ b/drivers/net/ionic/ionic_dev.h @@ -5,6 +5,8 @@ #ifndef _IONIC_DEV_H_ #define _IONIC_DEV_H_ +#include + #include "ionic_osdep.h" #include "ionic_if.h" #include "ionic_regs.h" diff --git a/drivers/net/ionic/ionic_mac_api.c b/drivers/net/ionic/ionic_mac_api.c index 189b8b81a4..c0ea042bc5 100644 --- a/drivers/net/ionic/ionic_mac_api.c +++ b/drivers/net/ionic/ionic_mac_api.c @@ -2,6 +2,8 @@ * Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. */ +#include + #include "ionic_mac_api.h" int32_t diff --git a/drivers/net/ionic/ionic_main.c b/drivers/net/ionic/ionic_main.c index b828d230d3..2ade213d2d 100644 --- a/drivers/net/ionic/ionic_main.c +++ b/drivers/net/ionic/ionic_main.c @@ -2,6 +2,8 @@ * Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved. */ +#include + #include #include "ionic.h" diff --git a/drivers/net/ionic/ionic_osdep.h b/drivers/net/ionic/ionic_osdep.h index ecdbc24e63..e04bb8f658 100644 --- a/drivers/net/ionic/ionic_osdep.h +++ b/drivers/net/ionic/ionic_osdep.h @@ -44,12 +44,6 @@ typedef uint16_t __le16; typedef uint32_t __le32; typedef uint64_t __le64; -#ifndef __cplusplus -typedef uint8_t bool; -#define false 0 -#define true 1 -#endif - static inline uint32_t div_round_up(uint32_t n, uint32_t d) { return (n + d - 1) / d; diff --git a/drivers/net/ionic/ionic_rx_filter.c b/drivers/net/ionic/ionic_rx_filter.c index f75b81a27c..fe624538df 100644 --- a/drivers/net/ionic/ionic_rx_filter.c +++ b/drivers/net/ionic/ionic_rx_filter.c @@ -3,6 +3,7 @@ */ #include +#include #include -- 2.20.1