From patchwork Thu Sep 5 09:32:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 58635 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0DF1A1EF6D; Thu, 5 Sep 2019 11:33:04 +0200 (CEST) Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by dpdk.org (Postfix) with ESMTP id 5AB851EDD0 for ; Thu, 5 Sep 2019 11:32:48 +0200 (CEST) Received: by mail-lj1-f196.google.com with SMTP id y23so1380375ljn.5 for ; Thu, 05 Sep 2019 02:32:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OOTwzgVVZbZgLcv17CgsjgDYfH2VrYmyoKk+LqKCjhc=; b=PrQPlE3YgWSRmXrbu6fxAsrbbNvkDu4MLk/daDDMJgfdff63a0q1gPYc8TgzFIfmmQ NTLaECFK6U84trGpc2qldc3BLz8q/SqqTSqUKiE+xD/kRRxwkFwn++JM0X+mRdqJzaXI OQM7qVWBEfJj4hPPMytdiqdYFeU6m+jwuEHKUt/xGtWRaU+hpkriLk051Wf4pzIxx6SV a9YoKT663xanY4QNhF8TMSN3rHYr4jsxn6Uw5ZzGjthPp6lwTkBw1+BWzuTJ6e6UufHP 72yuhCY25o4SvPG66J/DgzNssqPcyfjIrcLWqTETbMjZjWmu5oeceX6mrW+IzlcpU03g JpFg== 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=OOTwzgVVZbZgLcv17CgsjgDYfH2VrYmyoKk+LqKCjhc=; b=AA7FIvHNGJe+YLD8BQbGCkx7MQ5SaptO5CS3kKI+2tv6W1rHBLaBpkpQcK2Ej9SvRE /+gTEy9E25gfTlAmGKOqIJWIw15X7jzWYWzeG7G0Z9kjTgrolZY3YRAKKUGJZ4GqcN9M ieAvYxoM9uPfGXDVLY5pOFJXfqZA/aS1QVx1ObS4XUB6C/RdNM/x1LkWWwRz50oIIVhB lRIxDXYUELG+0xhPFrJdHMdtL+MgHDepemdrOdVzlMqGROV9X733D1Hip1htv1QB9TBC o1wjyjlVuIDIfLqwqHtIrYYMKhGnN/3cE/DaEzuSxJpmOX5aqeYuVWm8pujT43IEwbhc xKTA== X-Gm-Message-State: APjAAAUaupYWCOjV6Ux1kq24sAt2VoG2KmzKqKYnOkt//qnuNBuhiAQ+ sl/235txAqcElPhTvwcjLwYDrqcj9qvkSQ== X-Google-Smtp-Source: APXvYqyfz8JUoOEenl9rVVpI/Pgrh3HUj5RWaIScuKgTGJi61biiEJJHqLBEq5vRfXMwXJAxf4IaCg== X-Received: by 2002:a2e:984e:: with SMTP id e14mr1410538ljj.167.1567675967865; Thu, 05 Sep 2019 02:32:47 -0700 (PDT) Received: from localhost.localdomain (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.googlemail.com with ESMTPSA id b25sm363060lfa.90.2019.09.05.02.32.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 02:32:47 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org Cc: Andrzej Ostruszka Date: Thu, 5 Sep 2019 11:32:39 +0200 Message-Id: <20190905093239.27187-11-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190905093239.27187-1-amo@semihalf.com> References: <20190905093239.27187-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH 10/10] net/qede: fix maybe-uninitialized warnings for LTO build X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" During LTO build compiler reports some 'false positive' warnings about variables being possibly used uninitialized. This patch silences these warnings. Signed-off-by: Andrzej Ostruszka --- drivers/net/qede/base/ecore_mcp.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/qede/base/ecore_mcp.c b/drivers/net/qede/base/ecore_mcp.c index 6c6560688..666c0fe12 100644 --- a/drivers/net/qede/base/ecore_mcp.c +++ b/drivers/net/qede/base/ecore_mcp.c @@ -2278,7 +2278,7 @@ enum _ecore_status_t ecore_mcp_trans_speed_mask(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, u32 *p_speed_mask) { - u32 transceiver_type, transceiver_state; + u32 transceiver_type = ETH_TRANSCEIVER_TYPE_NONE, transceiver_state; ecore_mcp_get_transceiver_data(p_hwfn, p_ptt, &transceiver_state, &transceiver_type); @@ -3163,7 +3163,8 @@ enum _ecore_status_t ecore_mcp_nvm_put_file_begin(struct ecore_dev *p_dev, enum _ecore_status_t ecore_mcp_nvm_write(struct ecore_dev *p_dev, u32 cmd, u32 addr, u8 *p_buf, u32 len) { - u32 buf_idx, buf_size, nvm_cmd, nvm_offset, resp, param; + u32 buf_idx, buf_size, nvm_cmd, nvm_offset; + u32 resp = FW_MSG_CODE_ERROR, param; struct ecore_hwfn *p_hwfn = ECORE_LEADING_HWFN(p_dev); enum _ecore_status_t rc = ECORE_INVAL; struct ecore_ptt *p_ptt; @@ -3370,7 +3371,7 @@ enum _ecore_status_t ecore_mcp_gpio_read(struct ecore_hwfn *p_hwfn, u16 gpio, u32 *gpio_val) { enum _ecore_status_t rc = ECORE_SUCCESS; - u32 drv_mb_param = 0, rsp; + u32 drv_mb_param = 0, rsp = 0; drv_mb_param = (gpio << DRV_MB_PARAM_GPIO_NUMBER_OFFSET); @@ -3391,7 +3392,7 @@ enum _ecore_status_t ecore_mcp_gpio_write(struct ecore_hwfn *p_hwfn, u16 gpio, u16 gpio_val) { enum _ecore_status_t rc = ECORE_SUCCESS; - u32 drv_mb_param = 0, param, rsp; + u32 drv_mb_param = 0, param, rsp = 0; drv_mb_param = (gpio << DRV_MB_PARAM_GPIO_NUMBER_OFFSET) | (gpio_val << DRV_MB_PARAM_GPIO_VALUE_OFFSET); @@ -3481,7 +3482,7 @@ enum _ecore_status_t ecore_mcp_bist_clock_test(struct ecore_hwfn *p_hwfn, enum _ecore_status_t ecore_mcp_bist_nvm_test_get_num_images( struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, u32 *num_images) { - u32 drv_mb_param = 0, rsp; + u32 drv_mb_param = 0, rsp = 0; enum _ecore_status_t rc = ECORE_SUCCESS; drv_mb_param = (DRV_MB_PARAM_BIST_NVM_TEST_NUM_IMAGES << @@ -3865,7 +3866,7 @@ enum _ecore_status_t __ecore_mcp_resc_lock(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, struct ecore_resc_lock_params *p_params) { - u32 param = 0, mcp_resp, mcp_param; + u32 param = 0, mcp_resp = 0, mcp_param = 0; u8 opcode; enum _ecore_status_t rc;