From nobody Mon Feb 13 21:09:49 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFxms6S5hz3q5bW; Mon, 13 Feb 2023 21:09:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFxms42VWz4S7s; Mon, 13 Feb 2023 21:09:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322589; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pTDeemukeZNPP/9q7aqIgxy9xXrcD+jecxQSmEV3WZ8=; b=DJ79t8ZM3uof7uorIfyY18jFL3DESx0v+dIyxJkrj9+AKYxAH9hEx56i6Sb/TZIXrvsEjp pfch2fnRds+f++0PxEgOSee1vfVqBRBHxEcAkR/gZXor8pxz3+jy+lxJxt4apA7oYOCqo6 w/gu690v707natwzGSIK42Oc71Bb38J9AILftA3hb5uKYL+axYLuxu2Mvke5/g3Y2n4sPt wFrUD0UqWPpFlwxYPWLIiuV29rTLx0mx/sg29O79Spm+YLAyfX6UIwm+WWY7A6vQHdJ9np Jzx/FeIJKSqKz5ALAX1Rnb3D6pSIowOTRWeFmytOGyLOG+l7HXksv3yMyAiNlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322589; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pTDeemukeZNPP/9q7aqIgxy9xXrcD+jecxQSmEV3WZ8=; b=vbqwfq8gw9TLjxuEwCuQA4e9tSkVvsrSASJbwXNuitwjeJtkdCEU1r5Hfr4JnMZI5/ANRU jexrpwOfIEHYCMFCwiBg6TeIzTQymlZYeVc10beqyLSOh+TIkn/HKe/06FZaputS/v6vLi Ulyln1N87pawvMbV48s7PLaLb3BNOIClU61EoBDxoQJtyuDFO69XiwBVVTFpt+fmFf/iXt FKr4CI/mXH0KZ4jk9bvwkLOi7RJYGoW8znLyf1xdVv05K3oJA22nXUTbr2vG5yfbJ53pyl k6pjFfb4kMjowdSrK9p0qEVxqncRvIZrZujmrTcnnUGpsZdkficx5YK6EcW/bA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676322589; a=rsa-sha256; cv=none; b=Z4KmDC9Z16A616uvu30GKRwEWdEtvJ2FAMzxmdRlCk6bk4PJ20csLcLH7ErQQOkCZ0TmAX 1SewAiMYoHYKpzqC07MpLaqQhDC/wEm2Homo8CFedFX+KCg7rKMBswpUuy08RWn+RrOfCT okAaGiCPeUJNItv/Qgh9N/Ddricckw5VKKIQhbEzo0grgP7PlmBtV/JM7NBeYp7fwS85x5 ENXfn3QORjjY7tFtrsUwPG5R4ILtvmTNmUeizi71OuL7Yzjab4eYxB4q27BedQzaKOZWQu Y70HZiBpuAhZvrFGkiiYxSXOJwXwQwZ/XG+OwLgwRPVGbLFN8Y6y5Ql3AE99fw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFxms35GrzXbg; Mon, 13 Feb 2023 21:09:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31DL9n7a056417; Mon, 13 Feb 2023 21:09:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DL9nqG056416; Mon, 13 Feb 2023 21:09:49 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:09:49 GMT Message-Id: <202302132109.31DL9nqG056416@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: bf6f66508139 - main - linuxkpi: Define `FIELD_FIT()` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf6f6650813959ecf3469854ad266c5a5590c754 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=bf6f6650813959ecf3469854ad266c5a5590c754 commit bf6f6650813959ecf3469854ad266c5a5590c754 Author: Jean-Sébastien Pédron AuthorDate: 2023-02-08 23:38:22 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-02-13 21:09:31 +0000 linuxkpi: Define `FIELD_FIT()` Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38536 --- sys/compat/linuxkpi/common/include/linux/bitfield.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/bitfield.h b/sys/compat/linuxkpi/common/include/linux/bitfield.h index c22757d54290..d21c7f9868dd 100644 --- a/sys/compat/linuxkpi/common/include/linux/bitfield.h +++ b/sys/compat/linuxkpi/common/include/linux/bitfield.h @@ -127,6 +127,9 @@ _uX_replace_bits(8) #define __bf_shf(x) (__builtin_ffsll(x) - 1) +#define FIELD_FIT(_mask, _value) \ + (!(((typeof(_mask))(_value) << __bf_shf(_mask)) & ~(_mask))) + #define FIELD_PREP(_mask, _value) \ (((typeof(_mask))(_value) << __bf_shf(_mask)) & (_mask))