get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/44988/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 44988,
    "url": "https://patches.dpdk.org/api/patches/44988/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20180920001853.23454-1-thomas@monjalon.net/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20180920001853.23454-1-thomas@monjalon.net>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180920001853.23454-1-thomas@monjalon.net",
    "date": "2018-09-20T00:18:53",
    "name": "drivers/net: do not redefine bool",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "fc12f1cbad8c1fa98349eb0b757c5a8b3ee23144",
    "submitter": {
        "id": 685,
        "url": "https://patches.dpdk.org/api/people/685/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas@monjalon.net"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20180920001853.23454-1-thomas@monjalon.net/mbox/",
    "series": [
        {
            "id": 1404,
            "url": "https://patches.dpdk.org/api/series/1404/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=1404",
            "date": "2018-09-20T00:18:53",
            "name": "drivers/net: do not redefine bool",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/1404/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/44988/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/44988/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 063085F16;\n\tThu, 20 Sep 2018 02:20:54 +0200 (CEST)",
            "from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com\n\t[66.111.4.25]) by dpdk.org (Postfix) with ESMTP id CE6BC5B2E\n\tfor <dev@dpdk.org>; Thu, 20 Sep 2018 02:20:51 +0200 (CEST)",
            "from compute1.internal (compute1.nyi.internal [10.202.2.41])\n\tby mailout.nyi.internal (Postfix) with ESMTP id 6560F21B7C;\n\tWed, 19 Sep 2018 20:20:51 -0400 (EDT)",
            "from mailfrontend1 ([10.202.2.162])\n\tby compute1.internal (MEProxy); Wed, 19 Sep 2018 20:20:51 -0400",
            "from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184])\n\tby mail.messagingengine.com (Postfix) with ESMTPA id DAE87E4680;\n\tWed, 19 Sep 2018 20:20:48 -0400 (EDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=\n\tcc:content-transfer-encoding:date:from:message-id:mime-version\n\t:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=qTk\n\tbIZ9CGFoW3rJF7WR69Z/zSfuVp+xNTXTJOaZ8CEw=; b=UUQ2+vRUUUeF8mwyG8J\n\tjnic+q+iqwh6x6c5gpeiydRGTGuv5u7g3Ukx06t1kmgwndN4jvKBaGeb8rELeNrK\n\ti0Fn+OROE7FtWJBZohTt6lhK6g7ffsAqeyRQv5Myx07Bxcb0tlGTj9M9GEhqmbjn\n\tWv9EAdEL4IQYRaTDFyprDuJA=",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n\tmessagingengine.com; h=cc:content-transfer-encoding:date:from\n\t:message-id:mime-version:subject:to:x-me-sender:x-me-sender\n\t:x-sasl-enc; s=fm3; bh=qTkbIZ9CGFoW3rJF7WR69Z/zSfuVp+xNTXTJOaZ8C\n\tEw=; b=EVG9+m4x80X8KcXCSUFhZlheobjkLBTIQhKEAKrmWEkm/mJbFqmCS+W04\n\tJTLKJe57lvdIKWhEPUoJNZQn6/cWbiKO4hUAHEvK83GSLN2AKxw0dUQjSIff+OdR\n\ttAM4ao2IFJqw2pPSEyrvIa7MRE/a2DnpAEO6HeigdbOd3Dng2v6L7/RAFagyUbO0\n\tlH/thw8ypzOg5uf0GgKCASBgahaD95DscoVY3ywe3p60UlyXs4PDWASj5fkEiqyb\n\t9Vx+hY2AQW3bKHzpzfzrMu2bzBcCykDw47Xxjoq+eadRFPcLtHqH/Ot5L3WwBzlb\n\tHJfhHjrPyUx2gfT9N0G9NkNgdqldw=="
        ],
        "X-ME-Proxy": "<xmx:4ueiW1ecKoXufsuYJ1vTdPN8zOrrXoj-oXodfyhihHQdfFEaxn4B-A>\n\t<xmx:4ueiW60zhoVS03YjHM1uTem9WHSMRLmUcKQWPCPHQd_iEstE1vm7rw>\n\t<xmx:4ueiW-t11isRk6onOqsxrI-KheCRNVO3TIEDo07XkP2E-2mXqvAaQg>\n\t<xmx:4ueiW288pz3wy3Emq_aoBABr7lYRfkcxvUoJv84TT-ElADuRTcUxbA>\n\t<xmx:4ueiWyQc5j4AsKSVqYpQGdV1qr9MegD_90ZkoyKqZ9FHjoh0ga21Yg>\n\t<xmx:4-eiW1_UrCc0M_EOJn3oiHKrYedVN3KFg2u7GcOurwWMA7EiC4PGQQ>",
        "X-ME-Sender": "<xms:4ueiW_TaxrY9Rf_7xZwiwELAFsvNQjf1kIJomDJt824aIyunCNkm7w>",
        "From": "Thomas Monjalon <thomas@monjalon.net>",
        "To": "Ferruh Yigit <ferruh.yigit@intel.com>,\n\tRahul Lakkireddy <rahul.lakkireddy@chelsio.com>,\n\tWenzhuo Lu <wenzhuo.lu@intel.com>, Qi Zhang <qi.z.zhang@intel.com>,\n\tXiao Wang <xiao.w.wang@intel.com>,\n\tKonstantin Ananyev <konstantin.ananyev@intel.com>,\n\tRasesh Mody <rasesh.mody@cavium.com>,\n\tHarish Patil <harish.patil@cavium.com>,\n\tShahed Shaikh <shahed.shaikh@cavium.com>, Yong Wang <yongwang@vmware.com>",
        "Cc": "dev@dpdk.org",
        "Date": "Thu, 20 Sep 2018 02:18:53 +0200",
        "Message-Id": "<20180920001853.23454-1-thomas@monjalon.net>",
        "X-Mailer": "git-send-email 2.19.0",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH] drivers/net: do not redefine bool",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "When trying to include stdbool.h in DPDK base headers, there are a lot\nof conflicts with drivers which redefine bool/true/false\nin their compatibility layer.\n\nIt is fixed by including stdbool.h in these drivers.\nSome errors with usage of bool type are also fixed in some drivers.\n\nNote: the driver qede has a surprising mix of bool and int:\n\t(~p_iov->b_pre_fp_hsi & ETH_HSI_VER_MINOR)\nwhere the first variable is boolean and the version is a number.\nIt is replaced by\n\t!p_iov->b_pre_fp_hsi\n\nSigned-off-by: Thomas Monjalon <thomas@monjalon.net>\n---\n drivers/net/cxgbe/cxgbe_compat.h         |  2 +-\n drivers/net/e1000/base/e1000_osdep.h     |  5 +----\n drivers/net/fm10k/base/fm10k_osdep.h     |  8 +-------\n drivers/net/fm10k/fm10k_ethdev.c         |  4 ++--\n drivers/net/ixgbe/base/ixgbe_osdep.h     |  6 +-----\n drivers/net/ixgbe/ixgbe_ethdev.c         | 16 +++++++++-------\n drivers/net/ixgbe/ixgbe_rxtx.c           |  2 +-\n drivers/net/qede/base/bcm_osal.h         |  6 ++----\n drivers/net/qede/base/ecore_vf.c         |  3 +--\n drivers/net/qede/qede_ethdev.c           |  2 +-\n drivers/net/vmxnet3/base/vmxnet3_osdep.h |  3 ++-\n 11 files changed, 22 insertions(+), 35 deletions(-)",
    "diff": "diff --git a/drivers/net/cxgbe/cxgbe_compat.h b/drivers/net/cxgbe/cxgbe_compat.h\nindex 5d47c5f3d..2650ffcab 100644\n--- a/drivers/net/cxgbe/cxgbe_compat.h\n+++ b/drivers/net/cxgbe/cxgbe_compat.h\n@@ -7,6 +7,7 @@\n #define _CXGBE_COMPAT_H_\n \n #include <string.h>\n+#include <stdbool.h>\n #include <stdint.h>\n #include <stdio.h>\n #include <stdarg.h>\n@@ -106,7 +107,6 @@ typedef uint16_t  u16;\n typedef uint32_t  u32;\n typedef int32_t   s32;\n typedef uint64_t  u64;\n-typedef int       bool;\n typedef uint64_t  dma_addr_t;\n \n #ifndef __le16\ndiff --git a/drivers/net/e1000/base/e1000_osdep.h b/drivers/net/e1000/base/e1000_osdep.h\nindex b8868049f..556ed1742 100644\n--- a/drivers/net/e1000/base/e1000_osdep.h\n+++ b/drivers/net/e1000/base/e1000_osdep.h\n@@ -35,6 +35,7 @@\n #ifndef _E1000_OSDEP_H_\n #define _E1000_OSDEP_H_\n \n+#include <stdbool.h>\n #include <stdint.h>\n #include <stdio.h>\n #include <stdarg.h>\n@@ -87,7 +88,6 @@ typedef int64_t\t\ts64;\n typedef int32_t\t\ts32;\n typedef int16_t\t\ts16;\n typedef int8_t\t\ts8;\n-typedef int\t\tbool;\n \n #define __le16\t\tu16\n #define __le32\t\tu32\n@@ -192,7 +192,4 @@ static inline uint16_t e1000_read_addr16(volatile void *addr)\n #define ETH_ADDR_LEN                  6\n #endif\n \n-#define false                         FALSE\n-#define true                          TRUE\n-\n #endif /* _E1000_OSDEP_H_ */\ndiff --git a/drivers/net/fm10k/base/fm10k_osdep.h b/drivers/net/fm10k/base/fm10k_osdep.h\nindex 199ebd8ea..9665239fd 100644\n--- a/drivers/net/fm10k/base/fm10k_osdep.h\n+++ b/drivers/net/fm10k/base/fm10k_osdep.h\n@@ -34,6 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.\n #ifndef _FM10K_OSDEP_H_\n #define _FM10K_OSDEP_H_\n \n+#include <stdbool.h>\n #include <stdint.h>\n #include <string.h>\n #include <rte_atomic.h>\n@@ -61,12 +62,6 @@ POSSIBILITY OF SUCH DAMAGE.\n \n #define FALSE      0\n #define TRUE       1\n-#ifndef false\n-#define false      FALSE\n-#endif\n-#ifndef true\n-#define true       TRUE\n-#endif\n \n typedef uint8_t    u8;\n typedef int8_t     s8;\n@@ -76,7 +71,6 @@ typedef uint32_t   u32;\n typedef int32_t    s32;\n typedef int64_t    s64;\n typedef uint64_t   u64;\n-typedef int        bool;\n \n #ifndef __le16\n #define __le16     u16\ndiff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c\nindex 3359df3c8..243066e08 100644\n--- a/drivers/net/fm10k/fm10k_ethdev.c\n+++ b/drivers/net/fm10k/fm10k_ethdev.c\n@@ -3132,7 +3132,7 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)\n \n \t/* Make sure Switch Manager is ready before going forward. */\n \tif (hw->mac.type == fm10k_mac_pf) {\n-\t\tint switch_ready = 0;\n+\t\tbool switch_ready = false;\n \n \t\tfor (i = 0; i < MAX_QUERY_SWITCH_STATE_TIMES; i++) {\n \t\t\tfm10k_mbx_lock(hw);\n@@ -3144,7 +3144,7 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)\n \t\t\trte_delay_us(WAIT_SWITCH_MSG_US);\n \t\t}\n \n-\t\tif (switch_ready == 0) {\n+\t\tif (!switch_ready) {\n \t\t\tPMD_INIT_LOG(ERR, \"switch is not ready\");\n \t\t\treturn -1;\n \t\t}\ndiff --git a/drivers/net/ixgbe/base/ixgbe_osdep.h b/drivers/net/ixgbe/base/ixgbe_osdep.h\nindex bb5dfd2af..39e9118aa 100644\n--- a/drivers/net/ixgbe/base/ixgbe_osdep.h\n+++ b/drivers/net/ixgbe/base/ixgbe_osdep.h\n@@ -36,6 +36,7 @@\n #define _IXGBE_OS_H_\n \n #include <string.h>\n+#include <stdbool.h>\n #include <stdint.h>\n #include <stdio.h>\n #include <stdarg.h>\n@@ -70,8 +71,6 @@\n #define FALSE               0\n #define TRUE                1\n \n-#define false               0\n-#define true                1\n #define min(a,b)\tRTE_MIN(a,b) \n \n #define EWARN(hw, S, args...)     DEBUGOUT1(S, ##args)\n@@ -112,9 +111,6 @@ typedef int16_t\t\ts16;\n typedef uint32_t\tu32;\n typedef int32_t\t\ts32;\n typedef uint64_t\tu64;\n-#ifndef __cplusplus\n-typedef int\t\tbool;\n-#endif\n \n #define mb()\trte_mb()\n #define wmb()\trte_wmb()\ndiff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c\nindex cee886754..c272a4112 100644\n--- a/drivers/net/ixgbe/ixgbe_ethdev.c\n+++ b/drivers/net/ixgbe/ixgbe_ethdev.c\n@@ -2527,7 +2527,9 @@ ixgbe_dev_start(struct rte_eth_dev *dev)\n \tstruct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);\n \tstruct rte_intr_handle *intr_handle = &pci_dev->intr_handle;\n \tuint32_t intr_vector = 0;\n-\tint err, link_up = 0, negotiate = 0;\n+\tint err;\n+\tbool negotiate = false;\n+\tbool link_up = false;\n \tuint32_t speed = 0;\n \tuint32_t allowed_speeds = 0;\n \tint mask = 0;\n@@ -2669,7 +2671,7 @@ ixgbe_dev_start(struct rte_eth_dev *dev)\n \t\tixgbe_enable_tx_laser(hw);\n \t}\n \n-\terr = ixgbe_check_link(hw, &speed, &link_up, 0);\n+\terr = ixgbe_check_link(hw, &speed, &link_up, false);\n \tif (err)\n \t\tgoto error;\n \tdev->data->dev_link.link_status = link_up;\n@@ -3870,7 +3872,7 @@ ixgbevf_dev_info_get(struct rte_eth_dev *dev,\n \n static int\n ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,\n-\t\t   int *link_up, int wait_to_complete)\n+\t\t   bool *link_up, int wait_to_complete)\n {\n \t/**\n \t * for a quick link status checking, wait_to_compelet == 0,\n@@ -3984,10 +3986,10 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,\n \tixgbe_link_speed link_speed = IXGBE_LINK_SPEED_UNKNOWN;\n \tstruct ixgbe_interrupt *intr =\n \t\tIXGBE_DEV_PRIVATE_TO_INTR(dev->data->dev_private);\n-\tint link_up;\n+\tbool link_up;\n \tint diag;\n \tu32 speed = 0;\n-\tint wait = 1;\n+\tbool wait = true;\n \tbool autoneg = false;\n \n \tmemset(&link, 0, sizeof(link));\n@@ -4008,7 +4010,7 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,\n \n \t/* check if it needs to wait to complete, if lsc interrupt is enabled */\n \tif (wait_to_complete == 0 || dev->data->dev_conf.intr_conf.lsc != 0)\n-\t\twait = 0;\n+\t\twait = false;\n \n \tif (vf)\n \t\tdiag = ixgbevf_check_link(hw, &link_speed, &link_up, wait);\n@@ -4021,7 +4023,7 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,\n \t\treturn rte_eth_linkstatus_set(dev, &link);\n \t}\n \n-\tif (link_up == 0) {\n+\tif (!link_up) {\n \t\tintr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;\n \t\treturn rte_eth_linkstatus_set(dev, &link);\n \t}\ndiff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c\nindex ae21f04a1..2dc14c47f 100644\n--- a/drivers/net/ixgbe/ixgbe_rxtx.c\n+++ b/drivers/net/ixgbe/ixgbe_rxtx.c\n@@ -2025,7 +2025,7 @@ ixgbe_recv_pkts_lro(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts,\n \t\tstruct ixgbe_rx_entry *next_rxe = NULL;\n \t\tstruct rte_mbuf *first_seg;\n \t\tstruct rte_mbuf *rxm;\n-\t\tstruct rte_mbuf *nmb;\n+\t\tstruct rte_mbuf *nmb = NULL;\n \t\tunion ixgbe_adv_rx_desc rxd;\n \t\tuint16_t data_len;\n \t\tuint16_t next_id;\ndiff --git a/drivers/net/qede/base/bcm_osal.h b/drivers/net/qede/base/bcm_osal.h\nindex 630867fad..060ef8e1d 100644\n--- a/drivers/net/qede/base/bcm_osal.h\n+++ b/drivers/net/qede/base/bcm_osal.h\n@@ -7,6 +7,8 @@\n #ifndef __BCM_OSAL_H\n #define __BCM_OSAL_H\n \n+#include <stdbool.h>\n+\n #include <rte_byteorder.h>\n #include <rte_spinlock.h>\n #include <rte_malloc.h>\n@@ -71,10 +73,6 @@ typedef size_t osal_size_t;\n \n typedef intptr_t osal_int_ptr_t;\n \n-typedef int bool;\n-#define true 1\n-#define false 0\n-\n #define nothing do {} while (0)\n \n /* Delays */\ndiff --git a/drivers/net/qede/base/ecore_vf.c b/drivers/net/qede/base/ecore_vf.c\nindex d2213f793..f5deb2916 100644\n--- a/drivers/net/qede/base/ecore_vf.c\n+++ b/drivers/net/qede/base/ecore_vf.c\n@@ -445,8 +445,7 @@ static enum _ecore_status_t ecore_vf_pf_acquire(struct ecore_hwfn *p_hwfn)\n \t}\n \n \t/* @DPDK */\n-\tif ((~p_iov->b_pre_fp_hsi &\n-\t    ETH_HSI_VER_MINOR) &&\n+\tif (!p_iov->b_pre_fp_hsi &&\n \t    (resp->pfdev_info.minor_fp_hsi < ETH_HSI_VER_MINOR))\n \t\tDP_INFO(p_hwfn,\n \t\t\t\"PF is using older fastpath HSI;\"\ndiff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c\nindex 7bb52b157..53a767b3e 100644\n--- a/drivers/net/qede/qede_ethdev.c\n+++ b/drivers/net/qede/qede_ethdev.c\n@@ -534,7 +534,7 @@ int qede_activate_vport(struct rte_eth_dev *eth_dev, bool flg)\n \tparams.update_vport_active_tx_flg = 1;\n \tparams.vport_active_rx_flg = flg;\n \tparams.vport_active_tx_flg = flg;\n-\tif (~qdev->enable_tx_switching & flg) {\n+\tif (!qdev->enable_tx_switching && flg) {\n \t\tparams.update_tx_switching_flg = 1;\n \t\tparams.tx_switching_flg = !flg;\n \t}\ndiff --git a/drivers/net/vmxnet3/base/vmxnet3_osdep.h b/drivers/net/vmxnet3/base/vmxnet3_osdep.h\nindex c9b92b049..12b390acb 100644\n--- a/drivers/net/vmxnet3/base/vmxnet3_osdep.h\n+++ b/drivers/net/vmxnet3/base/vmxnet3_osdep.h\n@@ -5,11 +5,12 @@\n #ifndef _VMXNET3_OSDEP_H\n #define _VMXNET3_OSDEP_H\n \n+#include <stdbool.h>\n+\n typedef uint64_t\tuint64;\n typedef uint32_t\tuint32;\n typedef uint16_t\tuint16;\n typedef uint8_t\t\tuint8;\n-typedef int\t\tbool;\n typedef char\t\tBool;\n \n #ifndef UNLIKELY\n",
    "prefixes": []
}