From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9B58CA0553 for ; Mon, 17 Feb 2020 18:46:12 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8B0371DABB; Mon, 17 Feb 2020 18:46:12 +0100 (CET) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by dpdk.org (Postfix) with ESMTP id E5EF91DA12 for ; Mon, 17 Feb 2020 18:46:11 +0100 (CET) Received: by mail-wm1-f44.google.com with SMTP id t23so197487wmi.1 for ; Mon, 17 Feb 2020 09:46:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jPfwNLYeselOs5TE4M6/puRS+YZcB5hZhcndk7oFA9Q=; b=M6EiU4gKvb2MsxH19tCP6wNFxKw85zFmCZVPe7+gnHuTixIfEgvjzqPcccCjKtQBjF v2vBGVx0tMMfNmKqEtHa/ld5FDgUIzVOhIffm+GXRFcI/jrztiLXVhtKy51slTQdGbzb PT8WCcmyvvryDkH1Qu+YstwAvGAgwBhkZj3Z0Tt5bxW1bzgGBb8JNFM5mEohW0zsfQbQ iJm9iOMwglMLBoC9qbRA1e6y58b3fw2RA3twi720nQYouzRwK62QcWf1G2jRVVp7k+OM 8WWSpDYy1FNl1ZoZG9e+qh5RgATPgSOMehnzMx+TTq2lFJZtyEE34mzAc51iWNwteIYT GbxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jPfwNLYeselOs5TE4M6/puRS+YZcB5hZhcndk7oFA9Q=; b=rogkuqt0MGjjTgXIOaB4EwZxO2+SMbU2c5QXATGtt12FLLCINbPXymcnPGTa+XtgK8 eVZTAv0/oZ4OgYu9sVL9dQ6nNrD+tsrD7e+arhrSthEfX+V3xXZMOdix7SdLJhxIU9aR z7WASovKD52/3HMD/Pk7uX/aU7AlHc+k5HA5qLBFptX7MFX7Jyaa4SDvqyPWnJmql+iZ LtFopwuQMSfLFyNoFvrW+AwBOIEIPt+AyesTmgZfMqhH6ppUEpZlAqSROsHXMDZ0E61n dc4LmoZOXXoU9GBQuj4hFZAtXqmKsvmKHqPQSb+Z5uaijDjY28x3O83fVtw3XT4o7V7D 5ggg== X-Gm-Message-State: APjAAAWqd5XsVvUK4jFELV3EPxYJw83vE/k6E2W+QWdcLgZyBcen3D/P GIrcG6UBLSB+iIbnJNRCrBc= X-Google-Smtp-Source: APXvYqyECvfyaxo/w5EvlkUNpz1N+goWGmbw9rqQ1ci4iOBHsgNYj4xbKOS6QP8hJ6OD3l17Fy0DIw== X-Received: by 2002:a05:600c:2207:: with SMTP id z7mr168693wml.138.1581961571650; Mon, 17 Feb 2020 09:46:11 -0800 (PST) Received: from localhost (userh634.uk.uudial.com. [194.69.103.7]) by smtp.gmail.com with ESMTPSA id z11sm1923375wrv.96.2020.02.17.09.46.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 09:46:11 -0800 (PST) From: luca.boccassi@gmail.com To: Ciara Power Cc: Ferruh Yigit , Olivier Matz , dpdk stable Date: Mon, 17 Feb 2020 17:45:05 +0000 Message-Id: <20200217174546.25334-13-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200217174546.25334-1-luca.boccassi@gmail.com> References: <20200211112216.3929-190-luca.boccassi@gmail.com> <20200217174546.25334-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'lib: fix unnecessary double negation' has been queued to stable release 19.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/19/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 7081fd04ce3e615b815870e40a8a6cba04983c42 Mon Sep 17 00:00:00 2001 From: Ciara Power Date: Fri, 14 Feb 2020 16:17:25 +0000 Subject: [PATCH] lib: fix unnecessary double negation [ upstream commit f42c9ac5b6b5fabd3c6bb124914af6704445e853 ] An equality expression already returns either 0 or 1. There is no need to use double negation for these cases. Fixes: ea672a8b1655 ("mbuf: remove the rte_pktmbuf structure") Fixes: a0fd91cefcc0 ("mempool: rename functions with confusing names") Signed-off-by: Ciara Power Reviewed-by: Ferruh Yigit Acked-by: Olivier Matz --- lib/librte_mbuf/rte_mbuf.h | 2 +- lib/librte_mempool/rte_mempool.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 219b110b76..6d080527f6 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -1535,7 +1535,7 @@ static inline int rte_pktmbuf_trim(struct rte_mbuf *m, uint16_t len) static inline int rte_pktmbuf_is_contiguous(const struct rte_mbuf *m) { __rte_mbuf_sanity_check(m, 1); - return !!(m->nb_segs == 1); + return m->nb_segs == 1; } /** diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h index 0a1dc6059f..4907c0808e 100644 --- a/lib/librte_mempool/rte_mempool.h +++ b/lib/librte_mempool/rte_mempool.h @@ -1653,7 +1653,7 @@ rte_mempool_in_use_count(const struct rte_mempool *mp); static inline int rte_mempool_full(const struct rte_mempool *mp) { - return !!(rte_mempool_avail_count(mp) == mp->size); + return rte_mempool_avail_count(mp) == mp->size; } /** @@ -1672,7 +1672,7 @@ rte_mempool_full(const struct rte_mempool *mp) static inline int rte_mempool_empty(const struct rte_mempool *mp) { - return !!(rte_mempool_avail_count(mp) == 0); + return rte_mempool_avail_count(mp) == 0; } /** -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-17 17:00:15.701318588 +0000 +++ 0013-lib-fix-unnecessary-double-negation.patch 2020-02-17 17:00:15.283950115 +0000 @@ -1,14 +1,15 @@ -From f42c9ac5b6b5fabd3c6bb124914af6704445e853 Mon Sep 17 00:00:00 2001 +From 7081fd04ce3e615b815870e40a8a6cba04983c42 Mon Sep 17 00:00:00 2001 From: Ciara Power Date: Fri, 14 Feb 2020 16:17:25 +0000 Subject: [PATCH] lib: fix unnecessary double negation +[ upstream commit f42c9ac5b6b5fabd3c6bb124914af6704445e853 ] + An equality expression already returns either 0 or 1. There is no need to use double negation for these cases. Fixes: ea672a8b1655 ("mbuf: remove the rte_pktmbuf structure") Fixes: a0fd91cefcc0 ("mempool: rename functions with confusing names") -Cc: stable@dpdk.org Signed-off-by: Ciara Power Reviewed-by: Ferruh Yigit @@ -19,10 +20,10 @@ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h -index 59023893a5..34679e0920 100644 +index 219b110b76..6d080527f6 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h -@@ -1699,7 +1699,7 @@ static inline int rte_pktmbuf_trim(struct rte_mbuf *m, uint16_t len) +@@ -1535,7 +1535,7 @@ static inline int rte_pktmbuf_trim(struct rte_mbuf *m, uint16_t len) static inline int rte_pktmbuf_is_contiguous(const struct rte_mbuf *m) { __rte_mbuf_sanity_check(m, 1); @@ -32,10 +33,10 @@ /** diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h -index a2c92727a6..c90cf31467 100644 +index 0a1dc6059f..4907c0808e 100644 --- a/lib/librte_mempool/rte_mempool.h +++ b/lib/librte_mempool/rte_mempool.h -@@ -1654,7 +1654,7 @@ rte_mempool_in_use_count(const struct rte_mempool *mp); +@@ -1653,7 +1653,7 @@ rte_mempool_in_use_count(const struct rte_mempool *mp); static inline int rte_mempool_full(const struct rte_mempool *mp) { @@ -44,7 +45,7 @@ } /** -@@ -1673,7 +1673,7 @@ rte_mempool_full(const struct rte_mempool *mp) +@@ -1672,7 +1672,7 @@ rte_mempool_full(const struct rte_mempool *mp) static inline int rte_mempool_empty(const struct rte_mempool *mp) {