From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by dpdk.org (Postfix) with ESMTP id 0DABD7EB0 for ; Mon, 15 Dec 2014 17:40:30 +0100 (CET) Received: by mail-wi0-f179.google.com with SMTP id ex7so9649487wid.12 for ; Mon, 15 Dec 2014 08:40:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=NOpAHz/mrX0HB/6DEliJ9papkUYaA5g+P86nKAmCxgI=; b=gyUf/HjRhhbknUSYQk4SpH0BqqXaAId6wCoH7wVhdWJodVOSD+eZSe+psEYhCKcyl/ lbBk2BCKBqgjj4XRxvlY7O8zRqo7gHzwt6GxEsz2zZB3noUrfYXuK/8C4iQvRX5lBNTw Zw5d1BiJq7pjKl6jEOSwLZ+hluf8BT+TiRfAGz9sM7q13L36vWyea92JKLcTpyIOqyxP /BNItcMvCxpl9YUZdBWi+3Olw7qvSI60Uey6YaWSlyU7z+zOcdbFiUyAEEN78j/0cpEd 1uwXt408VqQpuCvyKlleayENo59tXIxAAfPLTdOC6T88H+QmK2Ta1GZoazvYC2bQyymd McGw== X-Gm-Message-State: ALoCoQlqypPJOXFMpsKjhTOK1Op3mxgJdm2vK9cKs4lZfaB9bpjle/my0gzmLT2YMY9cSBQFCbXY X-Received: by 10.194.175.69 with SMTP id by5mr52911370wjc.32.1418661629319; Mon, 15 Dec 2014 08:40:29 -0800 (PST) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id ex8sm13630076wjd.41.2014.12.15.08.40.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Dec 2014 08:40:28 -0800 (PST) From: Thomas Monjalon To: "Ananyev, Konstantin" Date: Mon, 15 Dec 2014 17:40:04 +0100 Message-ID: <3419060.OKF5rOINLD@xps13> Organization: 6WIND User-Agent: KMail/4.14.3 (Linux/3.17.4-1-ARCH; KDE/4.14.3; x86_64; ; ) In-Reply-To: <2601191342CEEE43887BDE71AB977258213C0D6A@IRSMSX105.ger.corp.intel.com> References: <533710CFB86FA344BFBF2D6802E60286C9D989@SHSMSX101.ccr.corp.intel.com> <4008093.EPhAooubXd@xps13> <2601191342CEEE43887BDE71AB977258213C0D6A@IRSMSX105.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] error: value computed is not used X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 16:40:30 -0000 2014-12-15 16:00, Ananyev, Konstantin: > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon > > 2014-12-15 13:47, Wodkowski, PawelX: > > > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > > > > 2014-12-15 11:27, Wodkowski, PawelX: > > > > > Thomas, can you check build with EXTRA_CFLAG='-Wunused-value'. > > > > > > > > You mean EXTRA_CFLAGS (with a S). > > > > It fails in many locations. > > > > What's your point? > > > > > > I am just asking if this is an typo, error or intend to do statements with no effects like bellow. > > > > > > ixgbe_common.c:4429:3: error: statement with no effect [-Werror=unused-value] > > > > > > 4426: /* first pull in the header so we know the buffer length */ > > > 4427: for (bi = 0; bi < dword_len; bi++) { > > > 4428: buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi); > > > 4429: IXGBE_LE32_TO_CPUS(&buffer[bi]); // <------ here > > > 4430 } > > > > It's an intent. On big endian CPU, this has an effect. > > Hmm, I think there is a bug in lib/librte_pmd_ixgbe/ixgbe/ixgbe_osdep.h: > #define IXGBE_LE32_TO_CPUS(_i) rte_le_to_cpu_32(_i) > > It probably should be: > #define IXGBE_LE32_TO_CPUS(_i) rte_le_to_cpu_32(*(_i)) > > Not much point to do byte swapping for the pointer. > And that what ixgbe BSD driver is doing. > > Though I still not sure why it is needed here, as the computed value is not used anyway. > What the author probably meant to do: > buffer[bi] = rte_le_to_cpu_32 (buffer[bi]); > To achieve that we need: > #define IXGBE_LE32_TO_CPUS(x) (*(x) = rte_le_to_cpu_32(*(x))) > Correct? Oh yes, you and Pawel are probably right. I was focusing on definition of IXGBE_LE32_TO_CPUS and have not seen the bug. > > > > Do you to support -Wunused-value? > > > > > > No, I just turned this on to check above change and was surprised what happened. > > > > Honestly, I don't know if there is a good fix for this warning. -- Thomas