Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp9000833rwi; Tue, 25 Oct 2022 13:48:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4CltEloIZrC0lsB/Md3V22EqXHHfOeQWUrK9ogSDuyac+CT0HmtwalYdKABsalvlpEXPQ7 X-Received: by 2002:a17:902:7684:b0:186:8bc6:172d with SMTP id m4-20020a170902768400b001868bc6172dmr18344048pll.77.1666730927992; Tue, 25 Oct 2022 13:48:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666730927; cv=none; d=google.com; s=arc-20160816; b=QBTxncFGaIIzpxZHi4HNO1Lc+svauX4fGzmPgj5HMVFEVvmqVE+mU+E7dnEBKvXjNb wf+IbG/M2ImJGsNLZWS3Psnn/VIlwUOKtbKm/8EuvYeSlfgHePhx+kaPlp7dD7iAK7LX 32KFgPwoLrjjev90ZaF3JA8HiODdsBDLNVclDYQMTwgwUStme08DNURpvNpBth2xtehD WOZ7bn1ySjLECQHdGBt2/R//GSX2zoDDMOw2ud38l7USCR716ZdBczitjK74Zc/lpiFb gBjmtP3pezlkINWeg0ppfr7WMgO5a9H8EPYTdBErdCuksnYRzWTSKucJLS62hnf4EkDR fEJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZUtEoIyzsJsz1vsyWS2DaLcytXTJrsTlJ7uOtW9urg8=; b=D3prx5mS4RJxfJhUrtawHkgJaUrqu4YvQr7S97kqjzeJpZUos32sxa10d/cyddlvoa o3r8v6lglCVcFOwQHKUC6VTZolgpTZnDzERhLWTSJLdJpVmO4NY2zMs/oBBqwslIfj+U KkxwY09oINHjZ9xGijWHRszJ7bIOpGhDNSACPIuUDJ5btdycCTF5dCzkx6hg7ge+s904 1rSAQSCyccwLTbEmwNdwwslq1HwUrUEBC8Jj2GgLHlvdD6IoNzkPXw5eKd3awWXf1eiE G90zu3Se68RVyONCjc3mmVuXA9LukL3zvdJrBDm4mtpknZ4frSuv3mklsiEl/eaOw3rN zxKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mKgV6rEK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f9-20020a636a09000000b0042b9117b723si552670pgc.794.2022.10.25.13.48.09; Tue, 25 Oct 2022 13:48:47 -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=@kernel.org header.s=k20201202 header.b=mKgV6rEK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232769AbiJYUQc (ORCPT + 99 others); Tue, 25 Oct 2022 16:16:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232625AbiJYUQ3 (ORCPT ); Tue, 25 Oct 2022 16:16:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D55AEB97B2 for ; Tue, 25 Oct 2022 13:16:27 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 5BC2061B7C for ; Tue, 25 Oct 2022 20:16:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBF73C433B5; Tue, 25 Oct 2022 20:16:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666728986; bh=0bWEWXQ9szWygDFpBVqZPWoXaDsF27pFL+H9+4oNG1I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mKgV6rEKC3v2B7LTzxkBdnXuBTX+XjradRHuXCKxjc5OqK7G6roO4MfPZNykHxDHb dhbr8GYimGzP2Nzd4Um4L5xNDcB7URQMwMLhJuGZlbRnuoFZ/ezHH/VLLlylTp+PoA Fzr7u2+9JQLkS775of0WBAup9hvxE8+fu+5dVY3DwVX4Lk421FMeLfcbAz7Uf0SYH6 t0+QeDf2SUGFuL2o/kDesCEtHkvXJ/F01j4G80/e/divq1/2kgBznqv7ltxuEX0/HF 4hr/zvs5wAN3T1MvhT/vXDl4282pqoAPpgcVjPXA+VUd4rYZo504TwzZ7rN9lqZopv I646LQduagBZw== Date: Tue, 25 Oct 2022 13:16:24 -0700 From: Nathan Chancellor To: Naresh Kamboju Cc: linux-mm , open list , lkft-triage@lists.linaro.org, llvm@lists.linux.dev, Andrew Morton , Gautam Menghani , David Hildenbrand , Steven Rostedt , Vlastimil Babka , Yang Shi , Zach O'Keefe , "Kirill A. Shutemov" , Masami Hiramatsu Subject: Re: clang: mm/khugepaged.c:1729:7: error: variable 'index' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Wed, Oct 26, 2022 at 01:43:48AM +0530, Naresh Kamboju wrote: > Following build warning / errors noticed while building x86_64 with clang > on Linux next-20221025 tag. > > Reported-by: Linux Kernel Functional Testing > > ## Build > * kernel: 6.1.0-rc2 > * git: https://gitlab.com/Linaro/lkft/mirrors/next/linux-next > * git branch: master > * git commit: 89bf6e28373beef9577fa71f996a5f73a569617c > * git describe: next-20221025 > * test details: > https://qa-reports.linaro.org/lkft/linux-next-master-sanity/build/next-20221025 > > ## Test Regressions (compared to next-20221024) > Regressions found on x86_64: > > - clang-nightly-lkftconfig > - clang-12-lkftconfig > - clang-14-lkftconfig > - clang-13-lkftconfig > - clang-14-lkftconfig-kcsan > > make --silent --keep-going --jobs=8 > O=/home/tuxbuild/.cache/tuxmake/builds/1/build LLVM=1 LLVM_IAS=1 > ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- 'HOSTCC=sccache clang' > 'CC=sccache clang' > mm/khugepaged.c:1729:7: error: variable 'index' is used uninitialized > whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] > if (!xas_nomem(&xas, GFP_KERNEL)) { > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ > mm/khugepaged.c:2063:47: note: uninitialized use occurs here > trace_mm_khugepaged_collapse_file(mm, hpage, index, is_shmem, > ^~~~~ > mm/khugepaged.c:1729:3: note: remove the 'if' if its condition is always false > if (!xas_nomem(&xas, GFP_KERNEL)) { > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > mm/khugepaged.c:1716:6: error: variable 'index' is used uninitialized > whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] > if (result != SCAN_SUCCEED) > ^~~~~~~~~~~~~~~~~~~~~~ > mm/khugepaged.c:2063:47: note: uninitialized use occurs here > trace_mm_khugepaged_collapse_file(mm, hpage, index, is_shmem, > ^~~~~ > mm/khugepaged.c:1716:2: note: remove the 'if' if its condition is always false > if (result != SCAN_SUCCEED) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > mm/khugepaged.c:1705:15: note: initialize the variable 'index' to > silence this warning > pgoff_t index, end = start + HPAGE_PMD_NR; > ^ > = 0 > mm/khugepaged.c:1729:7: error: variable 'nr' is used uninitialized > whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] > if (!xas_nomem(&xas, GFP_KERNEL)) { > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ > mm/khugepaged.c:2064:15: note: uninitialized use occurs here > addr, file, nr, result); > ^~ > mm/khugepaged.c:1729:3: note: remove the 'if' if its condition is always false > if (!xas_nomem(&xas, GFP_KERNEL)) { > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > mm/khugepaged.c:1716:6: error: variable 'nr' is used uninitialized > whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] > if (result != SCAN_SUCCEED) > ^~~~~~~~~~~~~~~~~~~~~~ > mm/khugepaged.c:2064:15: note: uninitialized use occurs here > addr, file, nr, result); > ^~ > mm/khugepaged.c:1716:2: note: remove the 'if' if its condition is always false > if (result != SCAN_SUCCEED) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > mm/khugepaged.c:1710:8: note: initialize the variable 'nr' to silence > this warning > int nr; > ^ > = 0 > 4 errors generated. > make[3]: *** [scripts/Makefile.build:250: mm/khugepaged.o] Error 1 I sent https://lore.kernel.org/20221025173407.3423241-1-nathan@kernel.org/ for this earlier today. Cheers, Nathan