Received: by 2002:a05:6358:bb9d:b0:db:4290:4c0c with SMTP id df29csp9875rwb; Tue, 25 Oct 2022 19:03:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5+ZXtPK5jd9LyrTsCVg544FrqyN653zy1Y0z+Cvd3EJXXzTYwGJas7ZhMliK/Zm4V1jit2 X-Received: by 2002:a17:902:a606:b0:178:57e4:a0c1 with SMTP id u6-20020a170902a60600b0017857e4a0c1mr41026288plq.83.1666749797864; Tue, 25 Oct 2022 19:03:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666749797; cv=none; d=google.com; s=arc-20160816; b=ZhDUk46LW2i1Qz18Pln5eL5FL8l1Naw7bPLNQqKTIg3zBMp2JYJ20pDnnfAgj+jWpE dk4SM9MNZ7mErI84LYgnhrlPSsnRhJ32VjTnVd8xNf5Fni0a0xb3IczXBsNTsABrUo96 EWpQ/J8RnXzDeB/DCCUqhDzthIxgFEuXK3VnvnUbv+UuUwauGhTanZihuF8B3V5tn+CM 4Aq2awi/Npv5NujmFJorWnEWSDhRMftMfA8Y6kOpg67zkfC5b+bQvJZoMipW/5abp8HC 4hBvcWdxqNd5UXZvPR8h6UbH2JGyvwWeKOaszAF3sS6uZDGywUvn0fTI9oyDvEGQIDE6 Zgbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=fAldURgDeeRy4xjNhafXsJBBw6nKgKuJQYZvp316FM8=; b=mDx2uf4/znYaWyRDDUbeiI5hQ8FMEwHh83zOZEifCQGomO9Cqzbv3nnBZITWahm1wk uMnXprIqt0SP3iSf/IgPMqy7BjE/I2gg5usqTrIMysXcJ3UAyWgiZ8yh48Dg0eY1QBho e3EOcdVjXSPrSOaLjZ/nExOUY7qiQkrQUif7Je+9XOb7WJcSkuIHcOUuQ6a6OQA4JPK9 Bo3SKfJ7TcvPjp+Rg/1Afhrhrac8xBqLBqo7Wk4ltf6NYUbrVrEZlFE+zrONbGOI5pMu 957dnrmunWnSKSlEzWrgqbvMInphb5lF++Mg1o3Je209TZLii3LAJs8uZ5qVQSwuo4J2 qSGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=MOLScLug; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k9-20020a63d849000000b0041cefab5b61si5004891pgj.719.2022.10.25.19.03.05; Tue, 25 Oct 2022 19:03:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=MOLScLug; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232625AbiJZBsK (ORCPT + 99 others); Tue, 25 Oct 2022 21:48:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232614AbiJZBsH (ORCPT ); Tue, 25 Oct 2022 21:48:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 371F7A8359 for ; Tue, 25 Oct 2022 18:48:07 -0700 (PDT) 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 E8F17B81FE6 for ; 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 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.