From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA7DFC38A02 for ; Wed, 26 Oct 2022 01:48:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 175998E0002; Tue, 25 Oct 2022 21:48:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 125BC8E0001; Tue, 25 Oct 2022 21:48:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F2FA08E0002; Tue, 25 Oct 2022 21:48:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id DFC108E0001 for ; Tue, 25 Oct 2022 21:48:07 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B2DEAAB40B for ; Wed, 26 Oct 2022 01:48:07 +0000 (UTC) X-FDA: 80061415014.18.B76914F Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf16.hostedemail.com (Postfix) with ESMTP id 42AB9180031 for ; Wed, 26 Oct 2022 01:48:06 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E6143B81F88; Wed, 26 Oct 2022 01:48:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9257C433D6; Wed, 26 Oct 2022 01:48:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1666748884; bh=DeNUe/+thSCrXVF482VVO4niwzLe1FwTzl3oKIQ+v/Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MOLScLugkE2Xjrku4vNwQQ2x+3ut851N45uuEkEn3TPLzBwaoNrRV1WlJZ31GRhOV tnvPZ2EUF96cYEVKfXieBiQAcOiLArtryDwevpxqzdKIMFCN1A9sIZubhBoB3V237n 412KLgsmhKWF4KYtegvDx8hqWvWNsXQAywd6RbyI= Date: Tue, 25 Oct 2022 18:48:02 -0700 From: Andrew Morton To: Nathan Chancellor Cc: Gautam Menghani , Nick Desaulniers , Tom Rix , linux-mm@kvack.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev, kernel test robot Subject: Re: [PATCH] mm/khugepaged: Initialize index and nr in collapse_file() Message-Id: <20221025184802.7d4611caff603fecf98330b6@linux-foundation.org> In-Reply-To: <20221025173407.3423241-1-nathan@kernel.org> References: <20221025173407.3423241-1-nathan@kernel.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666748887; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=fAldURgDeeRy4xjNhafXsJBBw6nKgKuJQYZvp316FM8=; b=DgloKAq4s6MtMGgfhaSNRreDLcnys82sj2Or5e2JpW//xHBI6xwn0kCJd707hFRewEYTem EqphWKDVokINmQFwd3yzbgP8/VIYqNRjDmTXMvc5YMzwajiFbjjCJADxLdclag4kDE9OlS Lz08GpW5OJF9VtvM8qEOo+vWWkX2JpY= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=MOLScLug; spf=pass (imf16.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666748887; a=rsa-sha256; cv=none; b=v5+iUoJ1BaajC1buAOO59jGoxz5xJzXctaFL8oCgfaJnkGEClCFmiEp5fHORyIiSvLFD1f xjBCBPSHlWh4NPgbAnYRA1evYsvzKzwi44J06mT/tGPkvP7PF0I8F7YvyiAvRO8D9Ayuro C0kjWN2/9exJZXyUWuNIHlgXdFHvwpo= Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=MOLScLug; spf=pass (imf16.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Stat-Signature: z6mtgs4f8xww3htmizskthq1ix4tb3az X-Rspamd-Queue-Id: 42AB9180031 X-Rspamd-Server: rspam07 X-Rspam-User: X-HE-Tag: 1666748886-753209 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, 25 Oct 2022 10:34:07 -0700 Nathan Chancellor wrote: > Clang warns (trimmed for brevity): > > mm/khugepaged.c:1729:7: warning: variable 'index' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] > mm/khugepaged.c:1716:6: warning: variable 'index' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] > mm/khugepaged.c:1729:7: warning: variable 'nr' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] > mm/khugepaged.c:1716:6: warning: variable 'nr' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] > > There are two goto statements that will use index and nr before they > have been properly initialized. Zero initialize them so that they can be > safely used by the tracepoint at the end of the function. Thanks. I've actually dropped the offending patch - I'd like a resend which includes a fix such as this and a good reason for making the change.