From patchwork Mon Sep 5 21:05:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: andrey.konovalov@linux.dev X-Patchwork-Id: 12966563 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 60EAAECAAD5 for ; Mon, 5 Sep 2022 21:10:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0130B8021F; Mon, 5 Sep 2022 17:10:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F053380214; Mon, 5 Sep 2022 17:10:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DCDE38021F; Mon, 5 Sep 2022 17:10:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id CCBDA80214 for ; Mon, 5 Sep 2022 17:10:15 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A771E1606AF for ; Mon, 5 Sep 2022 21:10:15 +0000 (UTC) X-FDA: 79879274790.02.7E7691B Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by imf12.hostedemail.com (Postfix) with ESMTP id 5367D4007D for ; Mon, 5 Sep 2022 21:10:15 +0000 (UTC) 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=1662412214; 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=oPxPsap+uxlNu3NKWwUVtxgClQ4bQ77Qpub3ubuEwik=; b=Sl0b0kWxSRo8R8O3HSJvaTI4k5btcxNNKzHFiXK4t6JKYSUb7lul//dFvC+XGsfWuRNJPU W/qQfYlN0/58cnGJFziNQjvfKX7gV8U0gARt4hamtDisXc76NwwbxrEqB8Y8uL7hGwxCch Nb3ZUPieTgrVtdR3rwi1gkJNlDCIpyU= From: andrey.konovalov@linux.dev To: Andrew Morton Cc: Andrey Konovalov , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Peter Collingbourne , Evgenii Stepanov , Florian Mayer , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH mm v3 24/34] kasan: make kasan_addr_to_page static Date: Mon, 5 Sep 2022 23:05:39 +0200 Message-Id: <66c1267200fe0c16e2ac8847a9315fda041918cb.1662411799.git.andreyknvl@google.com> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662412215; a=rsa-sha256; cv=none; b=cGUdQ8ZPL26X4JJHquOkCC/FIdqyuPklgTSN6OzXimcLG5/FSw5QXYFj6HPRSyCHm6mkFs qz+6zSKYQ29w3M4ZM1HfkCRr3y1mMsb6jux3ckcg0wS8oM4ihhg2l9Ue596+JP1H0Bzwsi Ikf4oldQc651czx2mLVv2WdX+i2cIUE= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=Sl0b0kWx; spf=pass (imf12.hostedemail.com: domain of andrey.konovalov@linux.dev designates 91.121.223.63 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662412215; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=oPxPsap+uxlNu3NKWwUVtxgClQ4bQ77Qpub3ubuEwik=; b=LZcxitMdZWsFIrClCzGupKQpwkwzXf+wT6V0ueOWCGEh1pvjS4mxJsvPpLZrifZIswEmRi Lx8s26usqXD6tCF7RhqCMPRVA6U1RNHLDpCdafJKcL1YyZ1/lgSSk207bUXXOENWQVR6hT kC7WctKWedRk4kgQqeVhoFrFL4u5P+w= X-Stat-Signature: zgtxbea7uqqhshdet575u1m3p37z133s X-Rspamd-Queue-Id: 5367D4007D Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=Sl0b0kWx; spf=pass (imf12.hostedemail.com: domain of andrey.konovalov@linux.dev designates 91.121.223.63 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Rspam-User: X-Rspamd-Server: rspam03 X-HE-Tag: 1662412215-655295 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: From: Andrey Konovalov As kasan_addr_to_page() is only used in report.c, rename it to addr_to_page() and make it static. Reviewed-by: Marco Elver 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 cca49ab029f1..4fddfdb08abf 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -291,7 +291,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, enum kasan_report_type type); -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 cd31b3b89ca1..ac526c10ebff 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -206,7 +206,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 (virt_addr_valid(addr)) return virt_to_head_page(addr); @@ -289,7 +289,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);