From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 113E1A00C2; Thu, 23 Apr 2020 00:28:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7AA861C439; Thu, 23 Apr 2020 00:28:46 +0200 (CEST) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id 84A861C2E6 for ; Thu, 23 Apr 2020 00:28:45 +0200 (CEST) Received: by mail-pf1-f194.google.com with SMTP id v63so1863117pfb.10 for ; Wed, 22 Apr 2020 15:28:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UX9IIZkqxom054QeMUVusZPo70CBLLpt+9Q+LZmo/OU=; b=aITKtO59ist64z3VnA5kI8DQZcGurgKmtRsfJKWPJbE9ma75OZkhOzZzRt9MUYkOlr lhf4gtrUzB1KGJTEU3ukag7gbj5YLhZh4Pee83vvNNCzOUzxNLxl78A2UBZn3wFrxKNP FKR2hUaW4qc7kY0NQghfB7K+3jgltZbSQw+dmz9kqirks67ukEk3i0aNSVJjYtp8Aifw 9ZnC+UPd3+i3hbqDdCK1VsFcJ2RXUaLF0Sx5kEfOIFTR6iCAFOMc17RzWvjqA/hW2ksi pUIP6SDD1ada50SigHi4zXt8dBObO/ebH9kBJJ2DTcy7SSr4A2moAfx8Qqa9zRS+QOLX OW+w== 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:mime-version :content-transfer-encoding; bh=UX9IIZkqxom054QeMUVusZPo70CBLLpt+9Q+LZmo/OU=; b=V5Q9UtRCiQIDV66I2i8HZJSrLBUxizLLQm5FEfbtD7qPA9a28G+16OetNIO4UbrGck g7/+ORlFL6huX83AcK2K6HbSgKoe69wTkB3gqShTl0yO/d5oBmsZ58mpJhg5dEu+dEmV ohbqTXY8lQbKqTmNJqLAJqo2t3osrjE7cj8hrUXt1ILYYov25XE9TY0TCPI56+Ve+qUj 01CYAbUxHWIn4k4WkS6jdPnEdLTQsGWhVJIN6C1EVqzUj/VraQ4578f/1kXy5f3WtX2z KwDtfOXrSsNoPkeS1TT1JK2cxc4Mynz+ixf/fR2bsicg1/DjjT8O36j3WVHmgmfgi8W9 k+zg== X-Gm-Message-State: AGi0PuYwZ9FAVrqzFqShmzKgOS4NpN6QJA+JpuN5CPmcCV2S3fx5plmI WbZrHvsBPyt2jdv5R41nw/vbGuVFAGI= X-Google-Smtp-Source: APiQypK+EfztnZN6+XXeWNU7PlCQ5EiOADmGjmuSeC2DpeskkFdKL7cHJDzoRMhd6hVOrqNqAF0sgQ== X-Received: by 2002:a62:2783:: with SMTP id n125mr769259pfn.133.1587594523942; Wed, 22 Apr 2020 15:28:43 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id b24sm517379pfd.175.2020.04.22.15.28.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2020 15:28:42 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , matan@mellanox.com Date: Wed, 22 Apr 2020 15:28:34 -0700 Message-Id: <20200422222834.16480-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] common/mlx5: fix uninitialized variable warning 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" Gcc 8.3.0 (Debian 10) complains about uninitialized variable. [474/2122] Compiling C object 'drivers/a715181@@tmp_rte_common_mlx5@sta/common_mlx5_mlx5_nl.c.o'. In file included from ../drivers/common/mlx5/mlx5_nl.h:12, from ../drivers/common/mlx5/mlx5_nl.c:23: ../drivers/common/mlx5/mlx5_nl.c: In function ‘mlx5_nl_enable_roce_get’: ../drivers/common/mlx5/mlx5_common.h:68:2: warning: ‘cur_en’ may be used uninitialized in this function [-Wmaybe-uninitialized] rte_log(RTE_LOG_ ## level, \ ^~~~~~~ ../drivers/common/mlx5/mlx5_nl.c:1560:6: note: ‘cur_en’ was declared here int cur_en; ^~~~~~ The compiler is correct, this variable would only be set if kernel netlink response message contains the DEVLINK parameter that flags if ROCE is enabled. Fixes: fa69eaef5f49 ("common/mlx5: support ROCE disable through Netlink") Cc: matan@mellanox.com --- drivers/common/mlx5/mlx5_nl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/common/mlx5/mlx5_nl.c b/drivers/common/mlx5/mlx5_nl.c index 847e78dbcea6..c6014c3ee0b3 100644 --- a/drivers/common/mlx5/mlx5_nl.c +++ b/drivers/common/mlx5/mlx5_nl.c @@ -1557,7 +1557,7 @@ mlx5_nl_enable_roce_get(int nlsk_fd, int family_id, const char *pci_addr, struct genlmsghdr *genl; uint32_t sn = MLX5_NL_SN_GENERATE; int ret; - int cur_en; + int cur_en = 0; uint8_t buf[NLMSG_ALIGN(sizeof(struct nlmsghdr)) + NLMSG_ALIGN(sizeof(struct genlmsghdr)) + NLMSG_ALIGN(sizeof(struct nlattr)) * 4 + -- 2.20.1