Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3592109rwb; Mon, 5 Sep 2022 14:54:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR4dkDJkNuaerrLEpVzCk5Xzv5kJ26w06q3pdv1/8s6BjJ6aQT24anWGxvpqlfnSTkDPaZ1d X-Received: by 2002:a17:902:d48a:b0:16f:c31:7005 with SMTP id c10-20020a170902d48a00b0016f0c317005mr51045503plg.173.1662414857024; Mon, 05 Sep 2022 14:54:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662414857; cv=none; d=google.com; s=arc-20160816; b=vQeboOgyDClRQ1kOfjbaqhY9oEjIRoBW1e3oR6BTocMjMUCY/Uzeq2KwKEU432hely /9Jm3e7AlC+WGbq8/OEIklVAow0H8fqD9h/wsWX4cqVvXWYL2nyDHhf2RLay1MYOhT4V +0Wyk0NLthiVvpzCC/2OMk2fUOmlXAjmOnruFT0xjYFGt++kp41uFdKI1ih9vtYTecn2 6kPqKxEIgcuEPLZPy+OUiFfDXsmAC8QDtvRWrwuvXY2sS9msgUpb0oSzFN1KRVk9tcnn pS0RVkkTzQuJmxPFWQ7YhC+owgJJbBtOumT54f6R28ea4F9QAHmkB5V9dzPrGwGe6G6k O/4w== 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=oPxPsap+uxlNu3NKWwUVtxgClQ4bQ77Qpub3ubuEwik=; b=NYRm73sPcFWK3CpDU3big8WljV/5UsEUuzLc4nXBLNWbhKoeMkVBK0HUa4h75w2ycE M4k1UGInYcUsD7jhqZQFp+Z4Z+wJMmSM0WJkldvHzLEAaKDnc/n0E1SCgSjuUEj0cbJA OcRfe7pa6QKSk4A6YPiXbre7R4bcBnYz5PNJ6oTcfJNXokCDzNqML43VPndIp+LHK3N+ zDpsc1tVRKMA/TMcbmPaykgMkxpu/H6jzDSZxUBV3LUQQYJhHjbem4xtp1NLPqViCh2h Iz3Ems7BigKJDOF1Z73gty81hP1Mt2n/w2/APQD1HRx6ETlZs+5LpN0ynpoR2WO3rSXG 9YXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Sl0b0kWx; 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 l13-20020a170903244d00b001751d0ac52asi8852622pls.435.2022.09.05.14.54.06; Mon, 05 Sep 2022 14:54:17 -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=Sl0b0kWx; 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 S237601AbiIEVLZ (ORCPT + 99 others); Mon, 5 Sep 2022 17:11:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237510AbiIEVLD (ORCPT ); Mon, 5 Sep 2022 17:11:03 -0400 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63A7FE0BD for ; Mon, 5 Sep 2022 14:10:22 -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=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 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. 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); -- 2.25.1