From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0DA54A00C5; Sat, 11 Dec 2021 08:57:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B3A6540DDE; Sat, 11 Dec 2021 08:57:40 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 699B240685 for ; Sat, 11 Dec 2021 08:57:33 +0100 (CET) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4JB0RJ1j8yzZdRT; Sat, 11 Dec 2021 15:54:36 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.20; Sat, 11 Dec 2021 15:57:30 +0800 Subject: Re: [dpdk-dev] [PATCH 1/1] net/bondig: fix type-mismatch in bonding To: Yunjian Wang , CC: , , References: From: "Min Hu (Connor)" Message-ID: Date: Sat, 11 Dec 2021 15:57:30 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Acked-by: Min Hu (Connor) ÔÚ 2021/12/10 19:41, Yunjian Wang дµÀ: > There were some type-mismatch issues in bonding and fix them: > - Use %u to fix argument type mismatch in RTE_BOND_LOG. > - The internals->mode is of type uint8_t. But the function > parameter 'mode' is of type int. So change the mode type > from int to uint8_t. > > Signed-off-by: Yunjian Wang > --- > drivers/net/bonding/eth_bond_private.h | 2 +- > drivers/net/bonding/rte_eth_bond_api.c | 2 +- > drivers/net/bonding/rte_eth_bond_pmd.c | 4 ++-- > 3 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/bonding/eth_bond_private.h b/drivers/net/bonding/eth_bond_private.h > index 8b104b6391..05117cc0d2 100644 > --- a/drivers/net/bonding/eth_bond_private.h > +++ b/drivers/net/bonding/eth_bond_private.h > @@ -240,7 +240,7 @@ slave_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev, > uint16_t slave_port_id); > > int > -bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, int mode); > +bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, uint8_t mode); > > int > slave_configure(struct rte_eth_dev *bonded_eth_dev, > diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c > index 84943cffe2..e577be85a7 100644 > --- a/drivers/net/bonding/rte_eth_bond_api.c > +++ b/drivers/net/bonding/rte_eth_bond_api.c > @@ -668,7 +668,7 @@ __eth_bond_slave_remove_lock_free(uint16_t bonded_port_id, > } > > if (slave_idx < 0) { > - RTE_BOND_LOG(ERR, "Couldn't find slave in port list, slave count %d", > + RTE_BOND_LOG(ERR, "Couldn't find slave in port list, slave count %u", > internals->slave_count); > return -1; > } > diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c > index 84f4900ee5..c48f41fc93 100644 > --- a/drivers/net/bonding/rte_eth_bond_pmd.c > +++ b/drivers/net/bonding/rte_eth_bond_pmd.c > @@ -1554,7 +1554,7 @@ mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev) > } > > int > -bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, int mode) > +bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, uint8_t mode) > { > struct bond_dev_private *internals; > > @@ -3293,7 +3293,7 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode) > /* Set mode 4 default configuration */ > bond_mode_8023ad_setup(eth_dev, NULL); > if (bond_ethdev_mode_set(eth_dev, mode)) { > - RTE_BOND_LOG(ERR, "Failed to set bonded device %d mode to %d", > + RTE_BOND_LOG(ERR, "Failed to set bonded device %u mode to %u", > eth_dev->data->port_id, mode); > goto err; > } >