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 2B6A0A04E7; Sun, 29 Nov 2020 18:55:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8A35DC99C; Sun, 29 Nov 2020 18:54:59 +0100 (CET) Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by dpdk.org (Postfix) with ESMTP id 2249FC86E for ; Sun, 29 Nov 2020 18:54:54 +0100 (CET) Received: by mail-pl1-f195.google.com with SMTP id u2so5162048pls.10 for ; Sun, 29 Nov 2020 09:54:54 -0800 (PST) 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:in-reply-to:references :mime-version:content-transfer-encoding; bh=g7pzjkA5EwGXh+RTbiPd2mm1I1pqZEiIlbzsMU7n4Vg=; b=L3N/WweE0HETdPNy6zsJsd/yHUqwztxmOMpDIR0jJtL5r18e+4l91DtSrftoK2CUEb BV6HS86AymF+EaTQd+jPhfrqcnDog6geYD8GBKtMIGdRd+Gwl0zMfacWguhPFLrH5sHY WIi5P6VBqdzcXK9kJiGd0K6OrTOaVwkMNinDNZoWgY3CkYlzpUozdadC1G8CjTj3rj7S 9i0TFHpzLkbcwqb42NPipijIzLKtQY33gi7nmqrMmX8/y/OZERFGpjT+gtd2j/fwUI0y YnjPi4PfmkkCIqCyXaPJ+VvMG7dFmEDKbiguLUOiGJ+dQ5qZH3WrG3g6GgCWLcClhb9w 9tBg== 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:content-transfer-encoding; bh=g7pzjkA5EwGXh+RTbiPd2mm1I1pqZEiIlbzsMU7n4Vg=; b=hS+ptvnjzuQ1VRGeFYedbKCvAcXvKHVzyhQkN3gAc/WT+KoHn4Z6MvvEGA71KPEs3q 4l0Qmg+pfUkkfbi2liEAwSMQAd9Nml+7A0OHtU2gJT+/Hzzqc8DdlMEwXP65wttgC9W5 VrdwP4T3HWsITpXRNVDeruOvR5dZHBfdSc9FAcRY5V4o3efxfDhOegYFOdy/iqsA50US dIf3JMBVpsHoMy+2TQa/rOWK0+7/8sEwzdU6i+EqM1DW/wWCCEmTjdr0kQ6WMEquCnTI jJ2QGpwOvAtucBkfCefiQtCS5M9csQ25zDnZQoLSLMApknknAw4vUjoU7S80j1w8+3mu eaHQ== X-Gm-Message-State: AOAM530iJIi/Y36c7enJLLzlR0A2DRN7iUDX1X4oeuJoZfkDC/xvZ1X0 ITXb5+5Lgfq9F713lAUL0LptcUIaiIdlLjK3 X-Google-Smtp-Source: ABdhPJySjqNnCHZcGxobKH3wsR5PV7CJWuAQEEmjAy9zwIycVubbd7oRqxrWtd5MNIojdG12ZQzABg== X-Received: by 2002:a17:902:22e:b029:d9:e591:7bd1 with SMTP id 43-20020a170902022eb02900d9e5917bd1mr15335035plc.50.1606672491789; Sun, 29 Nov 2020 09:54:51 -0800 (PST) Received: from hermes.local (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id l23sm13114850pgn.40.2020.11.29.09.54.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2020 09:54:50 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , shalomt@mellanox.com Date: Sun, 29 Nov 2020 09:54:33 -0800 Message-Id: <20201129175437.15346-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201129175437.15346-1-stephen@networkplumber.org> References: <20201129175437.15346-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 1/5] devlink: fix unitialized 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-10 complains about uninitialized variable. devlink.c: In function ‘cmd_dev’: devlink.c:2803:12: warning: ‘val_u32’ may be used uninitialized in this function [-Wmaybe-uninitialized] 2803 | val_u16 = val_u32; | ~~~~~~~~^~~~~~~~~ devlink.c:2747:11: note: ‘val_u32’ was declared here 2747 | uint32_t val_u32; | ^~~~~~~ This is a false positive because it can't figure out the control flow when the parse returns error. Simplest fix is to initialize variable. Fixes: 2557dca2b028 ("devlink: Add string to uint{8,16,32} conversion for generic parameters") Cc: shalomt@mellanox.com Signed-off-by: Stephen Hemminger --- devlink/devlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devlink/devlink.c b/devlink/devlink.c index 1ff865bc5c22..ca99732efd00 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -2744,7 +2744,7 @@ static int cmd_dev_param_set(struct dl *dl) struct param_ctx ctx = {}; struct nlmsghdr *nlh; bool conv_exists; - uint32_t val_u32; + uint32_t val_u32 = 0; uint16_t val_u16; uint8_t val_u8; bool val_bool; -- 2.29.2