From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by dpdk.org (Postfix) with ESMTP id 678632BE1 for ; Wed, 23 May 2018 16:34:12 +0200 (CEST) Received: by mail-wr0-f196.google.com with SMTP id j1-v6so15987487wrm.1 for ; Wed, 23 May 2018 07:34:12 -0700 (PDT) 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; bh=ULufazavOBmm68uc5yYtwsiB4zW39pmmRtB1Ge7XFro=; b=URSyiOH2U7fLxHg2OBLJA+2N+0cToqCXTuo1b3syvn7yqOBgHqkMKqyqKI7FuzRkB1 D3VOrtOxnM0HCsRTOW6OHSlYGZIQ/9++Sk8qTDKVT+ziiekNJIlhKmQqvpBlhV/TZYca PYHEWRJS0VGksL2iYEzW+YzXajCc91exul9y1+ke4l7Y4jZtxEPNqk1u5wDywiISFPnl Ui9Rgc/P8Qv9QX1Dl+eUXjh0VhgUOtt9vMA4pk4FYtQAPMyVgf7GMeHAT19nd3Uhzcmq DSXi5vuNAd0jpaKASeQ73d0YrCKxQre442WQZ+uZ1BOdynMMIaW3zQ+QhUPohUu7DIjN 6mFw== 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; bh=ULufazavOBmm68uc5yYtwsiB4zW39pmmRtB1Ge7XFro=; b=eYGdI1pmnxjJbzxTVh9mMR1Y7oXCGafMeDK/kPCyE8p8HUhGKv1MtlJj1AB2ekcGNT /DspJPuvhYfMrpxsIeUR3uog2oWeyE2BXhKQZDKxzoPslzxG8PPQtCladl4DmA9pULML sd3qpTTda4RduCvVKxIMUrUzY55a6eqHrZVUz4BPMwLnMpISLoqv5vLXCxClbp4scpnL U8tx8d6RoE1v75EWMbe2Ilp3xYvzF7OEbuKtswoPsAtfsVIEJoxqQc4IJUBxSD8WDFNF 5JZi6lu9RFh73feRwKU+4dKgDUkaORzhB3cMCSQk0mur1UHwi03VzZzFfr31dE0SxaEU nyVQ== X-Gm-Message-State: ALKqPwf/HG/rtdWOJBn9Zr+dkRtRXpflisPU5mJzf/nK38eTgvELP1oq omKmAyc5k/mM1WggYVvs53CSJk9fjs8= X-Google-Smtp-Source: AB8JxZoKBqFwpwccIVDecR9ImhheB1U+7ewUm35JV2/zk1W2wWc8Nl0yXTO04K8HtS5AvJ+RI4UhXg== X-Received: by 2002:adf:c613:: with SMTP id n19-v6mr2519881wrg.177.1527086051883; Wed, 23 May 2018 07:34:11 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id y42-v6sm35299664wry.21.2018.05.23.07.34.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 May 2018 07:34:11 -0700 (PDT) From: luca.boccassi@gmail.com To: Andy Green Cc: Bruce Richardson , dpdk stable Date: Wed, 23 May 2018 15:33:34 +0100 Message-Id: <20180523143344.16885-13-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180523143344.16885-1-luca.boccassi@gmail.com> References: <20180516100945.4449-2-luca.boccassi@gmail.com> <20180523143344.16885-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'eal: explicit cast in rwlock functions' has been queued to LTS release 16.11.7 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: Wed, 23 May 2018 14:34:12 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/25/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From 2c02f6323d97102ddfb68fcdce86084e8e63d241 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 7a0fdc55c..e57ce2105 100644 --- a/lib/librte_eal/common/include/generic/rte_rwlock.h +++ b/lib/librte_eal/common/include/generic/rte_rwlock.h @@ -99,7 +99,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)); } } @@ -135,7 +135,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.14.2