Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3954473imw; Mon, 18 Jul 2022 18:19:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1skKHChNN4Cf320YQBvofdH1tOIghgLKrUB7bAdMCnBtHG5WrpXfORhNu7xLbgQAresLBQP X-Received: by 2002:a17:906:ef8b:b0:72b:4a67:8ae5 with SMTP id ze11-20020a170906ef8b00b0072b4a678ae5mr27770764ejb.763.1658193555841; Mon, 18 Jul 2022 18:19:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658193555; cv=none; d=google.com; s=arc-20160816; b=DERNtAMJ2L9fSUWDHKg+CPbSEfGBfoLC37RuTtlUl7hwoxODW6CRdjMg6FAfdMud5h gZLx6P5uFhsmaT7XmrM4HksJrwJbhb7gSblAz+47GBxkv5QxFbN9Gt10KG3rFxAhpQht clkOSP6VRRup0ICBfYrQVaO14e/mqfYM7nfic8h6PRy9GEAD8U4eoO0fzZgx1BFyDNsR erI1vQ+vOEcu8INyDYs/sKVuVGOwzXfq3xS0n6nZr7pI3JjqQVGMAxW0LCXq3coW8WS2 MxGX5R4/CKkM5D5PIbza8XGCUNIAAuaE2MQ1jSMnENHLI7qDG5HK/XzyLk2cOUVzjqsB +a0w== 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=ypNhLiBtVU9jJolzs9O2aAagUc+2IhpYDk0p45hBQrA=; b=Gyddt8t94MU91v/7qBGYEuscuvhUqRSTSkPjLfnIoDh1PYBcbQ5vz0oqgftJcm5kMT AOudEEQzLsilKr269yfpwDZk7MUKKp8eULu+bod+R8CN1/UseuhBgWzBWQPhFK0Hk/VX nF94YfBB+OEa/x5N7fM38NHW4mzN5g2bpm/w4Lo41KT9336fAo/lnRQpmgRJKc+Z0xNR IuZLGl4OepiuMFM7Y9ewBcU8q9sP/u4J1Vn+I6uP4vr56aLHWQvsSsGKM2LPCI4BqckA UUD64m7DOReWegV4n/fWnbCK0px4EHuvpUlvcX/5kwEPocZNFo0GvbKoGYVb6BX+AJq9 j1KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="G/1EgNqi"; 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 gf3-20020a170906e20300b00728ef889ae7si16287680ejb.829.2022.07.18.18.18.50; Mon, 18 Jul 2022 18:19:15 -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="G/1EgNqi"; 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 S236637AbiGSAOn (ORCPT + 99 others); Mon, 18 Jul 2022 20:14:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbiGSAOl (ORCPT ); Mon, 18 Jul 2022 20:14:41 -0400 Received: from out2.migadu.com (out2.migadu.com [IPv6:2001:41d0:2:aacc::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1E8CDB for ; Mon, 18 Jul 2022 17:14:40 -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=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 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 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 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