From patchwork Wed Apr 2 18:16:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 14036355 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 B73ABC28B20 for ; Wed, 2 Apr 2025 18:17:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AE6A9280009; Wed, 2 Apr 2025 14:17:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9FC81280006; Wed, 2 Apr 2025 14:17:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8250B280009; Wed, 2 Apr 2025 14:17:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 5DB7F280006 for ; Wed, 2 Apr 2025 14:17:20 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 893C5140579 for ; Wed, 2 Apr 2025 18:17:20 +0000 (UTC) X-FDA: 83289911040.27.A4363EE Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf08.hostedemail.com (Postfix) with ESMTP id EFB0F160007 for ; Wed, 2 Apr 2025 18:17:18 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=AGMdqYWW; dmarc=none; spf=none (imf08.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743617839; 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=j0C36cwE02tcp83xir3MVAFQIG4vvurnU5t2AtfKn0w=; b=GEY03naHMxR/RV+6oLYd3vyi0Ng5EqIvPmG86HMt2AlV44EC6LCIojvt5nFJl7HrAtqCCW TwSWZ1CBhtcpfmF1K2DkGMMwojUlMLDx8nijFZraxPfqRjR9FDyqqDUuA7MpH8OxwNU5/J bCRZiA0u3IHO6kBGu2qWPDOc7yuZ+zU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743617839; a=rsa-sha256; cv=none; b=WPym52EpCI6/NnNETm2nqQ/jdX/5Vu/46peLD/8o1GwZzyydDN2m/l6zw0QDzG7cnffgi5 iqAin0ZxQP/ZD8SNyfnHRgIQMg88ScnDCmWj1HXvs55+yZKns2VtCBnV51wrTdArBbxUMf OdrhDktp3OemLYokiXp/Nyjx2EOMfFs= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=AGMdqYWW; dmarc=none; spf=none (imf08.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=j0C36cwE02tcp83xir3MVAFQIG4vvurnU5t2AtfKn0w=; b=AGMdqYWWGQSORj9lU/Z8Sy1eH9 tIHnQDCaBsu30kPuU4g0U+oHAqpw9pYvrGDhW+hJVCo4yCYZTURo4QuY1+owis/vl5TmOvxIiR+oc N+v+tMBiZBS3VlUtABggFTeGRqBB//GTNzKGXykjmH+7cA2ti/VMfv/MYKRpfL7cktkEwRIDp+PhN CdhSPOZ3gdcLjcYwq79JWFPRrfEndBSzLCrSwod1NGqavu3KNYLNi0bvEaa6+WY5xTnKwDlJXGVe2 /ld56D9mczQUqaFcYQYBh31qKiO2L0EuFhG2Na2FV580cZ9D6gzfanPPc4yvoXCF/IdcKwWaSWsKF e3bbMJMQ==; Received: from willy by casper.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1u02eF-0000000A0iY-0rHI; Wed, 02 Apr 2025 18:17:11 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-arch@vger.kernel.org Subject: [PATCH v2 03/11] sparc32: Remove custom definition of mk_pte() Date: Wed, 2 Apr 2025 19:16:57 +0100 Message-ID: <20250402181709.2386022-4-willy@infradead.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250402181709.2386022-1-willy@infradead.org> References: <20250402181709.2386022-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: EFB0F160007 X-Stat-Signature: 7befsznutbq9k5myo1dhfdhazni4c5r6 X-Rspam-User: X-HE-Tag: 1743617838-875345 X-HE-Meta: U2FsdGVkX18ujPjU1+ZwkKXo2oe+TDpU2bEq6zLsRcvEQ/uwFpJ0iW4w9KSPFTCjP1whLBE26UTgiLHMXyc2FjsvIINXsD/5RIXSnaZ9fK6+uVlmUpak2eldRyEdJXGQ5LExtuhzVP/Dd4RkIx/Mr5+5SR8Kgao4stSKKKbXweN29q2zeExZXKX9pn0uUYNiNMZXXMV8/K+mjo+omSOjeBgB2HN9ZjxQGdYyfYm1smf8Wm0kK+s+CbdVu/7euH8yjhQrhsEDeW7Y8PpE3mcrwyyG8G+zUF/g+NVcXXMLWvnWxXLWTOAjSzSwaB1+79VejmF+NOGHASIll5DZPY+KwnjNsib6wpFbcb+xArV75psFOw/8kIjlIIQ8d3DuNV70Lia3pzIHcd0lL5MidCGXsD7klimed50k5dXGxKgHI8W2zFue5y0fscKGQoiM7rH7K0w5frN8Mv2zEmn/MSd2aSmERgP8ck7lWoA3gOZhIKlStzELj08Oqx2bgqwGr0LJqStt64CQQXRZb0jVWv2ObMs/bGp7oI1m6G5U5DZ2yITncySCfJdCC3T3c9Wzr4v0NgZf8GLI6VtK81DhmpoQV5kKaukIiL0m4EWHD5PmBkdLKb+jBQDHQz9uBCqUmOC5ISZSnXmh2j7Nz94d5S2Up8lQPFcJhrjMArKTNXiMJdmgLRRQjABzc99hYNQjjpoKfmwG/RD9qbIYhfFD0KUBcT0UejFFKcnMQ7T87dGxX+HajO9Med8ExCSUG5UJ3td1KbU9ZYZsL+rejG2AeJikRgclqx4DpSWVg9YN7NTh3QuWs0KPaGPG9xPLU0qsEg3eARw8RVD0ycvEMI8U7anokaSFk4EBe8XX04Nf73/ts06/AA9WFgwXhYhhzL5SHa8/TJaUwC6KUlOxhIZhKqFRYGwlelsH6c12hM3A+GtYiVbfZZmEN5uP17HAHmgk6O//b/8WI8XGirXKaUE0juF Pri+xudo YXBUam+ViBmhWGBP1WvQNJAM5zo02NlyWUvtYzV+sNlvwgFeIY9QwWlQCtTIqvSxxBHGoJvR4kv+X6bTtpRpJxzwdhxJ/wt8jUs8BDtDBJibXo4UHJYssxhhboba9p7q+T1KdC936RXsK0axETl7Qm80QzooQbyYG/IYu7Ho53rqZqrswJnV13Uw8/8qbnIWvSkVq0uwbQxQoQ2JJvkSm6oALVm6yP7uJ61S6xbIuYusjNVJhyEX4mjs55aFJi5RKUafl2XGbojgF5MIMT3D8p9FFFXvBDxF2S56o 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: List-Subscribe: List-Unsubscribe: Instead of defining pfn_pte() in terms of mk_pte(), make pfn_pte() the base implementation. That lets us use the generic definition of mk_pte(). Signed-off-by: Matthew Wilcox (Oracle) --- arch/sparc/include/asm/pgtable_32.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h index 62bcafe38b1f..1454ebe91539 100644 --- a/arch/sparc/include/asm/pgtable_32.h +++ b/arch/sparc/include/asm/pgtable_32.h @@ -255,7 +255,11 @@ static inline pte_t pte_mkyoung(pte_t pte) } #define PFN_PTE_SHIFT (PAGE_SHIFT - 4) -#define pfn_pte(pfn, prot) mk_pte(pfn_to_page(pfn), prot) + +static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) +{ + return __pte((pfn << PFN_PTE_SHIFT) | pgprot_val(pgprot)); +} static inline unsigned long pte_pfn(pte_t pte) { @@ -272,15 +276,6 @@ static inline unsigned long pte_pfn(pte_t pte) #define pte_page(pte) pfn_to_page(pte_pfn(pte)) -/* - * Conversion functions: convert a page and protection to a page entry, - * and a page entry and page directory to the page they refer to. - */ -static inline pte_t mk_pte(struct page *page, pgprot_t pgprot) -{ - return __pte((page_to_pfn(page) << (PAGE_SHIFT-4)) | pgprot_val(pgprot)); -} - static inline pte_t mk_pte_phys(unsigned long page, pgprot_t pgprot) { return __pte(((page) >> 4) | pgprot_val(pgprot));