From patchwork Wed Apr 5 02:32:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kuniyuki Iwashima X-Patchwork-Id: 13201129 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53806C6FD1D for ; Wed, 5 Apr 2023 02:33:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236706AbjDECdD (ORCPT ); Tue, 4 Apr 2023 22:33:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235178AbjDECdC (ORCPT ); Tue, 4 Apr 2023 22:33:02 -0400 Received: from smtp-fw-80007.amazon.com (smtp-fw-80007.amazon.com [99.78.197.218]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79D6FE69 for ; Tue, 4 Apr 2023 19:33:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1680661982; x=1712197982; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=hWBWCxm2LaHShrz20zZpwTBHVvarWlZJRwjGKtZva8s=; b=mGmCIjPyq6kHghOZ1o/iep8r1PJ1LhXOPQXnrvLwNw+G7STmdR2jr4FY xj/c3Zs2a+c5GvX5RNfbgKHbe2xwoRrFiKL4NEvC8ihYiTHYjKxgA10BH pilo/ABQ2hxseIjjjha5joGVoyjPVIGgjinNmoM8WYZ0W3cXHyzq2pm23 k=; X-IronPort-AV: E=Sophos;i="5.98,319,1673913600"; d="scan'208";a="201104105" Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO email-inbound-relay-pdx-2a-m6i4x-83883bdb.us-west-2.amazon.com) ([10.25.36.214]) by smtp-border-fw-80007.pdx80.corp.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2023 02:33:00 +0000 Received: from EX19MTAUWA002.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-pdx-2a-m6i4x-83883bdb.us-west-2.amazon.com (Postfix) with ESMTPS id F1DA261502; Wed, 5 Apr 2023 02:32:58 +0000 (UTC) Received: from EX19D004ANA001.ant.amazon.com (10.37.240.138) by EX19MTAUWA002.ant.amazon.com (10.250.64.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 5 Apr 2023 02:32:49 +0000 Received: from 88665a182662.ant.amazon.com (10.106.100.18) by EX19D004ANA001.ant.amazon.com (10.37.240.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 5 Apr 2023 02:32:47 +0000 From: Kuniyuki Iwashima To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: Coco Li , Kuniyuki Iwashima , Kuniyuki Iwashima , Subject: [PATCH v1 net-next] selftest/net: Fix uninit val warning in tcp_mmap.c. Date: Tue, 4 Apr 2023 19:32:36 -0700 Message-ID: <20230405023236.10128-1-kuniyu@amazon.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Originating-IP: [10.106.100.18] X-ClientProxiedBy: EX19D046UWB001.ant.amazon.com (10.13.139.187) To EX19D004ANA001.ant.amazon.com (10.37.240.138) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Commit 5c5945dc695c ("selftests/net: Add SHA256 computation over data sent in tcp_mmap") forgot to initialise a local var. $ make -s -C tools/testing/selftests/net tcp_mmap.c: In function ‘child_thread’: tcp_mmap.c:211:61: warning: ‘lu’ may be used uninitialized in this function [-Wmaybe-uninitialized] 211 | zc.length = min(chunk_size, FILE_SZ - lu); | ^ Fixes: 5c5945dc695c ("selftests/net: Add SHA256 computation over data sent in tcp_mmap") Signed-off-by: Kuniyuki Iwashima --- Note that the cited commit is not merged in net.git. --- tools/testing/selftests/net/tcp_mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/tcp_mmap.c b/tools/testing/selftests/net/tcp_mmap.c index 607cc9ad8d1b..1056e37f4d98 100644 --- a/tools/testing/selftests/net/tcp_mmap.c +++ b/tools/testing/selftests/net/tcp_mmap.c @@ -168,7 +168,7 @@ void *child_thread(void *arg) double throughput; struct rusage ru; size_t buffer_sz; - int lu, fd; + int lu = 0, fd; fd = (int)(unsigned long)arg;