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 62D16C433FE for ; Wed, 26 Oct 2022 16:39:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 985FC8E0002; Wed, 26 Oct 2022 12:39:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 935588E0001; Wed, 26 Oct 2022 12:39:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8241A8E0002; Wed, 26 Oct 2022 12:39:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 737608E0001 for ; Wed, 26 Oct 2022 12:39:07 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 28B6F120F96 for ; Wed, 26 Oct 2022 16:39:07 +0000 (UTC) X-FDA: 80063660334.20.E77D62F Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf15.hostedemail.com (Postfix) with ESMTP id ACD91A003F for ; Wed, 26 Oct 2022 16:39: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 DB13FB82247; Wed, 26 Oct 2022 16:39:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07329C433C1; Wed, 26 Oct 2022 16:39:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666802343; bh=4gG/8lY0Eu0LFKD8NmUND/jh6Wol8H9kVyNLR1/Xkd0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lZ9s40w0PWSuBrI9jbQXsQpTGCfO0yEOQit3cPIl0dyiUVx+hOpGQ2xViPxxNpZro /Pe5sv2hxDtnY4ffLDegs8JA76zR/zxB2J+OE4SRQLDz/A3PwpL4+6+Ur1nFK9GEd/ DAsgRnG6ZcP/wMoaTb5D/iXrw74lXvP+wj1lh+VVA4zJlIYF/+2O4XPaOPIhDmr4Kq Z4HbaBVr7tC3ZcYs6tgJy9X0Gvd2tiRbOClzgJt90ZUwNBgddah5SFdP8Ss/AqqlYY pzv1n0WZa7SoSlIQLb1LXpUqZz4in0SuPq/3IXRYJ3/oihNK8qYzHjLoENSZ9di7SI 1axQsOAMs6bCQ== Date: Wed, 26 Oct 2022 09:39:01 -0700 From: Nathan Chancellor To: Andrew Morton 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: References: <20221025173407.3423241-1-nathan@kernel.org> <20221025184802.7d4611caff603fecf98330b6@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221025184802.7d4611caff603fecf98330b6@linux-foundation.org> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666802346; a=rsa-sha256; cv=none; b=qK397xd2bwc9N0TWJ4WmKVJ9cLm6Uka9gZziP55kRgvNJ3AVqxGKSkxDBQ+YM2YSP/SrPz +dcKpcUS3kaTlNMQORwLHlcRuSz7mmfgXgmciK7SWjbfOx1y1Nqz6vx3rVJ8fbyy6YclBG agfrLMIRyR0ztDxM9MFEGy1ZeaLNNcs= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=lZ9s40w0; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf15.hostedemail.com: domain of nathan@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=nathan@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666802346; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=2uZRGV1k32eq+7fAxNTDHqLzhljLQQEvNHm89TYZaIk=; b=VxAx2rqy2iJAL00RtrCrtYnAQ13M82dLdbBVDTkFVSnVETc8tINXq0nGRNyQr2qLx6sJDK BOa86YYycRQC2A9q1qOV5yXmin7hZuunvpE28gdhKHgvCfU+5yKKJp0Smwvic8cOtti5Yj PcCILRufGnNvmF7sLnsFyTFTmnAuVB8= X-Rspamd-Queue-Id: ACD91A003F Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=lZ9s40w0; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf15.hostedemail.com: domain of nathan@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=nathan@kernel.org X-Rspamd-Server: rspam12 X-Rspam-User: X-Stat-Signature: pbkogcyt7gjcsbm6fsnugztcqtugc3xg X-HE-Tag: 1666802346-206414 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, Oct 25, 2022 at 06:48:02PM -0700, Andrew Morton wrote: > 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. That certainly seems like a reasonable request. Thanks for letting me know! Cheers, Nathan