From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id A1BA32BF3 for ; Wed, 23 May 2018 14:10:59 +0200 (CEST) Received: by mail-wr0-f193.google.com with SMTP id k5-v6so13968336wrn.3 for ; Wed, 23 May 2018 05:10:59 -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=AM1pbt4wuC0RLeBLslGhzTcKwfb/rp59ORcfpazgpmc=; b=KV7u1ZLFujBybhFzsi/ORuY87ocS0kh2aeiuZMrxAbo4KvEPAvHYcJD761gC9bv/Rx ainTh7ANJ7RGpieFEyFKv+9wYBM1tyx0LEXnGBFMk9ZvLgBUKUVMUz08rdfFLP/lL3OU YvyBhPdTsJzDrFSta5MSJ2lGFc9Br/346V5IWbH/ueciNlGacU3soNjz2G9GNUNZrjoV W/3JfmFFeDu5G8ABDDWMOHh0p+VdFDxr3IDiK6bIa/JJzJ+AefUl5f92oSQDPuo6aZW6 Qp0OX+1TK5/7bw1U69zRblpqSDyPu5thF5eoVHWmt0L0mZmZtikxs/KtPdnUZGrK5fbJ YzPQ== 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=AM1pbt4wuC0RLeBLslGhzTcKwfb/rp59ORcfpazgpmc=; b=av5W4vnI+OV+Mk4wuXr/VnNGEg8UxyuriAkWbWVVfQyRylzwIz6fvRkauaSl5rF4so FFPEJwPf97EdKEhHJAJhfG0uxdWj4pkVEPDYLdWUAyQrUsk8GhiLdlw+sB49fZxHxGI8 BQH2i9ShFo69Y/Zkfdp89b2CVWSLoCds047ybgwD71s5BZZtWs569ZE66JCSgIKYU3M1 xDL+lHie+kux2JkG+Tn1CsJDq9m7GMiWiC6GSWVdrn0D4Kjh7h67cCi7NAppf5yPb/wh vFGVXO3RqT6V+VL0lWS2LsHqxulfqfG7/kPuYS4Dbkj7fXNHR+uP3EZ88RySczUqb4mP +Uqw== X-Gm-Message-State: ALKqPwecWPIJn2FjFJEeV98mhUxITbEVQNeHn67gmnggX0+BjIywoWEH k2NNlL3vjpMuprwyzf7xZIk= X-Google-Smtp-Source: AB8JxZrYfXr0IHWDG89IQbv1xkHFU1PimOzlZfAQZhDrD0LFysMM/72K5dP4FFn3bFq/6IT/yrbHkQ== X-Received: by 2002:adf:dc8b:: with SMTP id r11-v6mr1983374wrj.263.1527077459352; Wed, 23 May 2018 05:10:59 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id o101-v6sm28774181wrb.44.2018.05.23.05.10.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 May 2018 05:10:58 -0700 (PDT) From: luca.boccassi@gmail.com To: Andy Green Cc: Bruce Richardson , dpdk stable Date: Wed, 23 May 2018 13:09:37 +0100 Message-Id: <20180523121010.8385-26-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180523121010.8385-1-luca.boccassi@gmail.com> References: <20180516101323.2234-2-luca.boccassi@gmail.com> <20180523121010.8385-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'eal: explicit cast in rwlock functions' has been queued to stable release 18.02.2 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 12:10:59 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 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 9eb018ee6f675c01856295ee94c2740b89e605b4 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 899e9bc43..5751a0e6d 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) continue; } success = rte_atomic32_cmpset((volatile uint32_t *)&rwl->cnt, - x, x + 1); + (uint32_t)x, (uint32_t)(x + 1)); } } @@ -107,7 +107,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