{"id":2232223,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2232223/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20260504003421.2545713-2-mikhail.kshevetskiy@iopsys.eu/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.2/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260504003421.2545713-2-mikhail.kshevetskiy@iopsys.eu>","list_archive_url":null,"date":"2026-05-04T00:34:13","name":"[v3,1/9] bitfield: Add non-constant field_{prep,get}() helpers","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"a1e989165da3e9daa0a6ccca6c7930c0ac8da678","submitter":{"id":84987,"url":"http://patchwork.ozlabs.org/api/1.2/people/84987/?format=json","name":"Mikhail Kshevetskiy","email":"mikhail.kshevetskiy@iopsys.eu"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20260504003421.2545713-2-mikhail.kshevetskiy@iopsys.eu/mbox/","series":[{"id":502598,"url":"http://patchwork.ozlabs.org/api/1.2/series/502598/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=502598","date":"2026-05-04T00:34:12","name":"pinctrl: add support of Airoha SoCs","version":3,"mbox":"http://patchwork.ozlabs.org/series/502598/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2232223/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2232223/checks/","tags":{},"related":[],"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=iopsys.eu header.i=@iopsys.eu header.a=rsa-sha256\n header.s=selector1 header.b=JDF0cXX2;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=iopsys.eu","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=iopsys.eu header.i=@iopsys.eu header.b=\"JDF0cXX2\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=iopsys.eu","phobos.denx.de;\n spf=pass smtp.mailfrom=mikhail.kshevetskiy@genexis.eu","dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=iopsys.eu;"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g82jG5828z1yJ9\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 04 May 2026 10:34:58 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id DED08845C8;\n\tMon,  4 May 2026 02:34:44 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 1C4DD8460D; Mon,  4 May 2026 02:34:44 +0200 (CEST)","from AM0PR83CU005.outbound.protection.outlook.com\n (mail-westeuropeazlp170100001.outbound.protection.outlook.com\n [IPv6:2a01:111:f403:c201::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id BE68384374\n for <u-boot@lists.denx.de>; Mon,  4 May 2026 02:34:41 +0200 (CEST)","from VI1PR08MB10029.eurprd08.prod.outlook.com\n (2603:10a6:800:1c6::15) by DU0PR08MB8662.eurprd08.prod.outlook.com\n (2603:10a6:10:402::11) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9870.25; Mon, 4 May\n 2026 00:34:40 +0000","from VI1PR08MB10029.eurprd08.prod.outlook.com\n ([fe80::5e67:2d67:644b:9681]) by VI1PR08MB10029.eurprd08.prod.outlook.com\n ([fe80::5e67:2d67:644b:9681%6]) with mapi id 15.20.9846.025; Mon, 4 May 2026\n 00:34:39 +0000"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=no\n autolearn_force=no version=3.4.2","ARC-Seal":"i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=P+iGPN6yCDvIdLGTtscYWJ9fpQ7ogGv8usfIS/B/7Z2Gq5nYBc+WFSJBI7QvNxUCxLDcoslzikaGyVhOaWPePDMzOm7MNMPeKvO92Txu+9cz5T5D/yEmQBf2J8BMB4HkgzSYdIzvsITSRz0MQgouT0NfZHVVZiZmo+7u3zigQh8JQIHQw4KRtP2ogeZ1Eld+GcfoQzl6rfoHtrXKPjCMV1M8rCkU/iQRBU1HTy/OdruMCX2iJ8ZJtPBnOih36XO35XODt+ZH4DYGCoNmqf5toX0ARn9W7K8ojGoAcBjvwAnrT3TWd2Ahr1CdCXBHgsG8j4J6GXv5Xhu+GZRce4azgA==","ARC-Message-Signature":"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=agd54caNBhEzMkHLlKcQasaa/ynLBZ08mPHCb0+u9v0=;\n b=RxGFzK9Iy1eyuU5T1eBMz+LQHm1llRMKHUZOyt2BTfyjwkMdJzMpTSpWR0axBUm2OaU3+rxv/lj8K5D5zw2BfSUCBY6/244vCynHrzT+Syt+Fe12+GVWB36xk6LLJPSUlQ0GMArBlg9n4s96SQKqx6to6zl/Bl+VFib6rcfsScnPHuOkjMk+qXHygJmLpfmxcXkiscdbBiTDWuUWETacT7BbocON1iN76c50SxTn7fgeYNe7XrgKi0FRNGag9vyvtXyT18colckycDRfm7JYdmkD5GKmoVSrxb1Pu+fz/DLMkyumEL/N+K6AjgNFDFon33C3QrRIeJ1xgEzCYlRpKQ==","ARC-Authentication-Results":"i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=genexis.eu; dmarc=pass action=none header.from=iopsys.eu;\n dkim=pass header.d=iopsys.eu; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=iopsys.eu;\n s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=agd54caNBhEzMkHLlKcQasaa/ynLBZ08mPHCb0+u9v0=;\n b=JDF0cXX2rbAH9nPS9OK4m8bLB10I+qa1nCKZB+L40smJkLOAzqg0CChk4QwGKQFOcW+G6fOa+GqQwzWNtSB7Cg+Zh/MIQxc3UdMDfPEN3qccawiINrG3Q2KXQYbYpfYdJ7RFTgNMiHCQUYMzxPEkrtkX0mtwC8os3NanxvavX31GqCYu/PmdewS9sKgQw2U18v8gbMCcSmqzrg13rkmbScZf3HJAD9sC4aaCtDE6OtIiNyoGL/o983QRN+XZEMA4h89QpqlD4qNnQ6+7qfyuV87WqIaaIBRy4y/o5JkPK54ykIdblm+4qdXGi6gD91L5D6qRMA/CU+7s+g6wyJ9X5A==","From":"Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>","To":"Tom Rini <trini@konsulko.com>, Christian Marangi <ansuelsmth@gmail.com>,\n Simon Glass <sjg@chromium.org>,\n Marek Vasut <marek.vasut+renesas@mailbox.org>, Peng Fan <peng.fan@nxp.com>,\n Michael Trimarchi <michael@amarulasolutions.com>,\n Anis Chali <chalianis1@gmail.com>, Michal Simek <michal.simek@amd.com>,\n Dan Carpenter <dan.carpenter@linaro.org>,\n Sean Anderson <sean.anderson@linux.dev>, Yao Zi <me@ziyao.cc>,\n \"Yury Norov (NVIDIA)\" <yury.norov@gmail.com>,\n Geert Uytterhoeven <geert+renesas@glider.be>,\n Alexandre Belloni <alexandre.belloni@bootlin.com>,\n Crt Mori <cmo@melexis.com>, Richard Genoud <richard.genoud@bootlin.com>,\n u-boot@lists.denx.de, David Lechner <dlechner@baylibre.com>,\n Lorenzo Bianconi <lorenzo@kernel.org>,\n Markus Gothe <markus.gothe@genexis.eu>,\n Matheus Sampaio Queiroga <srherobrine20@gmail.com>,\n Benjamin Larsson <benjamin.larsson@genexis.eu>","Cc":"Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>,\n Jonathan Cameron <Jonathan.Cameron@huawei.com>,\n =?utf-8?q?Nuno_S=C3=A1?= <nuno.sa@analog.com>,\n Andy Shevchenko <andriy.shevchenko@intel.com>","Subject":"[PATCH v3 1/9] bitfield: Add non-constant field_{prep,get}() helpers","Date":"Mon,  4 May 2026 03:34:13 +0300","Message-ID":"<20260504003421.2545713-2-mikhail.kshevetskiy@iopsys.eu>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260504003421.2545713-1-mikhail.kshevetskiy@iopsys.eu>","References":"<20260504003421.2545713-1-mikhail.kshevetskiy@iopsys.eu>","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-ClientProxiedBy":"GV2PEPF00023A03.SWEP280.PROD.OUTLOOK.COM\n (2603:10a6:158:400::2aa) To VI1PR08MB10029.eurprd08.prod.outlook.com\n (2603:10a6:800:1c6::15)","MIME-Version":"1.0","X-MS-PublicTrafficType":"Email","X-MS-TrafficTypeDiagnostic":"VI1PR08MB10029:EE_|DU0PR08MB8662:EE_","X-MS-Office365-Filtering-Correlation-Id":"2dc2430b-fb50-4005-2c98-08dea974ed2b","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"BCL:0;\n ARA:13230040|1800799024|366016|52116014|7416014|376014|38350700014|921020|56012099003|22082099003|18002099003;","X-Microsoft-Antispam-Message-Info":"\n +lVOkWtY0uYWmeoVkimL0tvSW9gpRrYYmkS+X/C6LjhSOrGxFS+giI3wn+YELh7VE0HeVwSqLn2tdhqB+IGt1C9XQGguRpkyUH8pt02zpXWYi/rQvX0VlPyt+GuIKm4Dqj7UIDwQFJorRZdqC2+yHMykdj0gl7B7qo/WvMw8OEv6qDz6UlbCytNNRDpf40k04B/Wic5tBnLMlXjI8BqTVeLcZzqWd3Pnnb8+1W+2ZDhlhwi+C0U7srxe4QfWk+ZKWZnN7lFIh94t5ukporCrUSJAnvQBiMWcQZfkDAWiBVsVdH0v+GHqQZoVbtwnSd/sNhWLHeksAVJ+yg9yiuyvO0AM6zi1LiItRWDVtvOmMRIaXws9ff7ZirxM0H++TmVI9Ze2yM/DqgcDx1op++Wz8BqT8lNr904KicMR0WQHnHcnikuN9r4fGXg1GaBgSGvipiJzqNObQ24S73ccUNR2zBVAurBnt0/lgpLEQSnJV6OvPb9AoYOoou32Lvoz3SCbLwsTRO+xofkqsT/gyu/H4xX3u1MRCA/EbibGWa/Muhg8jNoWiH9FF3YOu6Be3jjni2i/qmFJDz1FJOJcggB+4tG2OkhgD3m6BVYv7CLO0ni1IXuNVZC+NEUO4Vp18ecjVi9jU9xyoqVI1RJfOVPfVGf8CoHE5u8nYwwuN8005Bfzfl25bL3AwWjPAyM8g6UMN41t2aCLazt2qdgkftfGzrs4Wjna4z2fo9AMylUI18ZYMtekGVRg01obF2EEVlxRQ6HBGVxRqOVznlRIc7VS5A==","X-Forefront-Antispam-Report":"CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:VI1PR08MB10029.eurprd08.prod.outlook.com; PTR:;\n CAT:NONE;\n SFS:(13230040)(1800799024)(366016)(52116014)(7416014)(376014)(38350700014)(921020)(56012099003)(22082099003)(18002099003);\n DIR:OUT; SFP:1102;","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"1","X-MS-Exchange-AntiSpam-MessageData-0":"=?utf-8?q?79YZEu6mzJd/zzfJ1fJsPkqhBAFG?=\n\t=?utf-8?q?y1M61AVrIUfR6Qe+e8Rl9ZpG3DpYeWZIVtg6nnEuxjbDwzUrEg5Zpyy5A5ebGZ3OE?=\n\t=?utf-8?q?tHUC4MgjIEv0xNQGD6PgUIM0I5RaL2WFevSvsLKEoKiNb6NJBDgwpEbvrlwoAOGkX?=\n\t=?utf-8?q?t0t9+wQjdx0mxIxEjMlovkqS6cGH5PVDAUWkq3/M6rWcaAa9PR5BcXktjoeiZl2D6?=\n\t=?utf-8?q?6WwYuL+rKJ0GFipR6+o7IWNSj+JpodvWpUjKHNI5sMz9zk7FA1Dg0XF2PXBbR+0KU?=\n\t=?utf-8?q?XJlu1UI6S0gC5JNhJC/CKJnXEiSSp74BcnDgwkSxMNq1NI1//LEUqFk8sB2lpO67I?=\n\t=?utf-8?q?xd3Wh+OxHYGO2HWU7G85HD3/SRnJi3TBP0/yYTI23ccBRh58fV62bQmqj/8SyNWcX?=\n\t=?utf-8?q?7kB1FuFyRerHJ09Rwi54asc1A3OVbVBgqaw65w+NIMBUC/Q4t+rbiX/z3x5e+HqYx?=\n\t=?utf-8?q?7DAiIeyAtb2y6sI4GVMQB3EN1p6fO1upWbdMHVZsGyffXOaJ3eCzP2g8wNXJlMx1B?=\n\t=?utf-8?q?9yoVfsHSsFMi/QmND47+D2ffOMfYBr1KpZT8KpRnK++IMs2RC603EoKyDj8fjDmlJ?=\n\t=?utf-8?q?BYA3zXG1pvNLAtZtpmyvNBchAb7VttP9pM55khBb63hp7VV6GWo5rtnCqoBya48vo?=\n\t=?utf-8?q?MiQ8Ntij5BrzeAlPQKOEI8jJZn2YQ1/pkcsBrt6gV/q07Vu68Us29vES1ILMZrJ1R?=\n\t=?utf-8?q?dT8jQp2t8cjdKOJILflMB1GtLVUR/YOkoxYG+8tSSwAB3AU5oEDaawfJ+w3cEvGAu?=\n\t=?utf-8?q?/W8NxwwqNxrQ0EjySSRyAkNyXy5aCjqCBbT8xbil0lSrXqS6nR15eX3S7o2PdpG3o?=\n\t=?utf-8?q?dGWGNSnNh7OkNoIrA3z1scMG74FHuZtDxeUv71lNx3xzKbxQEL/IxwaTRoJUFWhJ0?=\n\t=?utf-8?q?SDs/r+F8l3bHrZSLawK3vOPNl/ty4BYkpyQ0L7E5Gfw7l8CFFy5IfqrurjVlpeDE1?=\n\t=?utf-8?q?ZWLsyIL1gjGEeV2VLR4MANbTRGhuh+UzCa9so75eFMJKFWP6anhB1NU9SblF19tqf?=\n\t=?utf-8?q?r41HHeAI1d5Eyo/yCZG3X8c9mJp0svh73+sg0Jvk1Lzf/dGp+a8+OnwiD9IylzMWb?=\n\t=?utf-8?q?UjnFFp9fip5u3C4LQmYWniZRs+FZ+NdAg43rQrJQNMDEcBpbkG7pYJ7jXovjcitlT?=\n\t=?utf-8?q?TDekPdjIa+5/5K+ohViHuyCvjhVhlHch+dh0QIko3WCpr6YdJBVMWAupKLL3u2+T9?=\n\t=?utf-8?q?4kvKkhxKt2YA2LkoiXSbY8Vbe6TXTnwtKTPxY7gmf+9Lp9iql6YwuuXiRX6z+qS7n?=\n\t=?utf-8?q?DbCdLbcevPzqFHmsCr0K+Ov9FHQ3hWXEO84KLDFWPWWvu9J5Y41m0/34Cp7kjVob1?=\n\t=?utf-8?q?VIz3hAIfy7MzjjyF38MUh7wp7VxavXQImjPRh/q+zBDET+ZNto+zIIm4wjdDhYHf4?=\n\t=?utf-8?q?8qNR7k0lV8JXWxTPOtMJvg0dARFHsUljkawk3itzKo7D4q/+tMpLw2PZ3T5V186eU?=\n\t=?utf-8?q?bKdSE8DOGOCFO8/DvrmiZyTq7QgNzrN23hH++JE/BHb1GhuN1m0+gThnizzX/zHLm?=\n\t=?utf-8?q?flVmZyHUci4DrOnrZ2KBfevb6xHOOtqlRQ2SUIUB8l/oUKfbT6i4CmxxN/v8nhlZv?=\n\t=?utf-8?q?7wNImn6pcyYPJcj98ITTvWlmhzLruIE0qMwo3MVEaKCSpfWDSiJ6sSE1OBynaWOM5?=\n\t=?utf-8?q?vXE2rxfdgCmMUF6c/5TdQC168Z4ouTE3YN3er1ajNQPRSWXfp9iCY=3D?=","X-OriginatorOrg":"iopsys.eu","X-MS-Exchange-CrossTenant-Network-Message-Id":"\n 2dc2430b-fb50-4005-2c98-08dea974ed2b","X-MS-Exchange-CrossTenant-AuthSource":"VI1PR08MB10029.eurprd08.prod.outlook.com","X-MS-Exchange-CrossTenant-AuthAs":"Internal","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"04 May 2026 00:34:39.5455 (UTC)","X-MS-Exchange-CrossTenant-FromEntityHeader":"Hosted","X-MS-Exchange-CrossTenant-Id":"8d891be1-7bce-4216-9a99-bee9de02ba58","X-MS-Exchange-CrossTenant-MailboxType":"HOSTED","X-MS-Exchange-CrossTenant-UserPrincipalName":"\n axXuUCXgjrmg2bR5gXVVg4p7vy5rCbzuDxF/Szy+F3jjYiYc5pEggYggRjIIgqmpQYmLpblWsS3UFahpqfJvrM4gq410JQlgPQolfF0UGOM=","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"DU0PR08MB8662","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"From: Geert Uytterhoeven <geert+renesas@glider.be>\n\nThe existing FIELD_{GET,PREP}() macros are limited to compile-time\nconstants.  However, it is very common to prepare or extract bitfield\nelements where the bitfield mask is not a compile-time constant.\n\nTo avoid this limitation, the AT91 clock driver and several other\ndrivers already have their own non-const field_{prep,get}() macros.\nMake them available for general use by adding them to\n<linux/bitfield.h>, and improve them slightly:\n  1. Avoid evaluating macro parameters more than once,\n  2. Replace \"ffs() - 1\" by \"__ffs()\",\n  3. Support 64-bit use on 32-bit architectures,\n  4. Wire field_{get,prep}() to FIELD_{GET,PREP}() when mask is\n     actually constant.\n\nThis is deliberately not merged into the existing FIELD_{GET,PREP}()\nmacros, as people expressed the desire to keep stricter variants for\nincreased safety, or for performance critical paths.\n\nYury: use __mask within new macros.\n\nSigned-off-by: Geert Uytterhoeven <geert+renesas@glider.be>\nAcked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>\nAcked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>\nAcked-by: Crt Mori <cmo@melexis.com>\nAcked-by: Nuno Sá <nuno.sa@analog.com>\nAcked-by: Richard Genoud <richard.genoud@bootlin.com>\nReviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>\nReviewed-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>\nSigned-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>\n---\n include/linux/bitfield.h | 59 ++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 59 insertions(+)","diff":"diff --git a/include/linux/bitfield.h b/include/linux/bitfield.h\nindex 63928f17322..efad7227bdc 100644\n--- a/include/linux/bitfield.h\n+++ b/include/linux/bitfield.h\n@@ -16,6 +16,7 @@\n  * FIELD_{GET,PREP} macros take as first parameter shifted mask\n  * from which they extract the base mask and shift amount.\n  * Mask must be a compilation time constant.\n+ * field_{get,prep} are variants that take a non-const mask.\n  *\n  * Example:\n  *\n@@ -203,4 +204,62 @@ __MAKE_OP(64)\n #undef __MAKE_OP\n #undef ____MAKE_OP\n \n+#define __field_prep(mask, val)\t\t\t\t\t\t\\\n+\t({\t\t\t\t\t\t\t\t\\\n+\t\t__auto_type __mask = (mask);\t\t\t\t\\\n+\t\ttypeof(__mask) __val = (val);\t\t\t\t\\\n+\t\tunsigned int __shift = BITS_PER_TYPE(__mask) <= 32 ?\t\\\n+\t\t\t\t       __ffs(__mask) : __ffs64(__mask);\t\\\n+\t\t(__val << __shift) & __mask;\t\t\t\t\\\n+\t})\n+\n+#define __field_get(mask, reg)\t\t\t\t\t\t\\\n+\t({\t\t\t\t\t\t\t\t\\\n+\t\t__auto_type __mask = (mask);\t\t\t\t\\\n+\t\ttypeof(__mask) __reg =  (reg);\t\t\t\t\\\n+\t\tunsigned int __shift = BITS_PER_TYPE(__mask) <= 32 ?\t\\\n+\t\t\t\t       __ffs(__mask) : __ffs64(__mask);\t\\\n+\t\t(__reg & __mask) >> __shift;\t\t\t\t\\\n+\t})\n+\n+/**\n+ * field_prep() - prepare a bitfield element\n+ * @mask: shifted mask defining the field's length and position, must be\n+ *        non-zero\n+ * @val:  value to put in the field\n+ *\n+ * Return: field value masked and shifted to its final destination\n+ *\n+ * field_prep() masks and shifts up the value.  The result should be\n+ * combined with other fields of the bitfield using logical OR.\n+ * Unlike FIELD_PREP(), @mask is not limited to a compile-time constant.\n+ * Typical usage patterns are a value stored in a table, or calculated by\n+ * shifting a constant by a variable number of bits.\n+ * If you want to ensure that @mask is a compile-time constant, please use\n+ * FIELD_PREP() directly instead.\n+ */\n+#define field_prep(mask, val)\t\t\t\t\t\t\\\n+\t(__builtin_constant_p(mask) ? __FIELD_PREP(mask, val, \"field_prep: \") \\\n+\t\t\t\t    : __field_prep(mask, val))\n+\n+/**\n+ * field_get() - extract a bitfield element\n+ * @mask: shifted mask defining the field's length and position, must be\n+ *        non-zero\n+ * @reg:  value of entire bitfield\n+ *\n+ * Return: extracted field value\n+ *\n+ * field_get() extracts the field specified by @mask from the\n+ * bitfield passed in as @reg by masking and shifting it down.\n+ * Unlike FIELD_GET(), @mask is not limited to a compile-time constant.\n+ * Typical usage patterns are a value stored in a table, or calculated by\n+ * shifting a constant by a variable number of bits.\n+ * If you want to ensure that @mask is a compile-time constant, please use\n+ * FIELD_GET() directly instead.\n+ */\n+#define field_get(mask, reg)\t\t\t\t\t\t\\\n+\t(__builtin_constant_p(mask) ? __FIELD_GET(mask, reg, \"field_get: \") \\\n+\t\t\t\t    : __field_get(mask, reg))\n+\n #endif\n","prefixes":["v3","1/9"]}