get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.0/patches/2198465/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2198465,
    "url": "http://patchwork.ozlabs.org/api/1.0/patches/2198465/?format=api",
    "project": {
        "id": 2,
        "url": "http://patchwork.ozlabs.org/api/1.0/projects/2/?format=api",
        "name": "Linux PPC development",
        "link_name": "linuxppc-dev",
        "list_id": "linuxppc-dev.lists.ozlabs.org",
        "list_email": "linuxppc-dev@lists.ozlabs.org",
        "web_url": "https://github.com/linuxppc/wiki/wiki",
        "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git",
        "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/"
    },
    "msgid": "<20260219181407.290201-8-ynorov@nvidia.com>",
    "date": "2026-02-19T18:13:59",
    "name": "[07/12] mm: add rest_of_page() macro",
    "commit_ref": null,
    "pull_url": null,
    "state": "handled-elsewhere",
    "archived": false,
    "hash": "290448388cc57bb9facf404c9347eb10ac88bca3",
    "submitter": {
        "id": 92516,
        "url": "http://patchwork.ozlabs.org/api/1.0/people/92516/?format=api",
        "name": "Yury Norov",
        "email": "ynorov@nvidia.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260219181407.290201-8-ynorov@nvidia.com/mbox/",
    "series": [
        {
            "id": 492727,
            "url": "http://patchwork.ozlabs.org/api/1.0/series/492727/?format=api",
            "date": "2026-02-19T18:13:52",
            "name": "cleanup bitmaps printing in sysfs",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/492727/mbox/"
        }
    ],
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2198465/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <linuxppc-dev+bounces-16960-incoming=patchwork.ozlabs.org@lists.ozlabs.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linuxppc-dev@lists.ozlabs.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256\n header.s=selector2 header.b=fTbelJaR;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:21b9:f100::1; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-16960-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)",
            "lists.ozlabs.org;\n arc=pass smtp.remote-ip=\"2a01:111:f403:c105::5\" arc.chain=microsoft.com",
            "lists.ozlabs.org;\n dmarc=pass (p=reject dis=none) header.from=nvidia.com",
            "lists.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256\n header.s=selector2 header.b=fTbelJaR;\n\tdkim-atps=neutral",
            "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nvidia.com\n (client-ip=2a01:111:f403:c105::5;\n helo=ch5pr02cu005.outbound.protection.outlook.com;\n envelope-from=ynorov@nvidia.com; receiver=lists.ozlabs.org)",
            "dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=nvidia.com;"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org\n [IPv6:2404:9400:21b9:f100::1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fH5yM5dTWz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 20 Feb 2026 08:25:31 +1100 (AEDT)",
            "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4fH5yL4JVbz2xQB;\n\tFri, 20 Feb 2026 08:25:30 +1100 (AEDT)",
            "from CH5PR02CU005.outbound.protection.outlook.com\n (mail-northcentralusazlp170120005.outbound.protection.outlook.com\n [IPv6:2a01:111:f403:c105::5])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange secp256r1 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 4fH1kJ51gqz2yFQ\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 20 Feb 2026 05:14:48 +1100 (AEDT)",
            "from PH0PR12MB8800.namprd12.prod.outlook.com (2603:10b6:510:26f::12)\n by IA0PR12MB7674.namprd12.prod.outlook.com (2603:10b6:208:434::21) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9632.16; Thu, 19 Feb\n 2026 18:14:27 +0000",
            "from PH0PR12MB8800.namprd12.prod.outlook.com\n ([fe80::f79d:ddc5:2ad7:762d]) by PH0PR12MB8800.namprd12.prod.outlook.com\n ([fe80::f79d:ddc5:2ad7:762d%4]) with mapi id 15.20.9632.010; Thu, 19 Feb 2026\n 18:14:27 +0000"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1771524889;\n\tcv=pass;\n b=mphCM0uaWKsjTuJZ7nKmYVvla8hDhibYacD8dt1Zo8fEukkRYPlEtSRz8JdQeyK3B/erzS6Uo9AiBGFqNyLmJyow3dzDuWDqpZfcUgO4Y+EYWInnxom0rE0kxfMIMe3lwpFVqv7csjO8/Gjs7pZbqqjlMUjnb4aU+0YjqVHgz1D1s6zXbkzBZzLhjQzUnYvSW0tChfDENQLyd68nCaUEevJ7qbQxRLmYYiMGemp6GnACn6KcUM83tgjqUS7IhgAOPK1lfPWPl+yP509TUiud75ThzB15V7NKsgK/O0YNe7Y5U2XTZZlsQk0UmZ5ZJNoJqgMMBzA1SjFozWuTpKVpSQ==",
            "i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=CMhgNESaXFSXeYeK6Rkbeu3eEEg/eCom7/OQOxg/2FukkOL4P+Xx09H8x6PS7oud2QvrIul8kLE7TdtcEWefoYPVKbE4c2k9g2lp8I1+zIoOI31FUlC1m7+4BA4C4J4eqPrk2176uBIAgeWuiUXwBkrwJS1ExDEZ90fiBe2GpurW6YoD33tKva3r7YshmPaBl4Hsnk0xiEhlXUcz8rdeY4xyOIi+ECZbI/zIHRyq/RGlpAPJC6aWFG6nf2f5UgqGWbqLHOmLZDlkhuZv3pEgSXgRY8y1L1wtbiTMe1FsfHiDo80dfmSUUfEXZ5BYRils/FwCfUoZZ+W2LsYVeXDaFQ=="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1771524889; c=relaxed/relaxed;\n\tbh=hOkmfkIj6WgREey6ecUB3rSZwMxNq83K8wUgYIDfWT4=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t Content-Type:MIME-Version;\n b=WwCdDL3CdcEJILEx/u+8nXOcE1qRNuVFbu6Dep0VqsaTDAArLAnrMj5hD1ib9O6kKsM/nt6rElIYHaPlYxW3u2c8C4kQO7Iln1vlu8q4z+bk3ICDAIpEXjtu/9jyVvtYwjgnhJSJTjODq7knGupu9Xzpww9ZRYGxxwSkMZBuyoz+kaKH4ADWPOPQ14dbfFiVfGl0mgyo/LBB74F1nDtldW+FsK3RYHnrgXRWG4Xm7ba/rChxsbPAsSshKqGGBoiflRrJDmw+vXPjHxvod9GcMBs/EVwnRVA1NuuOXdZqlKe+VqPb47Kj98B6B9mcjnVfKoPVf9ctUUE9MRzl32+w+Q==",
            "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=hOkmfkIj6WgREey6ecUB3rSZwMxNq83K8wUgYIDfWT4=;\n b=PKR0ubTkE62Ze9HbapzG3FCKrcECKVEXIKDXAJ3CQyzdXCkbV4IrNXBZgLNGW2NRqHjDE+LqN0oblwkd47m/H2cgAgXBQZVbc7BY3psZVyR6qYY5Wo1sM2/fKbhkXPmJy0e+3JvRhhbZnPdOFf59tYGqA93iOjlwQb2dBBT99Kw3YQmrIMWWo0L7DiTECchsGLvebUXwpPbGeQET2L4LIGyZfhGkP1oJIuk4moxS2WkFmMcespcfQrDPzBAHIo7r5r6Lktvo6cE8s+qup6tZxxRyWFdQOJsNbXVvHoM4oO+qmhct1ymrnp2JOaGbghS2e6+sErDdzEvhm8hNtc2m1g=="
        ],
        "ARC-Authentication-Results": [
            "i=2; lists.ozlabs.org;\n dmarc=pass (p=reject dis=none) header.from=nvidia.com;\n dkim=pass (2048-bit key;\n unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256\n header.s=selector2 header.b=fTbelJaR; dkim-atps=neutral;\n spf=pass (client-ip=2a01:111:f403:c105::5;\n helo=ch5pr02cu005.outbound.protection.outlook.com;\n envelope-from=ynorov@nvidia.com;\n receiver=lists.ozlabs.org) smtp.mailfrom=nvidia.com",
            "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com;\n dkim=pass header.d=nvidia.com; arc=none"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;\n s=selector2;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=hOkmfkIj6WgREey6ecUB3rSZwMxNq83K8wUgYIDfWT4=;\n b=fTbelJaRZIiK3iR30iRfVz28vsljMVACNMlVpo7x5DkyrvROhkKmU3AE5q264/csBw7nZ9Oy6tKHsBw4EWnMaAsZVVu48wgPtQuTG4gTBbHV7u30+vd3LuSYcxQFCSo1pvrBxWpelTmL8XPeozpc5BjStQ0x+fc7WuZzryK5XiOGUrqCPDu7Xvi/dw6nr2dkxJZModWFYCkT1XthgqAKaDfVG1orH5ae+7RggxQEOvOU5W/NoJbcbQ6o3mM6tJPBSITv52h43c0LU8ExY87AL9r3TMFtBhB0l8+K1+220hNVIxr/T09lrRRIbi2vKSNXH8ThcqWnGXoRwDq7oyOI9g==",
        "From": "Yury Norov <ynorov@nvidia.com>",
        "To": "linux-kernel@vger.kernel.org,\n\t\"Christophe Leroy (CS GROUP)\" <chleroy@kernel.org>,\n\t\"David S. Miller\" <davem@davemloft.net>,\n\t\"Peter Zijlstra (Intel)\" <peterz@infradead.org>,\n\t\"Rafael J. Wysocki\" <rafael@kernel.org>,\n\tAlexander Shishkin <alexander.shishkin@linux.intel.com>,\n\tAndrew Lunn <andrew+netdev@lunn.ch>,\n\tAndrew Morton <akpm@linux-foundation.org>,\n\tAntoine Tenart <atenart@kernel.org>,\n\tChristian Brauner <brauner@kernel.org>,\n\tDaniel Lezcano <daniel.lezcano@linaro.org>,\n\tEric Dumazet <edumazet@google.com>,\n\tGeetha sowjanya <gakula@marvell.com>,\n\tIngo Molnar <mingo@kernel.org>,\n\tJakub Kicinski <kuba@kernel.org>,\n\tJames Clark <james.clark@linaro.org>,\n\tJerin Jacob <jerinj@marvell.com>,\n\tLinu Cherian <lcherian@marvell.com>,\n\tLukasz Luba <lukasz.luba@arm.com>,\n\tMadhavan Srinivasan <maddy@linux.ibm.com>,\n\tMichael Ellerman <mpe@ellerman.id.au>,\n\tMike Leach <mike.leach@linaro.org>,\n\tMoritz Fischer <mdf@kernel.org>,\n\tNicholas Piggin <npiggin@gmail.com>,\n\tPaolo Abeni <pabeni@redhat.com>,\n\tRasmus Villemoes <linux@rasmusvillemoes.dk>,\n\tSimon Horman <horms@kernel.org>,\n\tStanislav Fomichev <sdf@fomichev.me>,\n\tSubbaraya Sundeep <sbhatta@marvell.com>,\n\tSunil Goutham <sgoutham@marvell.com>,\n\tSuzuki K Poulose <suzuki.poulose@arm.com>,\n\tTom Rix <trix@redhat.com>,\n\tXu Yilun <yilun.xu@intel.com>,\n\tYajun Deng <yajun.deng@linux.dev>,\n\tYury Norov <yury.norov@gmail.com>,\n\tZhang Rui <rui.zhang@intel.com>,\n\thariprasad <hkelam@marvell.com>,\n\tcoresight@lists.linaro.org,\n\tlinux-arm-kernel@lists.infradead.org,\n\tlinux-fpga@vger.kernel.org,\n\tlinux-pm@vger.kernel.org,\n\tlinuxppc-dev@lists.ozlabs.org,\n\tnetdev@vger.kernel.org",
        "Cc": "Yury Norov <ynorov@nvidia.com>",
        "Subject": "[PATCH 07/12] mm: add rest_of_page() macro",
        "Date": "Thu, 19 Feb 2026 13:13:59 -0500",
        "Message-ID": "<20260219181407.290201-8-ynorov@nvidia.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260219181407.290201-1-ynorov@nvidia.com>",
        "References": "<20260219181407.290201-1-ynorov@nvidia.com>",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-ClientProxiedBy": "BN9PR03CA0878.namprd03.prod.outlook.com\n (2603:10b6:408:13c::13) To PH0PR12MB8800.namprd12.prod.outlook.com\n (2603:10b6:510:26f::12)",
        "X-Mailing-List": "linuxppc-dev@lists.ozlabs.org",
        "List-Id": "<linuxppc-dev.lists.ozlabs.org>",
        "List-Help": "<mailto:linuxppc-dev+help@lists.ozlabs.org>",
        "List-Owner": "<mailto:linuxppc-dev+owner@lists.ozlabs.org>",
        "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>",
        "List-Archive": "<https://lore.kernel.org/linuxppc-dev/>,\n  <https://lists.ozlabs.org/pipermail/linuxppc-dev/>",
        "List-Subscribe": "<mailto:linuxppc-dev+subscribe@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-digest@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-nomail@lists.ozlabs.org>",
        "List-Unsubscribe": "<mailto:linuxppc-dev+unsubscribe@lists.ozlabs.org>",
        "Precedence": "list",
        "MIME-Version": "1.0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-TrafficTypeDiagnostic": "PH0PR12MB8800:EE_|IA0PR12MB7674:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "1bd64e21-d91b-446e-424e-08de6fe2b7ed",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "\n\tBCL:0;ARA:13230040|366016|376014|7416014|10070799003|1800799024|921020;",
        "X-Microsoft-Antispam-Message-Info": "\n mRZKk8UL3Zt17DxLjwKxSL4EmKTMd+XVwz6WQQqRqZbDSUipjaaPli00GSKfQcTxqUGg/DQqMjf1t3thXyLds0Ag7I2vgdWrTYRnJXlYY2Vdgbb5KhDWguBFPxgCiskmFNiVtnhBPeNGAoBsQAWWIjQQE03GjLt0XBHLxNvmm3mg70HOC9/ntbeBj2USz2Y9MqkwVZVetjv3WtuuYPyn0TnoQUfcNIIGHwCsdhmH5A7h5denanxYD7/eyOXKQtdcwHavdRPBX8UDjUoaIGxHqdUfprlnskfJL0UEqmZu8SIbeCBBmS8WpgwPZVJGEbwqYWtK30AVTZrhhX5qHxWuHsFLwJjLuQe+uzQaa0ff4+EiUcFQwThxhow2FwOEyvOJzAetNJPr2KH3fR25Eya76t54Hr/G3iyCYXg2YYZxz1Y58DyzdhgM/FleXreAZNQ+GWbD/p75IxdHIV5iBTAuf9C9KK/Qzq7+U+O2EO5Z7T2J2Obg0KQmBLLLlvlBryzIZJfOKps/opzzYD4IWgrgpETel7KDtg6tewweGlcKa7wzyuDUewVfL4k8ML8XhM2Utq/jOShaJUtP0pmRPKDBLY6jHZX3lytByrgpSDfhtWnvn9UXEeSSEeDcnZ3R5prSvI017oLqgwQmSrLyVXFSrkRcYz/EjsfLS/6kD7a+fFBxOhk5wjU/sP4J/fk0k9AIHSVK/UJg8GavDUn0OCFsB+1O6WFOFhWkuPMBh+XG9uKM/VXZPqlnDRuTZ+cTTubewhAQ343Lc/ft78ZxBkccFcT0D/jZF4keA/oC9uiujaqrmc9o55H4KgtjAV206BBFzXyCYbANYhNaGUf8qA64Yrd2hZ0UYsDk+rHb85J4aUZ/7hcTgRRsCO7El81MiTYaIJ6feejUSkPy3ku9S58J51LsAU0OpD+bmd/NUwZ66Um/dCqAzGKDxs0WfTgyWhTugPphmdx2XerLb8syKfaTCka9dZF0Qv/mqzgWZVhKG6NIcEhzoJkh0DiZY8ZaHKSd5z/B1k0xvBRie0XkUgzA0bcZB/sle9rFUfXMTiPji41fYS1vwe/gDaeUnLilzALhFLJwuYZdQO8JHymYkKBx9Dn6fRbTlKPelwRx31PH4F3Pv39wOr+dpn+yXx3BzjH/nJlSh+CxM5+IXJM9AaQeUDlPhOdKFs9ciSK4d0YOhzUg/Aj4WQmNRUvL6Cg6/eewkPsNoWY2y7tscRLPXKp+wmau5AabpODGDnsPoYwGIIUMAfSI9FzPpmiN+xt+naH1P2QxmxHERuLfeTdKsnvWY5KnBR3HsI6+8nw0GGi/1H6SoAkvUYbglZATTt7YEAKTrBGHKAez9xir9ROVo4oKffrtyIL/4oy7fl9n0qP4aHJdMosnJjsfBwijxgreMQ/zWP5ucfu7qBjWqv9oxgYflhykkQv2uF8qinIP5ZGZ+hExpacttf8/gsDisBaWcKUrCHnDskaN1NApe6iiVTPxsAOApuf8o8bmOmoNn31T4TCr9XCIKDRjBC1VBt3bXwvfsuceVRtrrWe2SG+KZkwnRKBkohkHkZE3xEt6qoC5kEu1Rky1ujpqwLDdLYBSPVZeh6AMG0W4hvbPdh1Ew3rVGw==",
        "X-Forefront-Antispam-Report": "\n\tCIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR12MB8800.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(7416014)(10070799003)(1800799024)(921020);DIR:OUT;SFP:1101;",
        "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1",
        "X-MS-Exchange-AntiSpam-MessageData-0": "\n j3PKrEuiCrjXB99nPlKDYmo5v0DnO0sQE/fnpEi7GAyKAHhipzjW5CyNNDCHLXV2HcpmdmX7MmWKQrbR9Gh/EM2f+qAW9VEB9OgYTogxWUfq8FfDee+KrME4XjW1uhbeMZvQd8/HLU+zGt2FTeDzgpMF30C3+dQfyGgk86kJrxvb7sXgiiDJ2QRAvD8zq+SNba++TZXCQVhnQ7+UsJZwVOTUF5y4cvb4ZI3B7GQY+a1Z07FUooqCz6O+auErNxzdJDiJ1/L6NUq55jp1pcCJ0Ur2/ZK+ljzNKpyhLRDDxvy05aL8WHxlkKDEOe3+e4J0xKO6ZxQo8uDF8dBBF6goVoYs4zmxnvmT9o0dP6l0L+ehLOKKGG4d5gLZuWXYTD5xazsqr+M56EhNu8YZB9xx/u4hXOphn2cTkzgjpCAW8RW+faPxbHmrOLWlg0CI1VMERpDfNYFc14uRN5oYrfVANwdwRi8yQ6ZPdzvgMlr68ow66llkCNtcbEUeVzShbC0iy4+whtoKDOm7ZBwCRwuUcwa7C8LZpsqFZfoGNLliPySaK07fwTDHa+MRnmOXQhNQtOL7NulR+kBkKF3a1BH4sgOwyO4OxHDbuAtEJ7xC7n+mvfmNsJVMHvnIm0TrgBKl7Vv5s3SZqUI9hBpZ5s5Vmgayz3p4A+0hOfmFRWgXPvqsOwqcgewQFVF6NjRWo/A423a5D+Iew8VrnRasLe//9BUw0wm8VGIDbEKXUpPDn/N1/UkYFC5FEemTem8WGZiVEWbcQ59PUv9wN/hRkNk2JOhCbhfwgV2Xpk5q4R0a/oFsSQHoziorQRRsOw9ULu4g/vGv5+Sf3EhS8TeoGv3/398z3czdD1oDQgJISf3lNbnoxCC1aG6MiEzT+htBnnxMxhJ6HSY/vWKzwcD8x3+hqPvI0/azrtOM/RbCI4Fti9diJd3pEGXuSxrm23de57u4mqtiJDDZnA0BR1zf9/orWDbUKLMzmy1/xVA1FpZCwvZ104HtTHfWlns60R+zED04t2kUzraRrFcGH6ZiBASSLuIsXDr0HoTfZKycT45qRXCtWLVuecnPVJvQkHvR1sSgWbagTXJYzwDReQYsKKSe3n+7GRUzfOb3RtxiMSX3RUnCqTVdTIuLJYY4FeUl2l4EinwUAlByZbFTENAnbZ8cEJPpDwOQIPIAt2e3ZjtoPGNS09OMAGoq+b2sXTOslxF6KOnlmj7PfgNnpYWB/aqRgG/yp7vFpOzKUiGNydEDA/+9i5UZMHZgfMRohkEMqNUqdT2Plhxx1RpqC+96Q9caCpwFfy5yA5xE2CyBW/ct1tNzaPjS8UNeDKiqVH8bVsw/iPaIVFbTnZyXkaWUS662Jd7LlsdoQLmBDJZFLnbKHcBuWjHiSgolGyQS5ZSLhHTJ1xuUtzGVRuEBe+lkiIA55uivgk7vzGE/NIsxddXcF4a4DvM59CT0cdAwS8SbIOffBgLlFcCQGc1AQWFswxuS0aJs45owYifxskV1u+2LcL65A8p1VMYGgyxp6cjBxQ6g4IkNBOqk4j9hbwb6zwJTmBSPjAumYfsbMMX3G9Wr3lqgWSVf32nwTqg4Ocojewf988z6x+PPJKfKQeKRRmfCJl5XiZoeSi1FDrmpRnx7lYpJMoACZRJp/iJlTeDGhNsm7AnTe+PALYdxp2MVb2N0E+YF5d0Eszm+O1VxHaDxhX8XsuX90c6xFEkcOShFmm58oI+XOUAJpqIfAU6vQrrEeeRAl9kKkMLNHO3/AkVqQqwYhxwyXqFuav8UZr036Ru3",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 1bd64e21-d91b-446e-424e-08de6fe2b7ed",
        "X-MS-Exchange-CrossTenant-AuthSource": "PH0PR12MB8800.namprd12.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Internal",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "19 Feb 2026 18:14:27.5979\n (UTC)",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "Hosted",
        "X-MS-Exchange-CrossTenant-Id": "43083d15-7273-40c1-b7db-39efd9ccc17a",
        "X-MS-Exchange-CrossTenant-MailboxType": "HOSTED",
        "X-MS-Exchange-CrossTenant-UserPrincipalName": "\n ORggo27GFyJnvWJHwf0BGasEhfGiKRjU/HJi9C67Vaq0BG0l/s8NexrH4zPEBqHe93V/uWkz0RQq1EzXrNJ49Q==",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "IA0PR12MB7674",
        "X-Spam-Status": "No, score=-0.2 required=3.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n\tRCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=disabled\n\tversion=4.0.1 OzLabs 8",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on lists.ozlabs.org"
    },
    "content": "The net/9p networking driver adds a handy macro to calculate the\namount of bytes from a given pointer to the end of page. Move it\nto mm, and use tree-wide.\n\nNo functional changes intended.\n\nSigned-off-by: Yury Norov <ynorov@nvidia.com>\n---\n arch/arm64/kernel/patching.c                |  4 +---\n arch/powerpc/lib/code-patching.c            |  6 +++---\n arch/riscv/kernel/sbi.c                     |  4 ++--\n arch/s390/kvm/gaccess.c                     |  6 +++---\n arch/x86/kvm/emulate.c                      |  4 ++--\n drivers/block/null_blk/main.c               |  6 ++----\n drivers/gpu/drm/i915/gt/shmem_utils.c       |  5 ++---\n drivers/md/dm-pcache/backing_dev.h          |  2 +-\n drivers/net/ethernet/meta/fbnic/fbnic_tlv.c |  6 +++---\n drivers/s390/net/qeth_core_main.c           |  6 ++----\n drivers/spi/spi-pl022.c                     |  3 +--\n drivers/spi/spi.c                           |  4 +---\n fs/ext4/verity.c                            |  3 +--\n fs/f2fs/verity.c                            |  6 ++----\n fs/fuse/dev.c                               |  4 ++--\n fs/iomap/buffered-io.c                      |  2 +-\n fs/nfs/pagelist.c                           |  2 +-\n fs/remap_range.c                            |  3 +--\n fs/xfs/scrub/xfile.c                        |  3 +--\n include/crypto/scatterwalk.h                |  2 +-\n include/linux/highmem.h                     | 24 +++++++++------------\n include/linux/iomap.h                       |  2 +-\n include/linux/iov_iter.h                    |  3 +--\n include/linux/mm.h                          |  2 ++\n kernel/events/ring_buffer.c                 |  2 +-\n lib/bitmap-str.c                            |  2 +-\n lib/iov_iter.c                              |  5 ++---\n net/9p/trans_virtio.c                       |  6 ------\n sound/virtio/virtio_pcm_msg.c               |  4 ++--\n 29 files changed, 53 insertions(+), 78 deletions(-)",
    "diff": "diff --git a/arch/arm64/kernel/patching.c b/arch/arm64/kernel/patching.c\nindex 1041bc67a3ee..4c3a4401719b 100644\n--- a/arch/arm64/kernel/patching.c\n+++ b/arch/arm64/kernel/patching.c\n@@ -116,9 +116,7 @@ static void *__text_poke(text_poke_f func, void *addr, void *src, size_t len)\n \n \twhile (patched < len) {\n \t\tptr = addr + patched;\n-\t\tsize = min_t(size_t, PAGE_SIZE - offset_in_page(ptr),\n-\t\t\t     len - patched);\n-\n+\t\tsize = min_t(size_t, rest_of_page(ptr), len - patched);\n \t\twaddr = patch_map(ptr, FIX_TEXT_POKE0);\n \t\tfunc(waddr, src, patched, size);\n \t\tpatch_unmap(FIX_TEXT_POKE0);\ndiff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c\nindex f84e0337cc02..186a9cb79ee3 100644\n--- a/arch/powerpc/lib/code-patching.c\n+++ b/arch/powerpc/lib/code-patching.c\n@@ -463,7 +463,7 @@ static int __patch_instructions(u32 *patch_addr, u32 *code, size_t len, bool rep\n \n /*\n  * A page is mapped and instructions that fit the page are patched.\n- * Assumes 'len' to be (PAGE_SIZE - offset_in_page(addr)) or below.\n+ * Assumes 'len' to be rest_of_page(addr) or below.\n  */\n static int __do_patch_instructions_mm(u32 *addr, u32 *code, size_t len, bool repeat_instr)\n {\n@@ -514,7 +514,7 @@ static int __do_patch_instructions_mm(u32 *addr, u32 *code, size_t len, bool rep\n \n /*\n  * A page is mapped and instructions that fit the page are patched.\n- * Assumes 'len' to be (PAGE_SIZE - offset_in_page(addr)) or below.\n+ * Assumes 'len' to be rest_of_page(addr) or below.\n  */\n static int __do_patch_instructions(u32 *addr, u32 *code, size_t len, bool repeat_instr)\n {\n@@ -554,7 +554,7 @@ int patch_instructions(u32 *addr, u32 *code, size_t len, bool repeat_instr)\n \t\tsize_t plen;\n \t\tint err;\n \n-\t\tplen = min_t(size_t, PAGE_SIZE - offset_in_page(addr), len);\n+\t\tplen = min_t(size_t, rest_of_page(addr), len);\n \n \t\tlocal_irq_save(flags);\n \t\tif (mm_patch_enabled())\ndiff --git a/arch/riscv/kernel/sbi.c b/arch/riscv/kernel/sbi.c\nindex c443337056ab..9a2f656f776f 100644\n--- a/arch/riscv/kernel/sbi.c\n+++ b/arch/riscv/kernel/sbi.c\n@@ -602,7 +602,7 @@ int sbi_debug_console_write(const char *bytes, unsigned int num_bytes)\n \telse\n \t\tbase_addr = __pa(bytes);\n \tif (PAGE_SIZE < (offset_in_page(bytes) + num_bytes))\n-\t\tnum_bytes = PAGE_SIZE - offset_in_page(bytes);\n+\t\tnum_bytes = rest_of_page(bytes);\n \n \tif (IS_ENABLED(CONFIG_32BIT))\n \t\tret = sbi_ecall(SBI_EXT_DBCN, SBI_EXT_DBCN_CONSOLE_WRITE,\n@@ -631,7 +631,7 @@ int sbi_debug_console_read(char *bytes, unsigned int num_bytes)\n \telse\n \t\tbase_addr = __pa(bytes);\n \tif (PAGE_SIZE < (offset_in_page(bytes) + num_bytes))\n-\t\tnum_bytes = PAGE_SIZE - offset_in_page(bytes);\n+\t\tnum_bytes = rest_of_page(bytes);\n \n \tif (IS_ENABLED(CONFIG_32BIT))\n \t\tret = sbi_ecall(SBI_EXT_DBCN, SBI_EXT_DBCN_CONSOLE_READ,\ndiff --git a/arch/s390/kvm/gaccess.c b/arch/s390/kvm/gaccess.c\nindex 4630b2a067ea..40f85b7eca63 100644\n--- a/arch/s390/kvm/gaccess.c\n+++ b/arch/s390/kvm/gaccess.c\n@@ -973,7 +973,7 @@ int access_guest_with_key(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar,\n \tif (rc)\n \t\tgoto out_unlock;\n \tfor (idx = 0; idx < nr_pages; idx++) {\n-\t\tfragment_len = min(PAGE_SIZE - offset_in_page(gpas[idx]), len);\n+\t\tfragment_len = min(rest_of_page(gpas[idx]), len);\n \t\tif (try_fetch_prot_override && fetch_prot_override_applies(ga, fragment_len)) {\n \t\t\trc = access_guest_page_gpa(vcpu->kvm, mode, gpas[idx], data, fragment_len);\n \t\t} else {\n@@ -1015,7 +1015,7 @@ int access_guest_real(struct kvm_vcpu *vcpu, unsigned long gra,\n \n \twhile (len && !rc) {\n \t\tgpa = kvm_s390_real_to_abs(vcpu, gra);\n-\t\tfragment_len = min(PAGE_SIZE - offset_in_page(gpa), len);\n+\t\tfragment_len = min(rest_of_page(gpa), len);\n \t\trc = access_guest_page_gpa(vcpu->kvm, mode, gpa, data, fragment_len);\n \t\tlen -= fragment_len;\n \t\tgra += fragment_len;\n@@ -1237,7 +1237,7 @@ int check_gpa_range(struct kvm *kvm, unsigned long gpa, unsigned long length,\n \tint rc = 0;\n \n \twhile (length && !rc) {\n-\t\tfragment_len = min(PAGE_SIZE - offset_in_page(gpa), length);\n+\t\tfragment_len = min(rest_of_page(gpa), length);\n \t\trc = vm_check_access_key_gpa(kvm, access_key, mode, gpa);\n \t\tlength -= fragment_len;\n \t\tgpa += fragment_len;\ndiff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c\nindex c8e292e9a24d..292a84e97a8a 100644\n--- a/arch/x86/kvm/emulate.c\n+++ b/arch/x86/kvm/emulate.c\n@@ -864,7 +864,7 @@ static int __do_insn_fetch_bytes(struct x86_emulate_ctxt *ctxt, int op_size)\n \t\treturn rc;\n \n \tsize = min_t(unsigned, 15UL ^ cur_size, max_size);\n-\tsize = min_t(unsigned, size, PAGE_SIZE - offset_in_page(linear));\n+\tsize = min_t(unsigned int, size, rest_of_page(linear));\n \n \t/*\n \t * One instruction can only straddle two pages,\n@@ -1372,7 +1372,7 @@ static int pio_in_emulated(struct x86_emulate_ctxt *ctxt,\n \t\t\taddress_mask(ctxt, reg_read(ctxt, VCPU_REGS_RCX)) : 1;\n \t\tin_page = (ctxt->eflags & X86_EFLAGS_DF) ?\n \t\t\toffset_in_page(reg_read(ctxt, VCPU_REGS_RDI)) :\n-\t\t\tPAGE_SIZE - offset_in_page(reg_read(ctxt, VCPU_REGS_RDI));\n+\t\t\trest_of_page(reg_read(ctxt, VCPU_REGS_RDI));\n \t\tn = min3(in_page, (unsigned int)sizeof(rc->data) / size, count);\n \t\tif (n == 0)\n \t\t\tn = 1;\ndiff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c\nindex 740a8ac42075..130fbcecedeb 100644\n--- a/drivers/block/null_blk/main.c\n+++ b/drivers/block/null_blk/main.c\n@@ -1147,8 +1147,7 @@ static blk_status_t copy_to_nullb(struct nullb *nullb, void *source,\n \tsector_t sector;\n \n \twhile (count < n) {\n-\t\ttemp = min3(nullb->dev->blocksize, n - count,\n-\t\t\t    PAGE_SIZE - offset_in_page(pos));\n+\t\ttemp = min3(nullb->dev->blocksize, n - count, rest_of_page(pos));\n \t\tsector = pos >> SECTOR_SHIFT;\n \n \t\tif (null_cache_active(nullb) && !is_fua)\n@@ -1181,8 +1180,7 @@ static void copy_from_nullb(struct nullb *nullb, void *dest, loff_t pos,\n \tsector_t sector;\n \n \twhile (count < n) {\n-\t\ttemp = min3(nullb->dev->blocksize, n - count,\n-\t\t\t    PAGE_SIZE - offset_in_page(pos));\n+\t\ttemp = min3(nullb->dev->blocksize, n - count, rest_of_page(pos));\n \t\tsector = pos >> SECTOR_SHIFT;\n \n \t\tt_page = null_lookup_page(nullb, sector, false,\ndiff --git a/drivers/gpu/drm/i915/gt/shmem_utils.c b/drivers/gpu/drm/i915/gt/shmem_utils.c\nindex 365c4b8b04f4..f56092acd233 100644\n--- a/drivers/gpu/drm/i915/gt/shmem_utils.c\n+++ b/drivers/gpu/drm/i915/gt/shmem_utils.c\n@@ -98,8 +98,7 @@ static int __shmem_rw(struct file *file, loff_t off,\n \tunsigned long pfn;\n \n \tfor (pfn = off >> PAGE_SHIFT; len; pfn++) {\n-\t\tunsigned int this =\n-\t\t\tmin_t(size_t, PAGE_SIZE - offset_in_page(off), len);\n+\t\tunsigned int this = min_t(size_t, rest_of_page(off), len);\n \t\tstruct page *page;\n \t\tvoid *vaddr;\n \n@@ -134,7 +133,7 @@ int shmem_read_to_iosys_map(struct file *file, loff_t off,\n \n \tfor (pfn = off >> PAGE_SHIFT; len; pfn++) {\n \t\tunsigned int this =\n-\t\t\tmin_t(size_t, PAGE_SIZE - offset_in_page(off), len);\n+\t\t\tmin_t(size_t, rest_of_page(off), len);\n \t\tstruct page *page;\n \t\tvoid *vaddr;\n \ndiff --git a/drivers/md/dm-pcache/backing_dev.h b/drivers/md/dm-pcache/backing_dev.h\nindex b371cba483b9..17e83b38b845 100644\n--- a/drivers/md/dm-pcache/backing_dev.h\n+++ b/drivers/md/dm-pcache/backing_dev.h\n@@ -96,7 +96,7 @@ static inline u32 backing_dev_req_coalesced_max_len(const void *data, u32 len)\n \n \tfirst_page = vmalloc_to_page(p);\n advance:\n-\tin_page = PAGE_SIZE - offset_in_page(p);\n+\tin_page = rest_of_page(p);\n \tto_advance = min_t(u32, in_page, len - done);\n \n \tdone += to_advance;\ndiff --git a/drivers/net/ethernet/meta/fbnic/fbnic_tlv.c b/drivers/net/ethernet/meta/fbnic/fbnic_tlv.c\nindex 517ed8b2f1cb..2e80c25ba3c8 100644\n--- a/drivers/net/ethernet/meta/fbnic/fbnic_tlv.c\n+++ b/drivers/net/ethernet/meta/fbnic/fbnic_tlv.c\n@@ -52,7 +52,7 @@ struct fbnic_tlv_msg *fbnic_tlv_msg_alloc(u16 msg_id)\n  **/\n int fbnic_tlv_attr_put_flag(struct fbnic_tlv_msg *msg, const u16 attr_id)\n {\n-\tint attr_max_len = PAGE_SIZE - offset_in_page(msg) - sizeof(*msg);\n+\tint attr_max_len = rest_of_page(msg) - sizeof(*msg);\n \tstruct fbnic_tlv_hdr hdr = { 0 };\n \tstruct fbnic_tlv_msg *attr;\n \n@@ -94,7 +94,7 @@ int fbnic_tlv_attr_put_flag(struct fbnic_tlv_msg *msg, const u16 attr_id)\n int fbnic_tlv_attr_put_value(struct fbnic_tlv_msg *msg, const u16 attr_id,\n \t\t\t     const void *value, const int len)\n {\n-\tint attr_max_len = PAGE_SIZE - offset_in_page(msg) - sizeof(*msg);\n+\tint attr_max_len = rest_of_page(msg) - sizeof(*msg);\n \tstruct fbnic_tlv_hdr hdr = { 0 };\n \tstruct fbnic_tlv_msg *attr;\n \n@@ -292,7 +292,7 @@ ssize_t fbnic_tlv_attr_get_string(struct fbnic_tlv_msg *attr, char *dst,\n struct fbnic_tlv_msg *fbnic_tlv_attr_nest_start(struct fbnic_tlv_msg *msg,\n \t\t\t\t\t\tu16 attr_id)\n {\n-\tint attr_max_len = PAGE_SIZE - offset_in_page(msg) - sizeof(*msg);\n+\tint attr_max_len = rest_of_page(msg) - sizeof(*msg);\n \tstruct fbnic_tlv_msg *attr = &msg[le16_to_cpu(msg->hdr.len)];\n \tstruct fbnic_tlv_hdr hdr = { 0 };\n \ndiff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c\nindex 1c80e8ca67b5..1b983c397fa8 100644\n--- a/drivers/s390/net/qeth_core_main.c\n+++ b/drivers/s390/net/qeth_core_main.c\n@@ -4087,8 +4087,7 @@ static unsigned int qeth_fill_buffer(struct qeth_qdio_out_buffer *buf,\n \n \t/* map linear part into buffer element(s) */\n \twhile (length > 0) {\n-\t\telem_length = min_t(unsigned int, length,\n-\t\t\t\t    PAGE_SIZE - offset_in_page(data));\n+\t\telem_length = min_t(unsigned int, length, rest_of_page(data));\n \n \t\tbuffer->element[element].addr = virt_to_dma64(data);\n \t\tbuffer->element[element].length = elem_length;\n@@ -4117,8 +4116,7 @@ static unsigned int qeth_fill_buffer(struct qeth_qdio_out_buffer *buf,\n \t\tdata = skb_frag_address(frag);\n \t\tlength = skb_frag_size(frag);\n \t\twhile (length > 0) {\n-\t\t\telem_length = min_t(unsigned int, length,\n-\t\t\t\t\t    PAGE_SIZE - offset_in_page(data));\n+\t\t\telem_length = min_t(unsigned int, length, rest_of_page(data));\n \n \t\t\tbuffer->element[element].addr = virt_to_dma64(data);\n \t\t\tbuffer->element[element].length = elem_length;\ndiff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c\nindex c32a1fba31ef..da44a37b22df 100644\n--- a/drivers/spi/spi-pl022.c\n+++ b/drivers/spi/spi-pl022.c\n@@ -761,8 +761,7 @@ static void setup_dma_scatter(struct pl022 *pl022,\n \t\t\t * we just feed in this, else we stuff in as much\n \t\t\t * as we can.\n \t\t\t */\n-\t\t\tmapbytes = min_t(int, bytesleft,\n-\t\t\t\t\t PAGE_SIZE - offset_in_page(bufp));\n+\t\t\tmapbytes = min_t(int, bytesleft, rest_of_page(bufp));\n \n \t\t\tsg_set_page(sg, virt_to_page(bufp),\n \t\t\t\t    mapbytes, offset_in_page(bufp));\ndiff --git a/drivers/spi/spi.c b/drivers/spi/spi.c\nindex 3887fcf8ec86..ad23fad29b9d 100644\n--- a/drivers/spi/spi.c\n+++ b/drivers/spi/spi.c\n@@ -1162,9 +1162,7 @@ static int spi_map_buf_attrs(struct spi_controller *ctlr, struct device *dev,\n \t\t\t * the desc_len and the remaining buffer length that\n \t\t\t * fits in a page.\n \t\t\t */\n-\t\t\tmin = min_t(size_t, desc_len,\n-\t\t\t\t    min_t(size_t, len,\n-\t\t\t\t\t  PAGE_SIZE - offset_in_page(buf)));\n+\t\t\tmin = min_t(size_t, desc_len, min_t(size_t, len, rest_of_page(buf)));\n \t\t\tif (vmalloced_buf)\n \t\t\t\tvm_page = vmalloc_to_page(buf);\n \t\t\telse\ndiff --git a/fs/ext4/verity.c b/fs/ext4/verity.c\nindex ca61da53f313..3dc95581e4b1 100644\n--- a/fs/ext4/verity.c\n+++ b/fs/ext4/verity.c\n@@ -74,8 +74,7 @@ static int pagecache_write(struct inode *inode, const void *buf, size_t count,\n \t\treturn -EFBIG;\n \n \twhile (count) {\n-\t\tsize_t n = min_t(size_t, count,\n-\t\t\t\t PAGE_SIZE - offset_in_page(pos));\n+\t\tsize_t n = min_t(size_t, count, rest_of_page(pos));\n \t\tstruct folio *folio;\n \t\tvoid *fsdata = NULL;\n \t\tint res;\ndiff --git a/fs/f2fs/verity.c b/fs/f2fs/verity.c\nindex 92ebcc19cab0..1c3403fbf2a8 100644\n--- a/fs/f2fs/verity.c\n+++ b/fs/f2fs/verity.c\n@@ -44,8 +44,7 @@ static int pagecache_read(struct inode *inode, void *buf, size_t count,\n \t\t\t  loff_t pos)\n {\n \twhile (count) {\n-\t\tsize_t n = min_t(size_t, count,\n-\t\t\t\t PAGE_SIZE - offset_in_page(pos));\n+\t\tsize_t n = min_t(size_t, count, rest_of_page(pos));\n \t\tstruct page *page;\n \n \t\tpage = read_mapping_page(inode->i_mapping, pos >> PAGE_SHIFT,\n@@ -78,8 +77,7 @@ static int pagecache_write(struct inode *inode, const void *buf, size_t count,\n \t\treturn -EFBIG;\n \n \twhile (count) {\n-\t\tsize_t n = min_t(size_t, count,\n-\t\t\t\t PAGE_SIZE - offset_in_page(pos));\n+\t\tsize_t n = min_t(size_t, count, rest_of_page(pos));\n \t\tstruct folio *folio;\n \t\tvoid *fsdata = NULL;\n \t\tint res;\ndiff --git a/fs/fuse/dev.c b/fs/fuse/dev.c\nindex a30c8b57d478..84cd3e277366 100644\n--- a/fs/fuse/dev.c\n+++ b/fs/fuse/dev.c\n@@ -1157,8 +1157,8 @@ static int fuse_copy_folio(struct fuse_copy_state *cs, struct folio **foliop,\n \t\t\tunsigned int copy = count;\n \t\t\tunsigned int bytes_copied;\n \n-\t\t\tif (folio_test_highmem(folio) && count > PAGE_SIZE - offset_in_page(offset))\n-\t\t\t\tcopy = PAGE_SIZE - offset_in_page(offset);\n+\t\t\tif (folio_test_highmem(folio) && count > rest_of_page(offset))\n+\t\t\t\tcopy = rest_of_page(offset);\n \n \t\t\tbytes_copied = fuse_copy_do(cs, &buf, &copy);\n \t\t\tkunmap_local(mapaddr);\ndiff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c\nindex 1fe19b4ee2f4..b5aa0676141f 100644\n--- a/fs/iomap/buffered-io.c\n+++ b/fs/iomap/buffered-io.c\n@@ -852,7 +852,7 @@ static struct folio *__iomap_get_folio(struct iomap_iter *iter,\n \tloff_t pos = iter->pos;\n \n \tif (!mapping_large_folio_support(iter->inode->i_mapping))\n-\t\tlen = min_t(size_t, len, PAGE_SIZE - offset_in_page(pos));\n+\t\tlen = min_t(size_t, len, rest_of_page(pos));\n \n \tif (iter->iomap.flags & IOMAP_F_FOLIO_BATCH) {\n \t\tstruct folio *folio = folio_batch_next(iter->fbatch);\ndiff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c\nindex 6e69ce43a13f..a5b761304067 100644\n--- a/fs/nfs/pagelist.c\n+++ b/fs/nfs/pagelist.c\n@@ -60,7 +60,7 @@ static struct page *nfs_page_iter_page_get(struct nfs_page_iter_page *i)\n \n \tif (i->count != req->wb_bytes) {\n \t\tsize_t base = i->count + req->wb_pgbase;\n-\t\tsize_t len = PAGE_SIZE - offset_in_page(base);\n+\t\tsize_t len = rest_of_page(base);\n \n \t\tpage = nfs_page_to_page(req, base);\n \t\tnfs_page_iter_page_advance(i, len);\ndiff --git a/fs/remap_range.c b/fs/remap_range.c\nindex 26afbbbfb10c..83f325e7f96b 100644\n--- a/fs/remap_range.c\n+++ b/fs/remap_range.c\n@@ -199,8 +199,7 @@ static int vfs_dedupe_file_range_compare(struct file *src, loff_t srcoff,\n \twhile (len) {\n \t\tstruct folio *src_folio, *dst_folio;\n \t\tvoid *src_addr, *dst_addr;\n-\t\tloff_t cmp_len = min(PAGE_SIZE - offset_in_page(srcoff),\n-\t\t\t\t     PAGE_SIZE - offset_in_page(dstoff));\n+\t\tloff_t cmp_len = min(rest_of_page(srcoff), rest_of_page(dstoff));\n \n \t\tcmp_len = min(cmp_len, len);\n \t\tif (cmp_len <= 0)\ndiff --git a/fs/xfs/scrub/xfile.c b/fs/xfs/scrub/xfile.c\nindex 2998c9b62f4b..e07b153965ae 100644\n--- a/fs/xfs/scrub/xfile.c\n+++ b/fs/xfs/scrub/xfile.c\n@@ -134,8 +134,7 @@ xfile_load(\n \t\t\t * No data stored at this offset, just zero the output\n \t\t\t * buffer until the next page boundary.\n \t\t\t */\n-\t\t\tlen = min_t(ssize_t, count,\n-\t\t\t\tPAGE_SIZE - offset_in_page(pos));\n+\t\t\tlen = min_t(ssize_t, count, rest_of_page(pos));\n \t\t\tmemset(buf, 0, len);\n \t\t} else {\n \t\t\tif (filemap_check_wb_err(inode->i_mapping, 0)) {\ndiff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h\nindex 624fab589c2c..c671d5383c12 100644\n--- a/include/crypto/scatterwalk.h\n+++ b/include/crypto/scatterwalk.h\n@@ -73,7 +73,7 @@ static inline unsigned int scatterwalk_clamp(struct scatter_walk *walk,\n \t * page due to the data not being aligned to the algorithm's alignmask.\n \t */\n \tif (IS_ENABLED(CONFIG_HIGHMEM))\n-\t\tlimit = PAGE_SIZE - offset_in_page(walk->offset);\n+\t\tlimit = rest_of_page(walk->offset);\n \telse\n \t\tlimit = PAGE_SIZE;\n \ndiff --git a/include/linux/highmem.h b/include/linux/highmem.h\nindex af03db851a1d..05528ba886fb 100644\n--- a/include/linux/highmem.h\n+++ b/include/linux/highmem.h\n@@ -507,12 +507,10 @@ static inline void memcpy_folio(struct folio *dst_folio, size_t dst_off,\n \t\tconst char *src = kmap_local_folio(src_folio, src_off);\n \t\tsize_t chunk = len;\n \n-\t\tif (folio_test_highmem(dst_folio) &&\n-\t\t    chunk > PAGE_SIZE - offset_in_page(dst_off))\n-\t\t\tchunk = PAGE_SIZE - offset_in_page(dst_off);\n-\t\tif (folio_test_highmem(src_folio) &&\n-\t\t    chunk > PAGE_SIZE - offset_in_page(src_off))\n-\t\t\tchunk = PAGE_SIZE - offset_in_page(src_off);\n+\t\tif (folio_test_highmem(dst_folio) && chunk > rest_of_page(dst_off))\n+\t\t\tchunk = rest_of_page(dst_off);\n+\t\tif (folio_test_highmem(src_folio) && chunk > rest_of_page(src_off))\n+\t\t\tchunk = rest_of_page(src_off);\n \t\tmemcpy(dst, src, chunk);\n \t\tkunmap_local(src);\n \t\tkunmap_local(dst);\n@@ -580,9 +578,8 @@ static inline void memcpy_from_folio(char *to, struct folio *folio,\n \t\tconst char *from = kmap_local_folio(folio, offset);\n \t\tsize_t chunk = len;\n \n-\t\tif (folio_test_partial_kmap(folio) &&\n-\t\t    chunk > PAGE_SIZE - offset_in_page(offset))\n-\t\t\tchunk = PAGE_SIZE - offset_in_page(offset);\n+\t\tif (folio_test_partial_kmap(folio) && chunk > rest_of_page(offset))\n+\t\t\tchunk = rest_of_page(offset);\n \t\tmemcpy(to, from, chunk);\n \t\tkunmap_local(from);\n \n@@ -608,9 +605,8 @@ static inline void memcpy_to_folio(struct folio *folio, size_t offset,\n \t\tchar *to = kmap_local_folio(folio, offset);\n \t\tsize_t chunk = len;\n \n-\t\tif (folio_test_partial_kmap(folio) &&\n-\t\t    chunk > PAGE_SIZE - offset_in_page(offset))\n-\t\t\tchunk = PAGE_SIZE - offset_in_page(offset);\n+\t\tif (folio_test_partial_kmap(folio) && chunk > rest_of_page(offset))\n+\t\t\tchunk = rest_of_page(offset);\n \t\tmemcpy(to, from, chunk);\n \t\tkunmap_local(to);\n \n@@ -642,7 +638,7 @@ static inline __must_check void *folio_zero_tail(struct folio *folio,\n \tsize_t len = folio_size(folio) - offset;\n \n \tif (folio_test_partial_kmap(folio)) {\n-\t\tsize_t max = PAGE_SIZE - offset_in_page(offset);\n+\t\tsize_t max = rest_of_page(offset);\n \n \t\twhile (len > max) {\n \t\t\tmemset(kaddr, 0, max);\n@@ -680,7 +676,7 @@ static inline void folio_fill_tail(struct folio *folio, size_t offset,\n \tVM_BUG_ON(offset + len > folio_size(folio));\n \n \tif (folio_test_partial_kmap(folio)) {\n-\t\tsize_t max = PAGE_SIZE - offset_in_page(offset);\n+\t\tsize_t max = rest_of_page(offset);\n \n \t\twhile (len > max) {\n \t\t\tmemcpy(to, from, max);\ndiff --git a/include/linux/iomap.h b/include/linux/iomap.h\nindex 99b7209dabd7..6ae549192adb 100644\n--- a/include/linux/iomap.h\n+++ b/include/linux/iomap.h\n@@ -142,7 +142,7 @@ static inline void *iomap_inline_data(const struct iomap *iomap, loff_t pos)\n  */\n static inline bool iomap_inline_data_valid(const struct iomap *iomap)\n {\n-\treturn iomap->length <= PAGE_SIZE - offset_in_page(iomap->inline_data);\n+\treturn iomap->length <= rest_of_page(iomap->inline_data);\n }\n \n /*\ndiff --git a/include/linux/iov_iter.h b/include/linux/iov_iter.h\nindex f9a17fbbd398..13a9ee653ef8 100644\n--- a/include/linux/iov_iter.h\n+++ b/include/linux/iov_iter.h\n@@ -227,8 +227,7 @@ size_t iterate_xarray(struct iov_iter *iter, size_t len, void *priv, void *priv2\n \t\twhile (flen) {\n \t\t\tvoid *base = kmap_local_folio(folio, offset);\n \n-\t\t\tpart = min_t(size_t, flen,\n-\t\t\t\t     PAGE_SIZE - offset_in_page(offset));\n+\t\t\tpart = min_t(size_t, flen, rest_of_page(offset));\n \t\t\tremain = step(base, progress, part, priv, priv2);\n \t\t\tkunmap_local(base);\n \ndiff --git a/include/linux/mm.h b/include/linux/mm.h\nindex dc1ad71a2a70..13e93be30501 100644\n--- a/include/linux/mm.h\n+++ b/include/linux/mm.h\n@@ -2579,6 +2579,8 @@ extern void pagefault_out_of_memory(void);\n #define offset_in_page(p)\t((unsigned long)(p) & ~PAGE_MASK)\n #define offset_in_folio(folio, p) ((unsigned long)(p) & (folio_size(folio) - 1))\n \n+#define rest_of_page(p)\t\t(PAGE_SIZE - offset_in_page(p))\n+\n /*\n  * Parameter block passed down to zap_pte_range in exceptional cases.\n  */\ndiff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c\nindex 3e7de2661417..1db2868b90c9 100644\n--- a/kernel/events/ring_buffer.c\n+++ b/kernel/events/ring_buffer.c\n@@ -590,7 +590,7 @@ long perf_output_copy_aux(struct perf_output_handle *aux_handle,\n \tto &= (rb->aux_nr_pages << PAGE_SHIFT) - 1;\n \n \tdo {\n-\t\ttocopy = PAGE_SIZE - offset_in_page(from);\n+\t\ttocopy = rest_of_page(from);\n \t\tif (to > from)\n \t\t\ttocopy = min(tocopy, to - from);\n \t\tif (!tocopy)\ndiff --git a/lib/bitmap-str.c b/lib/bitmap-str.c\nindex be745209507a..a357342d5d6c 100644\n--- a/lib/bitmap-str.c\n+++ b/lib/bitmap-str.c\n@@ -58,7 +58,7 @@ EXPORT_SYMBOL(bitmap_parse_user);\n int bitmap_print_to_pagebuf(bool list, char *buf, const unsigned long *maskp,\n \t\t\t    int nmaskbits)\n {\n-\tptrdiff_t len = PAGE_SIZE - offset_in_page(buf);\n+\tptrdiff_t len = rest_of_page(buf);\n \n \treturn list ? scnprintf(buf, len, \"%*pbl\\n\", nmaskbits, maskp) :\n \t\t      scnprintf(buf, len, \"%*pb\\n\", nmaskbits, maskp);\ndiff --git a/lib/iov_iter.c b/lib/iov_iter.c\nindex 545250507f08..4258cf910fec 100644\n--- a/lib/iov_iter.c\n+++ b/lib/iov_iter.c\n@@ -483,9 +483,8 @@ size_t copy_folio_from_iter_atomic(struct folio *folio, size_t offset,\n \t\tchar *to = kmap_local_folio(folio, offset);\n \n \t\tn = bytes - copied;\n-\t\tif (folio_test_partial_kmap(folio) &&\n-\t\t    n > PAGE_SIZE - offset_in_page(offset))\n-\t\t\tn = PAGE_SIZE - offset_in_page(offset);\n+\t\tif (folio_test_partial_kmap(folio) && n > rest_of_page(offset))\n+\t\t\tn = rest_of_page(offset);\n \n \t\tpagefault_disable();\n \t\tn = __copy_from_iter(to, n, i);\ndiff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c\nindex 370f4f37dcec..3aded4ba4575 100644\n--- a/net/9p/trans_virtio.c\n+++ b/net/9p/trans_virtio.c\n@@ -87,12 +87,6 @@ struct virtio_chan {\n \n static struct list_head virtio_chan_list;\n \n-/* How many bytes left in this page. */\n-static unsigned int rest_of_page(void *data)\n-{\n-\treturn PAGE_SIZE - offset_in_page(data);\n-}\n-\n /**\n  * p9_virtio_close - reclaim resources of a channel\n  * @client: client instance\ndiff --git a/sound/virtio/virtio_pcm_msg.c b/sound/virtio/virtio_pcm_msg.c\nindex 9778020a7ba8..2f45664a21ac 100644\n--- a/sound/virtio/virtio_pcm_msg.c\n+++ b/sound/virtio/virtio_pcm_msg.c\n@@ -56,7 +56,7 @@ static int virtsnd_pcm_sg_num(u8 *data, unsigned int length)\n \t\tphys_addr_t pg_address = page_to_phys(pg);\n \t\tsize_t pg_length;\n \n-\t\tpg_length = PAGE_SIZE - offset_in_page(data);\n+\t\tpg_length = rest_of_page(data);\n \t\tif (pg_length > length)\n \t\t\tpg_length = length;\n \n@@ -96,7 +96,7 @@ static void virtsnd_pcm_sg_from(struct scatterlist *sgs, int nsgs, u8 *data,\n \t\tstruct page *pg = vmalloc_to_page(data);\n \t\tsize_t pg_length;\n \n-\t\tpg_length = PAGE_SIZE - offset_in_page(data);\n+\t\tpg_length = rest_of_page(data);\n \t\tif (pg_length > length)\n \t\t\tpg_length = length;\n \n",
    "prefixes": [
        "07/12"
    ]
}