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 3B045FA3740 for ; Tue, 25 Oct 2022 20:16:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 923BD8E0002; Tue, 25 Oct 2022 16:16:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8D4958E0001; Tue, 25 Oct 2022 16:16:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 79BC68E0002; Tue, 25 Oct 2022 16:16:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 66CA78E0001 for ; Tue, 25 Oct 2022 16:16:35 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 1CA3DA1157 for ; Tue, 25 Oct 2022 20:16:35 +0000 (UTC) X-FDA: 80060579550.20.B5E5E32 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf27.hostedemail.com (Postfix) with ESMTP id 1569040012 for ; Tue, 25 Oct 2022 20:16:32 +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 sin.source.kernel.org (Postfix) with ESMTPS id 774A9CE1F0C; Tue, 25 Oct 2022 20:16:28 +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: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666728993; a=rsa-sha256; cv=none; b=uiFmptferYLj/hlhTj1lx6BIU82QkPI3NblPX3WPS1cUUsvTo4NLNpTyhvSQB0MX55izWh GxiuTcwnYJvqHhV6VOZyuLCDOej9cSnUgV7qPmXP1jnRjrUNgBEdKC86BrkM+sjdNjAL70 dV/6PEG6DeqFIodqtekXr5nOjVJEtnI= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mKgV6rEK; spf=pass (imf27.hostedemail.com: domain of nathan@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=nathan@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666728993; 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=ZUtEoIyzsJsz1vsyWS2DaLcytXTJrsTlJ7uOtW9urg8=; b=3g/caowCymtPHwuLaMCTeD7/eP2ot/byPV7mjQU2NcceVgNW1qW02iBMcTQOs+GbvRAUlU EEnQUnDOgvIeFMUKacsbcwLnHjGl9TFbMHYlh35PR3A8YBqrQeb31Wo9ZntNbavBS+ZuvI tHyhotyi15ZY6Zq/wqeveEhx6C5cfqs= X-Rspamd-Queue-Id: 1569040012 X-Rspam-User: Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mKgV6rEK; spf=pass (imf27.hostedemail.com: domain of nathan@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=nathan@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam04 X-Stat-Signature: dckyfcrhjko115c34ambbjrkmhrk1fte X-HE-Tag: 1666728992-432584 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 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