From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EE930A0A0E; Tue, 11 May 2021 14:26:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BB1BD40140; Tue, 11 May 2021 14:26:39 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 34A2D4003E for ; Tue, 11 May 2021 14:26:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620735997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Agv6jzSb7cCjD0WX9alah/k9ZkODsyPTDUF3yNpLP3o=; b=Tgc/1JUfaLq5yi8URqYvleB64R/buBRIu+6AGBYhPKTk5+wFnm43X4qrqDBWlU9QT37b8g +iioQJCG0g1TI5WJwwlIQWj7dw1vA1aPbHiy0qtedrzQDr2tlpgpAvYMKlerYR94V3KZNh XPNqAGRzuRy+OPq8MHJdEAKMxDMp9SA= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-94-RbI5gzk8MfOS2SOOmwu2iw-1; Tue, 11 May 2021 08:26:36 -0400 X-MC-Unique: RbI5gzk8MfOS2SOOmwu2iw-1 Received: by mail-wr1-f72.google.com with SMTP id 88-20020adf95610000b029010758d8d7e2so8613247wrs.19 for ; Tue, 11 May 2021 05:26:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Agv6jzSb7cCjD0WX9alah/k9ZkODsyPTDUF3yNpLP3o=; b=ZS3K4P+V0OhlhHA9fLXwnhnmcblvaI6UlkZspgoBf7nGbbadPNaUPdlMx7y6bOrQsD WC9DbqvvH9l64fR/OqplP0hj9XfMyDUOh8+hnBqldi/g2grNNRdPaDQqB5RIL1BmKcS/ SJmehPCrPZ1DasCX9C11GmeFN7lYDtjthDHsVsPrpQGr09iJdbpHYUcQbSS9YiPZuihj SDkkNqMRpVVQN9/qoaN5ukcyf4LbOHZfUzSjoRMJk0TZjZrABqx0cO7g37WcCqubIzJe cmjfihDR4/g+N7rmogqpmYba6z5mNshtMVnvfo8pm93uGBFkVbzAQ4+B57N2CTDqFOmH FNDw== X-Gm-Message-State: AOAM533Bq2VqI8BycfHLw7dckVWVuM8+ZedbVaenUanNws1uVBxdkQIJ KnrnM9WYMBQ1t9Q6REUlb2uiZsA1f+ayMxVwTCTpSI/+sAbhNUHLpKJXQj+CgTnq39h7i/xXkRO Ii1U= X-Received: by 2002:a05:600c:4ca9:: with SMTP id g41mr5047194wmp.70.1620735994364; Tue, 11 May 2021 05:26:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5FpFawft5gjbT1zS2ZT4H0UuLrhVuhOSCN8jk44zHFdqIxUr7b0oYFoB2yr6y3azdTKtG/w== X-Received: by 2002:a05:600c:4ca9:: with SMTP id g41mr5047182wmp.70.1620735994222; Tue, 11 May 2021 05:26:34 -0700 (PDT) Received: from [192.168.0.36] ([78.18.27.43]) by smtp.gmail.com with ESMTPSA id o1sm3321194wmc.6.2021.05.11.05.26.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 May 2021 05:26:33 -0700 (PDT) To: Ferruh Yigit , Rasesh Mody , Shahed Shaikh Cc: dev@dpdk.org, stable@dpdk.org, Ajit Khaparde References: <20210510150319.1496105-1-ferruh.yigit@intel.com> <20210511114454.3923410-1-ferruh.yigit@intel.com> From: Kevin Traynor Message-ID: Date: Tue, 11 May 2021 13:26:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210511114454.3923410-1-ferruh.yigit@intel.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2 1/4] net/bnx2x: fix build with gcc11 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 11/05/2021 12:44, Ferruh Yigit wrote: > Reproduced with '--buildtype=debugoptimized' config, > compiler version: gcc (GCC) 12.0.0 20210509 (experimental) > > Build error: > In file included from ../drivers/net/bnx2x/bnx2x_rxtx.c:8: > ../drivers/net/bnx2x/bnx2x_rxtx.c: In function ‘bnx2x_upd_rx_prod_fast’: > ../drivers/net/bnx2x/bnx2x.h:1528:35: > warning: ‘rx_prods’ is used uninitialized [-Wuninitialized] > #define REG_WR32(sc, offset, val) bnx2x_reg_write32(sc, (offset), val) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ../drivers/net/bnx2x/bnx2x.h:1531:33: > note: in expansion of macro ‘REG_WR32’ > 1531 | #define REG_WR(sc, offset, val) REG_WR32(sc, offset, val) > | ^~~~~~~~ > ../drivers/net/bnx2x/bnx2x_rxtx.c:331:9: > note: in expansion of macro ‘REG_WR’ > 331 | REG_WR(sc, fp->ustorm_rx_prods_offset, val[0]); > | ^~~~~~ > ../drivers/net/bnx2x/bnx2x_rxtx.c:324:40: note: ‘rx_prods’ declared here > 324 | struct ustorm_eth_rx_producers rx_prods = { 0 }; > | ^~~~~~~~ > > REG_WR32 requires 'uint32_t', use union instead of cast to 'uint32_t'. > Bugzilla ID: 692 > Fixes: 38dff79ba736 ("net/bnx2x: update HSI") > Cc: stable@dpdk.org > > Signed-off-by: Ferruh Yigit Acked-by: Kevin Traynor > --- > Cc: rmody@marvell.com > Cc: Kevin Traynor > Cc: Ajit Khaparde > > v2: > * fix struct initialization as '{0}' -> '{{0}}' (I won't be surprised if some compiler in the ci complains, but ok on F34, gcc 11.1.1 and RHEL8.3, gcc 8.3.1) > --- > drivers/net/bnx2x/bnx2x_rxtx.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c > index 57e2ce504587..2b1760229051 100644 > --- a/drivers/net/bnx2x/bnx2x_rxtx.c > +++ b/drivers/net/bnx2x/bnx2x_rxtx.c > @@ -321,14 +321,15 @@ static inline void > bnx2x_upd_rx_prod_fast(struct bnx2x_softc *sc, struct bnx2x_fastpath *fp, > uint16_t rx_bd_prod, uint16_t rx_cq_prod) > { > - struct ustorm_eth_rx_producers rx_prods = { 0 }; > - uint32_t *val = NULL; > + union { > + struct ustorm_eth_rx_producers rx_prods; > + uint32_t val; > + } val = { {0} }; > > - rx_prods.bd_prod = rx_bd_prod; > - rx_prods.cqe_prod = rx_cq_prod; > + val.rx_prods.bd_prod = rx_bd_prod; > + val.rx_prods.cqe_prod = rx_cq_prod; > > - val = (uint32_t *)&rx_prods; > - REG_WR(sc, fp->ustorm_rx_prods_offset, val[0]); > + REG_WR(sc, fp->ustorm_rx_prods_offset, val.val); > } > > static uint16_t >