Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7326452rwl; Thu, 23 Mar 2023 02:47:05 -0700 (PDT) X-Google-Smtp-Source: AK7set/OfLQAsL8rXesyp8sVaoD5AmmRrcb7KV/T43+K87MTAU/Fjlfkcz5JT2UhylUOQWeSa+Or X-Received: by 2002:a62:84d0:0:b0:628:184f:2c5 with SMTP id k199-20020a6284d0000000b00628184f02c5mr6151964pfd.14.1679564824986; Thu, 23 Mar 2023 02:47:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679564824; cv=none; d=google.com; s=arc-20160816; b=qKlkltETDnCVs80Jd2XpKHgCB93jdQ19eCO/WzTJe3t0DpAjXtcnvdOaDYyA973tSy r9mBHZ/HkiCu0jZA1f0DLaNYNzbJ0kKWdp4oKUVS0HwJ1ZtjE7gS2ZaT4E2YMgEl2ypC iJTRkWTivnjtSLUpHJuRCs4U9Ix88G4Mr4i1tJTPUY9Ben3YY0USrb2Y/oc02pl2SQYQ 7CuwxlYVO32stjDlQ8zBgHS4A4hVqdVu15/rmxxOicHyPMjwSFVlqY7h1bj7EOIC8bv/ z6QTl8vHUJuuILuFkhN4NXjjjyfsIqkcVTbupWQBhSF41P+qPfdMVrj4E7j4Ix+uuqIQ cvUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature:dkim-signature; bh=klNWhIy8hiXGSUgaFtlmoMw45I3AHJjiiJxXlBCB2YE=; b=y0NQvY46pyZuAwlBNBNrwmTT9GdKKvrBLt+lur5E0CcO4uKY6spu7KdJc4RZYG10VQ 8Tu98p6vgkkblr6rHa+jhe8npEVrHyfZo1Jtk/H9GzhnOMMhKb6EZoayG2nx+lK6xptP qm5CETAJQ4STCXAlEcTnptnH3xA0okIQcp8P1+h5Hv2MMDNinbw/ghFu/CXN369lvu4j InwPe5X0A1pt7iPsh16FrxUQlWwik6C8Ior+MKCsciTuzi3C+gkfujP+bW/Y6XPWWfjj JP1KnuIfXG8fklbpxyHd1GjpCoYUW20qgwRoSpO9XimEEaDJlSOHH0LOvWyvuJH5Lekj mf3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=y4bAYuP0; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 c19-20020a056a000ad300b00627e8781dbfsi14122116pfl.266.2023.03.23.02.46.53; Thu, 23 Mar 2023 02:47:04 -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=@suse.cz header.s=susede2_rsa header.b=y4bAYuP0; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 S230157AbjCWJng (ORCPT + 99 others); Thu, 23 Mar 2023 05:43:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229738AbjCWJn0 (ORCPT ); Thu, 23 Mar 2023 05:43:26 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 761AEC155; Thu, 23 Mar 2023 02:43:23 -0700 (PDT) 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-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 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 >