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 4BD11A0A0E; Tue, 11 May 2021 14:27:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 33F2D4069F; Tue, 11 May 2021 14:27:17 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id BB3D74003E for ; Tue, 11 May 2021 14:27:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620736035; 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=3V7UcaV/P078zEZYvOAUHrgk5J4UeMnD+e0G/mBI5qA=; b=N2toFAQuaImKSoScxsaonnkznKNglqllAr/sCB20w7OfAueyziEJw9TTlg41IFNy3T5/4A 4bqs1vdClfaDpuNl2txeffJ2SDBH5GVuDpKVeCwWB1OYsL/nFoF4nHg5dJvrxonUTpCrZt k9h14ZsKc9SRApyiRLsWgKofCYGC2SY= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-413-gcgwEamjMd2gGt9dh8G7Fw-1; Tue, 11 May 2021 08:27:11 -0400 X-MC-Unique: gcgwEamjMd2gGt9dh8G7Fw-1 Received: by mail-wm1-f72.google.com with SMTP id b128-20020a1c1b860000b029015b52bdb65aso989481wmb.5 for ; Tue, 11 May 2021 05:27:11 -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=3V7UcaV/P078zEZYvOAUHrgk5J4UeMnD+e0G/mBI5qA=; b=nHJ1OIOwV1hoj9qHlkmDaafU80Y5jQ6qSriHCHWWPSr7b9eulsozcsJcRjx4WFpBBu Sc45QlxAf8Un+2hKQo1OoSVC2zWqFmKN8c3K9AT4IFX+93w8+Ef7rGDwN2vHt3Q3DK5A sUGC+vGiBoCgpfFoop2rM5+fK2wRLeairAWvrN5Wjssc8uLVqYeTqAeA9Iw03eS/ehiC J/9iSUB9xifXI5aFZD6iCiK8RGgES2BlnszX9LBIUIcrPExL6WTwDfFJRdIHtej5DgEL eO+WvHLoB6Cru7v9SdTnBW+e+FrYCsN4nqeNcO6gHnreeGsfkDvn38DrPi5GeOo0MjQh bkvA== X-Gm-Message-State: AOAM533ncfQAFymL1VezHkyIcE5lR1fv+LpfCUPRt6I6XgRe3ljjFbc4 ud6kLd5Pmyvynid32/fVf7/AKfQmlKEkRYNeNEblf9HaMEFBsQguaYP9R/KoX+IK7y80rEJV6Y4 +Fgk= X-Received: by 2002:a1c:a914:: with SMTP id s20mr5196888wme.106.1620736030098; Tue, 11 May 2021 05:27:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0SzI/ThqCUpk6vm7LuFXz7/cNrbQVwIHPbismxjBGhDfUQgy5Qf1Je6j4OEuVbHXU84Ii0A== X-Received: by 2002:a1c:a914:: with SMTP id s20mr5196878wme.106.1620736029967; Tue, 11 May 2021 05:27:09 -0700 (PDT) Received: from [192.168.0.36] ([78.18.27.43]) by smtp.gmail.com with ESMTPSA id x8sm26709295wru.70.2021.05.11.05.27.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 May 2021 05:27:09 -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> <20210511114454.3923410-2-ferruh.yigit@intel.com> From: Kevin Traynor Message-ID: <4192d9b9-6e57-5694-7693-85bcf76c62ae@redhat.com> Date: Tue, 11 May 2021 13:27:08 +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-2-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 2/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.c:16: > ../drivers/net/bnx2x/bnx2x.c: In function ‘bnx2x_hc_ack_sb’: > ../drivers/net/bnx2x/bnx2x.h:1528:35: > warning: ‘igu_ack’ 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.h:1916:9: note: in expansion of macro ‘REG_WR’ > 1916 | REG_WR(sc, hc_addr, *val); > | ^~~~~~ > ../drivers/net/bnx2x/bnx2x.h:1905:33: note: ‘igu_ack’ declared here > 1905 | struct igu_ack_register igu_ack; > | ^~~~~~~ > > 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 > --- > drivers/net/bnx2x/bnx2x.h | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h > index e13ab1557418..80d19cbfd665 100644 > --- a/drivers/net/bnx2x/bnx2x.h > +++ b/drivers/net/bnx2x/bnx2x.h > @@ -1902,18 +1902,19 @@ bnx2x_hc_ack_sb(struct bnx2x_softc *sc, uint8_t sb_id, uint8_t storm, > { > uint32_t hc_addr = (HC_REG_COMMAND_REG + SC_PORT(sc) * 32 + > COMMAND_REG_INT_ACK); > - struct igu_ack_register igu_ack; > - uint32_t *val = NULL; > + union { > + struct igu_ack_register igu_ack; > + uint32_t val; > + } val; > > - igu_ack.status_block_index = index; > - igu_ack.sb_id_and_flags = > + val.igu_ack.status_block_index = index; > + val.igu_ack.sb_id_and_flags = > ((sb_id << IGU_ACK_REGISTER_STATUS_BLOCK_ID_SHIFT) | > (storm << IGU_ACK_REGISTER_STORM_ID_SHIFT) | > (update << IGU_ACK_REGISTER_UPDATE_INDEX_SHIFT) | > (op << IGU_ACK_REGISTER_INTERRUPT_MODE_SHIFT)); > > - val = (uint32_t *)&igu_ack; > - REG_WR(sc, hc_addr, *val); > + REG_WR(sc, hc_addr, val.val); > > /* Make sure that ACK is written */ > mb(); >