Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp869577iog; Mon, 13 Jun 2022 14:58:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t8Ob2JG7y40ThNwD1slzFz6hpcMa5tYH5umo6a99aizWDv6KgaHtI24I9YezjcPc4CKu6i X-Received: by 2002:a17:90b:3e88:b0:1e8:875e:366f with SMTP id rj8-20020a17090b3e8800b001e8875e366fmr849420pjb.155.1655157488079; Mon, 13 Jun 2022 14:58:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655157488; cv=none; d=google.com; s=arc-20160816; b=g67kE/TW37bEccNkNodhvdDwefMUzjwHip0fwtngyCsONwk4gCMWR6u+n0Uh8IQmht RN6t6PtojLEydo7aitxGv4kgQqhmDpsHx1tDLtHL9JsbCrsAQ95vysCPAsw6gH6FPmll r5G5PZjqzBnB2PaneZHV6w7CI5iXkKS7PJgFekyJhaEqPAyrbhH2wu1zSU86+tCf+aFO DwGRY4tbtXfuOwehuaCabuLfeZFr7FlUUYfGY272e7bDtnESrQukeX5wmcyXOFV8yQEa sKoMbU/mPuRVy4TcRVR7o+DVymmB1LXM37Am3rDfuvOR5OxRmgH3e+KKEIghDQ2p8qF+ mW+Q== 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=NlTYbbmb8K8Hz7QxoFNu4DEEzvlhQuGMJFGkSKrxTzk=; b=dDjzy/zminftHlO2P2vOqX6CA/S9tKruDxuncecwZAtWDqJc+5A49DIiaFG9nZMUeq l69RsEiwXrbgBFJJWNa7dvnfuEgiAqgmC4rHX65emq7Hm//47BMgmfhTgY4R4icF73AG npuPRd8TmJh68eBq8PSzJ79/3opDtvVeQ/To2/h+qJGNxcplRa52hcLaaHCk5raPBqTM uLtISf+YAUpnUjOABgtJ2kBwFF4eH4P42EkboVv1j8kKp5TjCOqu1SF9IKN/Zlk67FXw 89f7yWL0oBMUDOXMdKb51igGF6buuaDiiKaUdDR6HgFVPkJbPPBoxq4PXsYcJQ0EGwJd gKNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="U/iYTMjj"; 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=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w184-20020a6382c1000000b00406fb5ae47fsi7013639pgd.760.2022.06.13.14.57.56; Mon, 13 Jun 2022 14:58:08 -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=@linux.dev header.s=key1 header.b="U/iYTMjj"; 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=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351376AbiFMU44 (ORCPT + 99 others); Mon, 13 Jun 2022 16:56:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352081AbiFMUyJ (ORCPT ); Mon, 13 Jun 2022 16:54:09 -0400 Received: from out2.migadu.com (out2.migadu.com [IPv6:2001:41d0:2:aacc::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AD23275EA for ; Mon, 13 Jun 2022 13:19:45 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1655151583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NlTYbbmb8K8Hz7QxoFNu4DEEzvlhQuGMJFGkSKrxTzk=; b=U/iYTMjjDHVUZCoLW/1BknQkILDEl85phr4wKanZLDwM4Jn+hUSCLwE24HlVfV0VaWnFGZ 5AwsB6PXGbJcILtgvt/a2jxzEYgsMtJLT/bXeJD/yxxPbvpTCCioX7PAW1dxA4jrSRwzdu UhNm0cH9ryd0tC9r9ti+IK4+K3cI+g0= From: andrey.konovalov@linux.dev To: Marco Elver , Alexander Potapenko Cc: Andrey Konovalov , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Peter Collingbourne , Evgenii Stepanov , Florian Mayer , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH 25/32] kasan: make kasan_addr_to_page static Date: Mon, 13 Jun 2022 22:14:16 +0200 Message-Id: <810b29bfb50dad8cdc5a5a7075e0da1104de1665.1655150842.git.andreyknvl@google.com> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Andrey Konovalov As kasan_addr_to_page() is only used in report.c, rename it to addr_to_page() and make it static. Signed-off-by: Andrey Konovalov --- mm/kasan/kasan.h | 1 - mm/kasan/report.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index f696d50b09fb..e3f100833154 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -285,7 +285,6 @@ bool kasan_report(unsigned long addr, size_t size, bool is_write, unsigned long ip); void kasan_report_invalid_free(void *object, unsigned long ip); -struct page *kasan_addr_to_page(const void *addr); struct slab *kasan_addr_to_slab(const void *addr); #ifdef CONFIG_KASAN_GENERIC diff --git a/mm/kasan/report.c b/mm/kasan/report.c index ed8234516bab..f3ec6f86b199 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -200,7 +200,7 @@ static void print_track(struct kasan_track *track, const char *prefix) pr_err("(stack is not available)\n"); } -struct page *kasan_addr_to_page(const void *addr) +static inline struct page *addr_to_page(const void *addr) { if ((addr >= (void *)PAGE_OFFSET) && (addr < high_memory)) return virt_to_head_page(addr); @@ -283,7 +283,7 @@ static inline bool init_task_stack_addr(const void *addr) static void print_address_description(void *addr, u8 tag) { - struct page *page = kasan_addr_to_page(addr); + struct page *page = addr_to_page(addr); struct slab *slab = kasan_addr_to_slab(addr); dump_stack_lvl(KERN_ERR); -- 2.25.1