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 C5766C6FD1D for ; Thu, 23 Mar 2023 09:43:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 20F3D6B0075; Thu, 23 Mar 2023 05:43:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 198476B0078; Thu, 23 Mar 2023 05:43:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 038126B007E; Thu, 23 Mar 2023 05:43:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id E52366B0075 for ; Thu, 23 Mar 2023 05:43:26 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B54A6AAC40 for ; Thu, 23 Mar 2023 09:43:26 +0000 (UTC) X-FDA: 80599675212.10.C057940 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf10.hostedemail.com (Postfix) with ESMTP id B9896C0015 for ; Thu, 23 Mar 2023 09:43:23 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=y4bAYuP0; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=lCCTR4LT; spf=pass (imf10.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679564604; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=klNWhIy8hiXGSUgaFtlmoMw45I3AHJjiiJxXlBCB2YE=; b=aGZ/wA+KipClaAScR4UmqTq88rSgNBFQrk4jlXbz5o1YXvppi5tqdvpaD7Oh8LUzVypPg3 pXZqKQRfz127PUP1FqAGAtXZKwXH2Y8jvLjQHunLFdISxJz6TR/AkbqfDNzhZLeNO50Dcx sirXmqt957zqdH4OtgvghWDZoNVSyX4= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=y4bAYuP0; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=lCCTR4LT; spf=pass (imf10.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679564604; a=rsa-sha256; cv=none; b=exR67IZUEA9HPMrAWor/Sr8QAPUGzMyKR0hYHfCosKu01SLaiLRd9QNHaqB3ASOhM2dQCW lhtKGVLB7FZABI1Xu5sXMQ+6AKKMbS0H4xMjeZw0cUIGHBZFAdhf+BidPkQxfc7rZL12OR uwtfRMMSbGn8KG650jqKUV1c+rqTc/g= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0468A33AFE; Thu, 23 Mar 2023 09:43:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1679564602; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=klNWhIy8hiXGSUgaFtlmoMw45I3AHJjiiJxXlBCB2YE=; b=y4bAYuP0tUJ3WO7M9lYm1GYFACckupaP7f4nLoIji81aKWP13DWy7vrrxxcK+E/DnRROQy OzxG4JcYmNC9gf4Lq3S7tEMWWmzgw9yw+lupH3uAtlc42Rgj+nSwO9iuFPAIPXMoymZCi7 IjgcsnSULtkBXblwaSPAXU7/r3nNa9I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1679564602; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=klNWhIy8hiXGSUgaFtlmoMw45I3AHJjiiJxXlBCB2YE=; b=lCCTR4LTrC40Hd8pcwb7sUO5Hc564tiR4anU1tdXp0GhiqbkppSIVUSZOvAah/90rHxqz6 aTVZYD0sd55bwLCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D3BE6132C2; Thu, 23 Mar 2023 09:43:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CZGvMjkfHGToTwAAMHmgww (envelope-from ); Thu, 23 Mar 2023 09:43:21 +0000 Message-ID: <1fcc9df0-10a6-f31c-e3d3-e2474c9da817@suse.cz> Date: Thu, 23 Mar 2023 10:43:21 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: mm/mmap.c:939:11: error: variable 'next' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] Content-Language: en-US To: Naresh Kamboju , Linux-Next Mailing List , open list , llvm@lists.linux.dev, linux-mm , Lorenzo Stoakes , Andrew Morton References: From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: B9896C0015 X-Stat-Signature: 3tgmp9dmzj3sx5e3z1rn7cnk5exshn1t X-HE-Tag: 1679564603-369668 X-HE-Meta: U2FsdGVkX19PHoROlBBMJo67v4kWd9LQxLCUzUYDQPYe1JmwE3E2n1uUg2iLTL01XDLjEbsg9nUVg0Njduy2opz14Qjf724pyI89WRVCpwlaBnUSEyxUC3YtSFtjBHZIemMdXn8929EY4U31pHGFrgpoMiEfZNFt3JNP03lD3XD8WTNWj+ZwP0PFRDD00eN1+lXeGTIm277wsr/m5RZJnjSzwTmGG309vtlpEc/ywueFuYWjIR5dsaWsJF3DaF++tpPuX0ly9U7F1/5IxFF8aCmhuDAbovKY13ec+Sm86iETZ+n+NtxZAqJFJBqz8D9qEQuJFTAlKceD1I6XeyRgj8+F4mbLcW5BQRCtzC7s4sPYRV4E4mNsvuqg3tM6ZeYu8xyo+wbn4pZl/v0mpqiPTKohhY3f5sOWWiibeQ1xqeuVwjLXfacpRe7XviqyevYCW5DppaX8dcIBcDtPbI53/3un4O/OXbeUwV8IJfthR5bD+P8C0vQ8E5jpEs4mLpJ5s/HPhmmBbauQ66BS4GS5/lqZjvuD4KwBofOURMDcBoKhMgQf7cOwWTRV4SM68QzckE7zrCCOBVb6MQF6j/+ks9Sdyd60jtfJXk5/u2hYoKFnQU6LK3SzfGSxrAMzUzj033iGRst4KRd2lBDOkHMNA5XJriN8pwYEDd6n3aG1BdSPDzVEwl426Ri7vp3SKQdtjA7m71+UzGjWwAqT2m025mZQaybKLXpFdVRYYP4BsPauYZL2+xzif54Ir+TSKvHBx5pCHsyHIl8CGGqbMAU4ZHqktaeYoLzF+AHwedG6tpI201+2cg0SZc5NSVTHWGeULj0t8XRcsHNliE7wbsg1+tDh47yJL5U7B2hRRuppUH3x3dUeNpjCHJ1pSwTLVrewZDb89AawDvwajFF+bhtzjcXdv6aUo+3dkRQEOlyIhrqVu8rd+ECXDsyNKVQR7mxpoeUI3SLuPVW1hWOPIiQ MWtJK9OB N1O/j98rn2InatP+qR8IR8bpUpiAaEQ3d8fB58lmyX9BpOSCMBzZ69OTrcnQU4dx9F1Q1DYxdhFqvYGqoha/nqvs8VjKiP9idGkmPWKRsZVlvUw7uZwaPoDe2wQazikX7yFw9ael8FT97Q6IkZU3P1Fr8B3zPl4QsftEHF/sawjEtRUbZqmkPBSxZWvCL7NPbXn2nC3piJwV7U9TsOHyAk8LXEIzE5NqAmFlk73RfRyyDzwxvbzRDIiZGKa0MrhLIe8nAS43fwUNyAe6Z2yQLggMjBetUqr7US/Ek1GfIp8dFoHjW1mmA6+Wuhz2m/DnCYFwlxC+erQnK7PIKY643KrR67tJ/zh5eELdZ+QIcqOquQ90xFRcMTqURX2fnNfsaPT23Y/3tj5DhKRnKvb5Rqc76kmwUKJGZoJlwlWPEAqR9Vc0aeJs9wIdJpg== 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 3/23/23 08:58, Naresh Kamboju wrote: > Following multiple build warnings / errors noticed while building > Linux next-20230323 with clang-16 for x86_64. > > Reported-by: Linux Kernel Functional Testing > > Build warnings / errors: > --------- > mm/mmap.c:939:11: error: variable 'next' is used uninitialized > whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] > else if (!curr) > ^~~~~ > mm/mmap.c:952:15: note: uninitialized use occurs here > merge_next = next && mpol_equal(policy, vma_policy(next)) && > ^~~~ > mm/mmap.c:939:7: note: remove the 'if' if its condition is always true > else if (!curr) > ^~~~~~~~~~ > mm/mmap.c:912:36: note: initialize the variable 'next' to silence this warning > struct vm_area_struct *curr, *next, *res; > ^ > = NULL Same issue as https://lore.kernel.org/all/CA%2BG9fYvBxp38KEggtvtvVtGMaSBdL3NDV9ns%3DZi9-Jtx7H9g1A@mail.gmail.com/ Thus already resolved in the next -next hopefully. > 1 error generated. > make[3]: *** [scripts/Makefile.build:252: mm/mmap.o] Error 1 > > mm/vmalloc.c:3543:6: error: variable 'remains' is used uninitialized > whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] > if (bitmap_empty(vb->used_map, VMAP_BBMAP_BITS)) { > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > mm/vmalloc.c:3587:17: note: uninitialized use occurs here > return count - remains + zero_iter(iter, remains); > ^~~~~~~ > mm/vmalloc.c:3543:2: note: remove the 'if' if its condition is always false > if (bitmap_empty(vb->used_map, VMAP_BBMAP_BITS)) { > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > mm/vmalloc.c:3539:6: error: variable 'remains' is used uninitialized > whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] > if (!vb) > ^~~ > mm/vmalloc.c:3587:17: note: uninitialized use occurs here > return count - remains + zero_iter(iter, remains); > ^~~~~~~ > mm/vmalloc.c:3539:2: note: remove the 'if' if its condition is always false > if (!vb) > ^~~~~~~~ > mm/vmalloc.c:3524:16: note: initialize the variable 'remains' to > silence this warning > size_t remains, n; > ^ > = 0 > 2 errors generated. > make[3]: *** [scripts/Makefile.build:252: mm/vmalloc.o] Error 1 > make[3]: Target 'mm/' not remade because of errors. > > steps to reproduce: > ---------- > > tuxmake \ > --runtime podman \ > --target-arch x86_64 \ > --toolchain clang-16 LLVM=1 LLVM_IAS=1 \ > --kconfig https://storage.tuxsuite.com/public/linaro/lkft/builds/2NOjxURhByyb4dR3Ld788iuYvAR/config > > Related discussion on mailing list, > - https://lore.kernel.org/llvm/202303231055.DeninwHS-lkp@intel.com/ > - https://lore.kernel.org/llvm/14c60785-2427-45db-9613-683410ff6802@lucifer.local/T/#t > > > -- > Linaro LKFT > https://lkft.linaro.org >