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 A308AA0548; Fri, 9 Jul 2021 17:37:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6ED79410F9; Fri, 9 Jul 2021 17:37:41 +0200 (CEST) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mails.dpdk.org (Postfix) with ESMTP id CDB184014D for ; Fri, 9 Jul 2021 17:37:39 +0200 (CEST) Received: by mail-pl1-f172.google.com with SMTP id u3so85475plf.5 for ; Fri, 09 Jul 2021 08:37:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version; bh=G9GyILbj6z8QVhK67ZMzKci3AAW+wj5jFU9biQ8TSHc=; b=aQUbkDEd50YkR1yoTrHz46nfLhUgQScQ5E927D5qnRQZU2GAllMMYodSgA8Cb42RlP CSClkKGkXZ004BuNffK+35r7zbT4lDUYIV//AIdzi36F7UaZbECaDBKxpIBu37fg2rsY mrBl32CEX+OB0og+DRXpuyveBOliRPW1y0c5g= 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:mime-version; bh=G9GyILbj6z8QVhK67ZMzKci3AAW+wj5jFU9biQ8TSHc=; b=NRowVrPDrh80uBw6PCvB415jii9BI+Dqf0gKlGeb9M7J9PmmkxTAAcC8NNznDbF5A3 KvQ02P8BlPdBApdR0JauSCpiPJWWteO29ROMzCIKZBOcM2BBqP/a5n5g2ZWkSwcT8++o q6UCx1Ues6Y+LD2NOztB2L80cgdN1AkVpiTo18cbqlCkcEzLyBBltIvKYKv2sziVO7G0 AwyKiAgb+3j1wnSn8ZB0yXksiEFq5xZPywV+KvMi6t2zFnvBmO51ESCCfi+YUETzQkBn d3ht/bax5XSUK6mAxG0AiTlEhazBDd41+A4p2bo6WSOBCPotzLizh0oJ2k0p6bL1Uz60 mPcg== X-Gm-Message-State: AOAM5335NF9lmvtZYufDyQf5U8wN1UC6nfbv6kbVjB9JBx0Y6HNKR90V 8xehTYvjEj9/p2SdTis5lTsPFsHfvA07yj0JTicA3hoAwOQZRN6PlmTrV7RVvIV1Px3i1PGnuxa tbgXIeR3MxF5LRy/nzSywrI+Ca5NkCS1hPRDq2wydWlYMMVvxOvbtPS7R+AQGT8Q= X-Google-Smtp-Source: ABdhPJxQhUIV40BL/Fb7XVLg/aCvsG4PTrl0MO57KU5EQsyXQkCiDPUcYAKoUgyEXiHWKcFWEiX2Xg== X-Received: by 2002:a17:902:d64d:b029:12a:cd06:45d3 with SMTP id y13-20020a170902d64db029012acd0645d3mr6308749plh.47.1625845058474; Fri, 09 Jul 2021 08:37:38 -0700 (PDT) Received: from localhost.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id n22sm7164098pff.57.2021.07.09.08.37.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jul 2021 08:37:36 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: thomas@monjalon.net, Kishore Padmanabha Date: Fri, 9 Jul 2021 08:37:25 -0700 Message-Id: <20210709153725.87348-1-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: References: MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="00000000000034876a05c6b28df9" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [dpdk-dev] [PATCH v2] net/bnxt: fix build failure 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" --00000000000034876a05c6b28df9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix build failures because of uninitialized variables. ../drivers/net/bnxt/tf_ulp/ulp_mapper.c: In function ‘ulp_mapper_index_tbl_process’: ../drivers/net/bnxt/tf_ulp/ulp_mapper.c:2252:43: error: ‘*(unsigned int *)((char *)&glb_res + offsetof(struct bnxt_ulp_glb_resource_info, resource_func))’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 2252 | struct bnxt_ulp_glb_resource_info glb_res; | ^~~~~~~ ../drivers/net/bnxt/tf_ulp/ulp_mapper.c:2252:43: error: ‘glb_res.resource_type’ may be used uninitialized in this function [-Werror=maybe-uninitialized] ../drivers/net/bnxt/tf_core/dpool.c: In function ‘dpool_defrag’: ../drivers/net/bnxt/tf_core/dpool.c:95:18: error: ‘index’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 95 | uint32_t index; | ^~~~~ Fixes: 05b405d58148 ("net/bnxt: add dpool allocator for EM allocation") Signed-off-by: Kishore Padmanabha Signed-off-by: Ajit Khaparde --- v1->v2: update commit log to show the build error encountered. --- drivers/net/bnxt/tf_core/dpool.c | 1 + drivers/net/bnxt/tf_ulp/ulp_mapper.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/tf_core/dpool.c b/drivers/net/bnxt/tf_core/dpool.c index 0dae42b1bb..145efa486f 100644 --- a/drivers/net/bnxt/tf_core/dpool.c +++ b/drivers/net/bnxt/tf_core/dpool.c @@ -125,6 +125,7 @@ int dpool_defrag(struct dpool *dpool, largest_free_size = 0; largest_free_index = 0; count = 0; + index = 0; for (i = 0; i < dpool->size; i++) { if (DP_IS_FREE(dpool->entry[i].flags)) { diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c index acd9f996e8..871dbad0fe 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c +++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c @@ -2249,7 +2249,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms, struct tf_free_tbl_entry_parms free_parms = { 0 }; uint32_t tbl_scope_id; struct tf *tfp; - struct bnxt_ulp_glb_resource_info glb_res; + struct bnxt_ulp_glb_resource_info glb_res = { 0 }; uint16_t bit_size; bool alloc = false; bool write = false; -- 2.21.1 (Apple Git-122.3) --00000000000034876a05c6b28df9--