From patchwork Thu Mar 23 11:58:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 74036 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2870467wrt; Thu, 23 Mar 2023 05:08:24 -0700 (PDT) X-Google-Smtp-Source: AK7set+ZlgvTqDsMcG4UwWMFGivYTo6LCIwMbp6GyuQMQl3k/Ke6YFRlSF9NqXeNSYAV0dQAibW8 X-Received: by 2002:a17:906:4ad1:b0:8e3:74ad:94ce with SMTP id u17-20020a1709064ad100b008e374ad94cemr5637723ejt.8.1679573304743; Thu, 23 Mar 2023 05:08:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679573304; cv=none; d=google.com; s=arc-20160816; b=IwsGs3wJSmwMjg4YD1W9ZF0yLw4lkVZ3aEl7PKhrCYvuHQyepS9b7dtMGsTRyE7QSM J39HABpBG/KBEqEO518LDXpQSE+uM7ONozK0WgkkESVMccYAfqb9Pf7tV601rRFlmmAK 7GAo4j0j2FyEJHWUOIG7cfPvZ75pO2/VhkYIZ0sOcHe+byWy3MgN8VxeJaFQghrq4Zyb lTKPcF3OarYnLmanz91qFTjnFsiuDKuHIzn8uztve5UWAx9hN9IzD3U9ljz6ZwaFvikS /r+UFQu4yD47MvT7eiwxQHoDWWItJ6RUNDnfPMUNvx2nWziC/gWmq/DOtgmz1fM+NFo8 1eOw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=ParquFYygbbuO9rRASghQvFuA9lGdMYqOAhC7AI0i5w=; b=LpUak07WjJN9tpqXfUOxLAO7s9cSGzoO4IFov0zNV2ybJwisJzZp+RHlMFfVnvCgWl BWkMesI1RPqoGOEp/8WZAiTtlMkhQ8y1S5odwYGwV7a/2AKuiauRAr4aFs+bdwLJl13e 3RcuY5v1sC/QNbCMuZRW+51dJuF0SJMrKhEH7RTZTCJrvYyjxSbyXFXkL3ZkMJjLCBTh qUIxjF+q3Tr6m8rtiQzlQCNctPsBNZFe89y0fMUsTavGbGx2Ea8K+N6Dz96N9df2Ccy/ HrBzVUsBdiXpBzUQAiOKFXHlZe1GJnPW2OH8bZrdQSHRxyP1Zvk43dFCewv3VimvT1PD Ssxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tBTAYbPS; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kq14-20020a170906abce00b009212a3f8496si17238467ejb.666.2023.03.23.05.08.00; Thu, 23 Mar 2023 05:08:24 -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=tBTAYbPS; 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 S231268AbjCWMBQ (ORCPT + 99 others); Thu, 23 Mar 2023 08:01:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231157AbjCWMAv (ORCPT ); Thu, 23 Mar 2023 08:00:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4519B366AB for ; Thu, 23 Mar 2023 04:59:24 -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 D09BB62653 for ; Thu, 23 Mar 2023 11:59:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99E6BC4339C; Thu, 23 Mar 2023 11:59:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679572752; bh=XWLuxoeuAjQ0mUCYpCvh//KdRJ/f4l5MIwreKshFoaM=; h=From:To:Cc:Subject:Date:From; b=tBTAYbPS1lzP8x3XUCu1oh/aQIAFffDcYizxUgHHLq8+EBr1yoibNnSB25Fjgqecq BQrgn/kTrTGTYYCiLC3wdTqsMpcdzsvIMUAXsqe/nbxZNXv9qg23we0idnZR5og2jw U82IGtiPy3aqbBXoeoXbiovfzpEKNaheKqs74TluFDlxXOQ/VIY075Tgv/VgseLhq9 rsGPMZLMQ8f5+DMBdly9fscK3PcZk1CxJ63dELFEirOgTTioOKx9JZI0haa1SzwLA5 WYEIGxSY4pZQZ8K5qAWsCWLcbGCpuRRkWVAmf8g7cWSLUHFpqLKqR3E7PYP68FXQct G6gsSvaoLWKCQ== From: Arnd Bergmann To: Andrew Morton , Lorenzo Stoakes Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Tom Rix , "Liam R. Howlett" , Vlastimil Babka , Suren Baghdasaryan , linux-mm@kvack.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH 1/3] mm/mmap/vma_merge: actually set next to NULL if not applicable Date: Thu, 23 Mar 2023 12:58:34 +0100 Message-Id: <20230323115903.1483668-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761160257484589644?= X-GMAIL-MSGID: =?utf-8?q?1761160257484589644?= From: Arnd Bergmann As clang builds point out, the variable 'next' is now uninitialized in some conditions as a result of a previous patch that tried to rely on it being NULL here: 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)) && ^~~~ Fixes: e887ecae997e ("mm/mmap/vma_merge: set next to NULL if not applicable") Signed-off-by: Arnd Bergmann --- mm/mmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/mmap.c b/mm/mmap.c index 54099a604cf8..c01d43bd694e 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -939,6 +939,8 @@ struct vm_area_struct *vma_merge(struct vma_iterator *vmi, struct mm_struct *mm, else if (!curr) /* Is there a VMA next to a hole (case 1 - 3) or prev (4)? */ next = vma_lookup(mm, end); + else + next = NULL; /* Can we merge the predecessor? */ if (prev && addr == prev->vm_end && mpol_equal(vma_policy(prev), policy) From patchwork Thu Mar 23 11:58:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 74034 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2869663wrt; Thu, 23 Mar 2023 05:06:54 -0700 (PDT) X-Google-Smtp-Source: AK7set8G7jkFIo6f3ckA6FxfxunOuHKy5ukIg+Y56cF2aXnO4WBZHfwTQPoOIXCsM78sabM3irQ+ X-Received: by 2002:a17:906:fcc1:b0:8f3:9ee9:f1bc with SMTP id qx1-20020a170906fcc100b008f39ee9f1bcmr5202133ejb.13.1679573214262; Thu, 23 Mar 2023 05:06:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679573214; cv=none; d=google.com; s=arc-20160816; b=KO9DfZ9U6ax0LCvIveRmFWOb58fM4KJheiITc5q7xP+7yf5UdWeJY+5i33hXFbzeYL xQ1BGDIL/JQ5ylQjYMos1hSEv6E4si5/XyNVtSTiSN9UCOMPsZ9YwUgrdSNljYHBQ5Bo LZI3nYUbjgpnh3suJ34uMFRWdhqlOZxDKE62F0kTGcFDicJ1yxS++0RPzxysrfN/jjhb PVxIyPXDt5K8Oe/dWb5W//QVpTLv+2jXneKjPz1yknJQ/bWyc0TwgdVpHYyryW/mXQ5o 3R4QF126lNvC0DCDPearIynQX68HZ7MPvJ3uTMcMc6lzZSBM2u3t6QuNn550w7J64gzT 8/5A== 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:date:subject:cc:to:from :dkim-signature; bh=N6D8EKximEeE1YEKZBEMXWtQ/lBAW7jUgCvTznvrqiM=; b=d3f7f8v4LisBPiZZs2YGIlVt341BTO/9+3NJ0dGHT3rx2WKOwCX7xBBO/IM5t8R2dr Egq+QhTTvlKg6FetwnO8aT6uguAIFvrgjdJHznyTNFfHaMBuR/k4DEpH/4DAkfmXK/mp V+xPHedfzmAHGvqGSeiKL/FuvbS9qrMwv4C43+aFKVErJfe4Lt62yqe8qzitqcMNaPd7 6IjDPc8R1bcaBwDBaq5cKFeL1Qa5zigNcgG8GEJn55pdPR7nxO+Qdc2FJqGMDh9UDiwo KFmXH48FpmR6tPJa/0A5mMipXMtU18+OhFTtSEw93iIiGx3Ls8WBlK54BwPTJQlvuF4o sbcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PoRZ7T4V; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cb6-20020a170906a44600b0093322cf202csi15313013ejb.28.2023.03.23.05.06.29; Thu, 23 Mar 2023 05:06:54 -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=PoRZ7T4V; 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 S229532AbjCWMCB (ORCPT + 99 others); Thu, 23 Mar 2023 08:02:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231486AbjCWMB1 (ORCPT ); Thu, 23 Mar 2023 08:01:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5268594 for ; Thu, 23 Mar 2023 04:59:46 -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 97641B8208F for ; Thu, 23 Mar 2023 11:59:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1859EC433D2; Thu, 23 Mar 2023 11:59:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679572781; bh=me8lIKVzX4f4kEhtj/IZ/N62RywMeIeThO/YQFbwteI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PoRZ7T4VeuvD6lVxWJCeAYNQqpd4RILWHk5vcprJ5zLlgoNJl7XH8sN9RE4DNe/6D Gm2fsLvFXKKAhi2TKnz5Y1QJj+hj2GePh81dWspUUTWCHpD6x6h3AntosNQLuaU49A pXS7jvc2FraInbauw8rpnt2muQaZpATfJfiv+TeJXMxwaXx9GwEE7+F9DYgjViQfDO KPiM+NOhvH3zhggkxDwkLvZFehojjyyBNwvyaUsyAvimIOKWwj/v9UM4bsFC/OwzVW BiADB8RPVYiMwojAeD5E7vnJSMNyVfscO1dP6vwSxljAyRbwtFyo0s1pPWVxvJGDA7 T5QhZQ8KyjN1g== From: Arnd Bergmann To: Andrew Morton , Lorenzo Stoakes Cc: Arnd Bergmann , Uladzislau Rezki , Christoph Hellwig , Baoquan He , David Hildenbrand , Andrey Konovalov , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] mm: vmalloc: fix vmap_ram_vread_iter() return value Date: Thu, 23 Mar 2023 12:58:35 +0100 Message-Id: <20230323115903.1483668-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230323115903.1483668-1-arnd@kernel.org> References: <20230323115903.1483668-1-arnd@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761160162901209486?= X-GMAIL-MSGID: =?utf-8?q?1761160162901209486?= From: Arnd Bergmann The error handling in vmap_ram_vread_iter() can return an uninitialized value in some cases: 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); ^~~~~~~ Move the initialization up a few lines. Fixes: d9cab54f7737 ("mm: vmalloc: convert vread() to vread_iter()") Signed-off-by: Arnd Bergmann --- mm/vmalloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index ebfa1e9fe6f9..fb216495fe5a 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -3521,7 +3521,7 @@ static size_t vmap_ram_vread_iter(struct iov_iter *iter, const char *addr, struct vmap_block *vb; unsigned long offset; unsigned int rs, re; - size_t remains, n; + size_t remains = count, n; /* * If it's area created by vm_map_ram() interface directly, but @@ -3545,7 +3545,6 @@ static size_t vmap_ram_vread_iter(struct iov_iter *iter, const char *addr, goto finished_zero; } - remains = count; for_each_set_bitrange(rs, re, vb->used_map, VMAP_BBMAP_BITS) { size_t copied; From patchwork Thu Mar 23 11:58:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 74044 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2874626wrt; Thu, 23 Mar 2023 05:16:19 -0700 (PDT) X-Google-Smtp-Source: AK7set8ZyBY7KzunLh9dIrt3Ks8yOuFrRGTpJfcb2qPOYHxd1PZZJRV2uDrsd22qKuSs8bTZ8gTO X-Received: by 2002:a05:6402:4cf:b0:500:5627:a20a with SMTP id n15-20020a05640204cf00b005005627a20amr9573465edw.25.1679573779387; Thu, 23 Mar 2023 05:16:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679573779; cv=none; d=google.com; s=arc-20160816; b=DdtWM5AH/YIDy3ri1bETdntOqtyWnmAuYr40+muGcgA8Wk43x0ZqVkcDknk1/ZqMiA Kz2ubB/MboP1P/365jaAY/s5J8QBwwcm85JDDFzTQlcgn6Tm5UNGCGGkYrVJRH8yitLw olS2bjUbfQbOnpOJsyz0WksWZYNjh8vcf3vwLBn2amhWYLrAhmJ9haWTCNeBznj4t/oV bx6Fdvt99GPZP3Juuc/hHKWnAzvml1yasTcQRVisnUA41eRuIf8Fs8xEcEDM1uz7I+r2 Fh2AuaQ0tikv0UqVbDtIdrx2DyljGlPeuaNupjcKsWIJMrl0hCBhvp6fVUCOg90U6f9w FasA== 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:date:subject:cc:to:from :dkim-signature; bh=RAa6QYfhSECI92djUs3Jnn+lkRSHMYnA7QB58mfyffk=; b=u/2uRGNTCS7c1SJtTj7z4Z+iDLPisPYPO8UzH1MLaPZ3CDKrg9cDge1HwKligiyQKL BEpVe/6LCj3BFpgY7vEyt6RlyXiqWRoyBLPKN4qO0wt6CuC/RWLn4AQ7bxYzEWRkoQp/ /XjlSTiebdDstSCl4e0na9T7Up6a8QM2/3jZgffzG6A1YTRZOuDh3nJ+XnnRythCQglf /jhCJy69kh3qp6JqlUfLyXJakGjrKb/J1lHJnzoxiL9iW2XUC+Tf+OM864aetMz4VJHd ZUL88A7olC5xp883zbHYonhhbstnvnmssFCVKVBsnkHWBfMfHjjLKi8o1GRikxtQN6c+ RRkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UdLQR8S7; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wf5-20020a170907d68500b009330d1437a1si14212963ejc.701.2023.03.23.05.15.47; Thu, 23 Mar 2023 05:16:19 -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=UdLQR8S7; 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 S230109AbjCWMCJ (ORCPT + 99 others); Thu, 23 Mar 2023 08:02:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231736AbjCWMBf (ORCPT ); Thu, 23 Mar 2023 08:01:35 -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 2700D1FE9 for ; Thu, 23 Mar 2023 04:59:53 -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 61199B81CED for ; Thu, 23 Mar 2023 11:59:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E96F1C433D2; Thu, 23 Mar 2023 11:59:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679572790; bh=hhPbL79oPMdtDe7maqPTdafjDuPMITrYj4jgPoVH1Q4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UdLQR8S7HwWTgjH50FDeeSUqXWGo4+fmBddMMbOGV8fam6vbmTsBm1LzANxUs1fkm TPBv/1tebFkcRlg08L0fIioLsQbG99cRIqtzhoFxLQ19qEmItnHCo/1T/Mx/Bbva83 iZl063I623DZhNP4k6nGPyUFFzg7MI/6tngGxcxH+RbQQuyx8b91Kdj9L9xhqvdTjq VyHP8zdPBWUWM5dRHA90ZVSmE7ssEMXP5WTICb8myhmdzKrCofE+WHVjFP46n5zryQ s8yiXAqPZvgJO8w+Rf++/GOnAKcBn9kLpYHLi5IQQKGKZ8ceGkA/HYqvKinawYfrtT uqmU9SAVV4bxA== From: Arnd Bergmann To: Andrew Morton , Lorenzo Stoakes Cc: Arnd Bergmann , Uladzislau Rezki , Christoph Hellwig , Baoquan He , David Hildenbrand , Andrey Konovalov , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] mm: vmalloc: mark zero_iter() static Date: Thu, 23 Mar 2023 12:58:36 +0100 Message-Id: <20230323115903.1483668-3-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230323115903.1483668-1-arnd@kernel.org> References: <20230323115903.1483668-1-arnd@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761160755297649660?= X-GMAIL-MSGID: =?utf-8?q?1761160755297649660?= From: Arnd Bergmann The zero_iter() function was put into the global namespace, apparently by accident: mm/vmalloc.c:3448:8: error: no previous prototype for function 'zero_iter' [-Werror,-Wmissing-prototypes] size_t zero_iter(struct iov_iter *iter, size_t count) ^ mm/vmalloc.c:3448:1: note: declare 'static' if the function is not intended to be used outside of this translation unit size_t zero_iter(struct iov_iter *iter, size_t count) ^ Fixes: d9cab54f7737 ("mm: vmalloc: convert vread() to vread_iter()") Signed-off-by: Arnd Bergmann --- mm/vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index fb216495fe5a..55f5d6fc8629 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -3445,7 +3445,7 @@ EXPORT_SYMBOL(vmalloc_32_user); * * Returns the number of zeroed bytes. */ -size_t zero_iter(struct iov_iter *iter, size_t count) +static size_t zero_iter(struct iov_iter *iter, size_t count) { size_t remains = count;