From patchwork Tue Jul 19 00:10:04 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: 12921921 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 9EBFEC43334 for ; Tue, 19 Jul 2022 00:14:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 30C7B6B0074; Mon, 18 Jul 2022 20:14:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1F6FA8E0001; Mon, 18 Jul 2022 20:14:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 06FC86B0078; Mon, 18 Jul 2022 20:14:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id CF5166B0074 for ; Mon, 18 Jul 2022 20:14:42 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 9DF3A2F544 for ; Tue, 19 Jul 2022 00:14:42 +0000 (UTC) X-FDA: 79701928404.23.E260911 Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by imf05.hostedemail.com (Postfix) with ESMTP id 3D900100069 for ; Tue, 19 Jul 2022 00:14:41 +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=1658189679; 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=ypNhLiBtVU9jJolzs9O2aAagUc+2IhpYDk0p45hBQrA=; b=G/1EgNqikg3pnI4aNhL0ARKFC0+h3b15HwNaEnt9tbA66ZZ0v+OWh4mBrCsBZ1xcOCHYlR 0lANCQr8pOu66DP6jCi3M2lSV1Sm4PJlmbD41OTMKK3PsH3QKruVkVbsqSkNAfoMgDcQCf Xj8CCKk8sRh4WRMU56bknG6cZM41aBU= 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 mm v2 24/33] kasan: make kasan_addr_to_page static Date: Tue, 19 Jul 2022 02:10:04 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b="G/1EgNqi"; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf05.hostedemail.com: domain of andrey.konovalov@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658189681; 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=ypNhLiBtVU9jJolzs9O2aAagUc+2IhpYDk0p45hBQrA=; b=LPZW0CcpE5lfVkk/vUZoE7oEDW5dGb9pvyVp9cz+cDVjt926frPSiRwxJNHPusGmyprNkA g5WPitmmdPYK+A7EBjv4TMe5tkYkj0cKcnPitonPQlsK3jTOirrORIbTuBcc60PVkHUqQq nL6fshTa41FeXq8pPG3ny3r3qbyGOeg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658189681; a=rsa-sha256; cv=none; b=7HMEdcbnzsNVBon9CtdJJmos536+iHT5/PtteJ/SEyoEK0Wl66TitA+ozmWqc8dVRKyxHU ltzp3i82ZwVKsOzqnQYqTk+k5xGG7RZ4jJ3BvIhIj8NjGecTcNbgia6tb2VxYR0HZOTA3/ 1L3YbaiLIzIrvG3puyXUpvir0t+2HxE= X-Rspamd-Queue-Id: 3D900100069 Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b="G/1EgNqi"; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf05.hostedemail.com: domain of andrey.konovalov@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: msjm7ef9mas8ie1kzd8p1tipi5tnrkfm X-HE-Tag: 1658189681-542643 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. 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);