From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id DD7962BF4 for ; Thu, 3 Jan 2019 09:15:21 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 3 Jan 2019 10:15:17 +0200 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x038EJg0008603; Thu, 3 Jan 2019 10:15:16 +0200 From: Yongseok Koh To: Andy Green Cc: Bruce Richardson , dpdk stable Date: Thu, 3 Jan 2019 00:13:54 -0800 Message-Id: <20190103081400.14191-31-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190103081400.14191-1-yskoh@mellanox.com> References: <20190103081400.14191-1-yskoh@mellanox.com> Subject: [dpdk-stable] patch 'eal: explicit cast in rwlock functions' has been queued to LTS release 17.11.5 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: , X-List-Received-Date: Thu, 03 Jan 2019 08:15:22 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 01/04/19. 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. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Yongseok --- >>From 66ca6b9a6b272cc7d2048f016eb544fa4fb1c8c3 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 22 May 2018 09:24:17 +0800 Subject: [PATCH] eal: explicit cast in rwlock functions [ upstream commit 1587d36e22d0cf0e037a104e1e851acefd6597f0 ] GCC 8.1 warned: In function 'rte_rwlock_read_lock': rte_rwlock.h:74:12: warning: conversion to 'uint32_t' {aka 'unsigned int'} from 'int32_t' {aka 'int'} may change the sign of the result [-Wsign-conversion] x, x + 1); ^ rte_rwlock.h:74:17: warning: conversion to 'uint32_t' {aka 'unsigned int'} from 'int' may change the sign of the result [-Wsign-conversion] x, x + 1); ~~^~~ In function 'rte_rwlock_write_lock': rte_rwlock.h:110:15: warning: unsigned conversion from 'int' to 'uint32_t' {aka 'unsigned int'} changes value from '-1' to '4294967295' [-Wsign-conversion] 0, -1); ^~ Again in this case we are making explicit the exact cast that was always happening implicitly. The patch does not change the generated code. The int32_t temp "x" is required to be signed to detect a < 0 error condition from the lock status. Afterwards, it has always been implicitly cast to uint32_t when it is used in the arguments to rte_atomic32_cmpset()... gcc8.1 objects to the implicit cast now and requires us to cast it explicitly. Fixes: af75078fec ("first public release") Signed-off-by: Andy Green Acked-by: Bruce Richardson --- lib/librte_eal/common/include/generic/rte_rwlock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/include/generic/rte_rwlock.h b/lib/librte_eal/common/include/generic/rte_rwlock.h index fdb3113d3..f4ee1aa9b 100644 --- a/lib/librte_eal/common/include/generic/rte_rwlock.h +++ b/lib/librte_eal/common/include/generic/rte_rwlock.h @@ -100,7 +100,7 @@ rte_rwlock_read_lock(rte_rwlock_t *rwl) continue; } success = rte_atomic32_cmpset((volatile uint32_t *)&rwl->cnt, - x, x + 1); + (uint32_t)x, (uint32_t)(x + 1)); } } @@ -136,7 +136,7 @@ rte_rwlock_write_lock(rte_rwlock_t *rwl) continue; } success = rte_atomic32_cmpset((volatile uint32_t *)&rwl->cnt, - 0, -1); + 0, (uint32_t)-1); } } -- 2.11.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-01-02 23:59:13.722428285 -0800 +++ 0031-eal-explicit-cast-in-rwlock-functions.patch 2019-01-02 23:59:12.096815000 -0800 @@ -1,8 +1,10 @@ -From 1587d36e22d0cf0e037a104e1e851acefd6597f0 Mon Sep 17 00:00:00 2001 +From 66ca6b9a6b272cc7d2048f016eb544fa4fb1c8c3 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 22 May 2018 09:24:17 +0800 Subject: [PATCH] eal: explicit cast in rwlock functions +[ upstream commit 1587d36e22d0cf0e037a104e1e851acefd6597f0 ] + GCC 8.1 warned: In function 'rte_rwlock_read_lock': @@ -36,7 +38,6 @@ to cast it explicitly. Fixes: af75078fec ("first public release") -Cc: stable@dpdk.org Signed-off-by: Andy Green Acked-by: Bruce Richardson @@ -45,10 +46,10 @@ 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/include/generic/rte_rwlock.h b/lib/librte_eal/common/include/generic/rte_rwlock.h -index 899e9bc43..5751a0e6d 100644 +index fdb3113d3..f4ee1aa9b 100644 --- a/lib/librte_eal/common/include/generic/rte_rwlock.h +++ b/lib/librte_eal/common/include/generic/rte_rwlock.h -@@ -71,7 +71,7 @@ rte_rwlock_read_lock(rte_rwlock_t *rwl) +@@ -100,7 +100,7 @@ rte_rwlock_read_lock(rte_rwlock_t *rwl) continue; } success = rte_atomic32_cmpset((volatile uint32_t *)&rwl->cnt, @@ -57,7 +58,7 @@ } } -@@ -107,7 +107,7 @@ rte_rwlock_write_lock(rte_rwlock_t *rwl) +@@ -136,7 +136,7 @@ rte_rwlock_write_lock(rte_rwlock_t *rwl) continue; } success = rte_atomic32_cmpset((volatile uint32_t *)&rwl->cnt,