From patchwork Tue Feb 27 19:23:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13574328 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 1FE56C5478C for ; Tue, 27 Feb 2024 19:23:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 764996B00E2; Tue, 27 Feb 2024 14:23:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 538A76B00E6; Tue, 27 Feb 2024 14:23:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 30EA56B00E8; Tue, 27 Feb 2024 14:23:43 -0500 (EST) 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 03D336B00E2 for ; Tue, 27 Feb 2024 14:23:43 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id B5DD0160D95 for ; Tue, 27 Feb 2024 19:23:42 +0000 (UTC) X-FDA: 81838558284.18.D786529 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf24.hostedemail.com (Postfix) with ESMTP id 27F0A180017 for ; Tue, 27 Feb 2024 19:23:40 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=aDgY2KhC; spf=none (imf24.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709061821; 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=W6fqlZ27VH1xlFaJzL8Rx+tU9gk2VjOfdXBM9h+YOHM=; b=Nt8zRkv+5eTO4nZUDVdgu/BRqmcbwoEz+Ug2DlhsXUTR1J1M8FXEdHNnwZ/+403g6fns42 gZBS7jy2Kb57A+xqbnu33YZcap6Ty4M0fTdC5t+t1j6FQ3qCgAM1g6pfghMBHedRifDgr3 PAKAYDpIjgYaOVCpCiI7eakjoddVjC4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709061821; a=rsa-sha256; cv=none; b=q6UP7jI35qiOYVHMk4eT4C96Z1LH1fZDXa790o80dGgN2yfxTq7aooF2Y1ZDc6cm66rgu/ 5s7iInxn2Agx4WuRrsaVpoDHyGkeOYNAD8IjQNsWihTPL/EH4OQE6fK04ln74pdqJNXRm8 teXJw5flipszOmrdXxhDdLGkrsKt9v8= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=aDgY2KhC; spf=none (imf24.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none 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=W6fqlZ27VH1xlFaJzL8Rx+tU9gk2VjOfdXBM9h+YOHM=; b=aDgY2KhCpTWgazJCsj6Q6S3FYl FixRVTvn8Lphqwv4wDh5RJUgf9uMnmBRBYnzsl9GJzkR5a0YCUxYC/DYE0dQl/cfMFJNP9+u6KfBp puBCSjty9sdAL4XywUvW711/EUSpzsK+589sPnkeXObHxRo8etgf7nmHl7s0squdY7mFaW/LDg4Or IaZGAUWCbBsexdadloB8VwtDBhKNqGM1ZirsYoc3dpCj9tbdi/BrKdWM9ffUbhLKWYPfLUKsPsiHo maamfnZobJQXkXhpOD3ieu16n/PKBh7/SZV1kV16VGCO/T6ZvAQepKE2S3738S9i5y9/RCoTiNUuR 8VFWofKA==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rf33D-00000003B1i-3Hod; Tue, 27 Feb 2024 19:23:39 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 8/8] mm: Remove cast from page_to_nid() Date: Tue, 27 Feb 2024 19:23:35 +0000 Message-ID: <20240227192337.757313-9-willy@infradead.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240227192337.757313-1-willy@infradead.org> References: <20240227192337.757313-1-willy@infradead.org> MIME-Version: 1.0 X-Stat-Signature: 6i4jgha678emxuki6wzdi35hftnpxpgw X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 27F0A180017 X-Rspam-User: X-HE-Tag: 1709061820-150406 X-HE-Meta: U2FsdGVkX19jMbykLxPDR2BIaapJ5Ujc6dYBf57SDqwuQSxyeGRB3G8FgpKGKjClJUFkt+QCBMX/Cu1VzWWAynGfjmoSNBE2kSQSDsujiYOA6ZKcE4twCkgZDtCJzSryGcvv1MAo438OGbXDpJnZKPlYmg9HH5knLeeJE3YjqhDSb25YOV+rDncK1Yed5dHE7wz7RTUbPeWEZuZdFuk2qonQvh8TG7KknC/lA4FdOw0C7EGVUsixcOLGQbfnG6hlgN5PPPTdGtCS5f+BuMQkArsI3jjrMzXVyRmMn3Bt6qmCUUKe6ZWrdm9otmGyT1rieWAgvnbhlH2dZ0J+pm4/xjKt/aZbMPz3psl1bylsl70S/gAI1/Tl4UzdDOHOdmRTJwv15k4Ath7d3xkYbGwKLBNf3tsfKNa03kLDErEEuB0PIaG0JPdrMLjSjvMa9ZZSuTYbJ8wKS36JhSF0JMhQGF9rAHGS4nH5WsWzyoxkiTNp8QxevVKItknmc5Zo1tqNjpjikqIUqvJKPWv6an2b9TowReCZF8j7JYo+pVTR1uaOY/XlyBJ8iqUIM/1kH8iubXcf5rIPXykO4Ykswt5RoSnnnBUbJJDQcE5JzPZYjBLtzPU6tYCxdiH/yCHRhdfdkT/RpOFh42S5G9QWV+8haxQbnXZu+b4rbR4jWreIF3TKLI/rZIBi5fmu5UcQ70WZHr4qmr9PPzPqXSSzPkr20z8dND0XYm6fKHt/Ky256tMuNGm67RJFScb+0UBVcjs3c5pYOfIUpBWbawIaSaCoZdAq6w8cijZEhgJXZAD4lIf1GYSvk/VqUtl99SH09vcgbDRk1kpR3IP0R6KZnGkCaGhBol2Igu/XjchHSM540O7Gg5c/n9z8fayXOxJ7QHreeIRii0S9L7sKCZWOT+AfWvffiLbD68eh 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: Now that PF_POISONED_CHECK() can take a const argument, we can drop the cast. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: David Hildenbrand --- include/linux/mm.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index c4a76520c967..21a8cfbe75aa 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1662,13 +1662,11 @@ static inline int page_zone_id(struct page *page) } #ifdef NODE_NOT_IN_PAGE_FLAGS -extern int page_to_nid(const struct page *page); +int page_to_nid(const struct page *page); #else static inline int page_to_nid(const struct page *page) { - struct page *p = (struct page *)page; - - return (PF_POISONED_CHECK(p)->flags >> NODES_PGSHIFT) & NODES_MASK; + return (PF_POISONED_CHECK(page)->flags >> NODES_PGSHIFT) & NODES_MASK; } #endif