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 434BAA00C2; Thu, 23 Apr 2020 00:31:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 23AAC1C440; Thu, 23 Apr 2020 00:31:37 +0200 (CEST) Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by dpdk.org (Postfix) with ESMTP id 5EB651C439 for ; Thu, 23 Apr 2020 00:31:35 +0200 (CEST) Received: by mail-pl1-f195.google.com with SMTP id d24so1518319pll.8 for ; Wed, 22 Apr 2020 15:31:35 -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=Lb7Bp/uTgWeQLbElxf+FLBZaQSLVVdRSvzwF5VIFKfk=; b=XaM3QW2l8jOObWbL9xy3klSLMnVhTwoWe0DeQWXnf+lptYtjsi9Sw4a8j+viqmIso2 l2pzcHH30s5A0P78PuL7y2AKF/8h1CcauYAwgXKLTE0nif4F4/zbHRKvPmL7wlK2uKCP 8QgOW5sc62YTgmtCW+73oZBQI77KI09194KRNPtXjK+IdKp/red7cqILSvQuBNczSm+Z VPSsZLShJxyc6Ju4N6WDA3sf3K7pz9y/Tco0R4eShMArkRjuSeqtESj474hr5vVZTUgP l9TuCHwQcvgp94kdfYI+cAOhJ7gburGHO6xEZF9sj7t3WBxz/v4ewighWdCDZV0SIc+E fb0A== 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=Lb7Bp/uTgWeQLbElxf+FLBZaQSLVVdRSvzwF5VIFKfk=; b=XKyMg2oFUkrNS1z/s9cUF0BmH8e0ecdL4S3MNsN3kCkqFdqdjaXyzxQ6Kk5mYR+M9j 5xV/rsj8cXr3GFlCj8e6z0D5lr+rk5zHS0w/qoz0nN4/pHjsLP9gSsq8F5AJXibOZRt+ 4wxsL4oRIpz9KTbDHLGpawTmZSMTEyUkr3aaUtYn/QfRhRLgNY1UUFKygAeE582/Rx2c hF5N/WbWXJr41FfS/++GEzwbIuqbIq0nsGWG02InqHk0r3ooF5g6liC5YhhvYH/wLajo bFaizIhXcMDB1UhhN4iIqRERutFNA7NoI/wFQqpa4iupd1nAsSvhMiijzzuH7cyTqXny cN1A== X-Gm-Message-State: AGi0PubsFMbquj3RgH//lRUMbE4soK9foEYBxHISc+EsDNtFj+mXz5qP ZtPRQgYPe0Bja8H4inayxeUphi/YKMw= X-Google-Smtp-Source: APiQypI8MyVLAzmaBpvsceCtcuOmdVjUt1ATJbZ1XchCwuFo2Zgs/i8nh4wSo7S4xK9BdqFnqEsGGA== X-Received: by 2002:a17:902:5a8e:: with SMTP id r14mr892952pli.81.1587594694106; Wed, 22 Apr 2020 15:31:34 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id e66sm525785pfa.69.2020.04.22.15.31.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2020 15:31:33 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , matan@mellanox.com Date: Wed, 22 Apr 2020 15:31:30 -0700 Message-Id: <20200422223130.16842-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 v2] 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 unitilized 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 Signed-off-by: Stephen Hemminger --- v2 - add DCO 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