From nobody Wed Jun 12 19:16:49 2024 X-Original-To: dev-commits-src-all@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 4VzwJd6W8Cz5NHml; Wed, 12 Jun 2024 19:16: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 4VzwJd5VC1z56dS; Wed, 12 Jun 2024 19:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718219809; 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=l1DGpO7LZjZinw4EWv2q6PEryVzJVWKjk2OKXkqzkHs=; b=XDBHlwZARTByt1kRMGA8YXUA9X68/ezi9MSvchbCZPh9HKDsYR2q7kOuNEKEhQiB/HRFLJ L5zYj4nqTzJVsFB0oqh9HEmKWn1Ho1Hr/NDqftXoQjhCW+p6BDv1FXwd70arnAkgOKXuKK OJ9taxs4B+2J1ZblfoMjo0N8eXzAm8d6GbP2ElytYRbe3Gvgfc4Z8sourq1mtX5IUT/cnu RExY0DlEsLGtQ6S9omQNgNbDO0pP+1EzP4Y5BTQj8s9oFltel3rqJF77XweYSAgoILwzLX ZRK8QcvNBNQuelie+QB+alJ4UONV+dQ894gIjdIxxiXPvWbyjWVDTWJtVDlX1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718219809; a=rsa-sha256; cv=none; b=jepdgqHpTpkF5Shvusmb4iWFDOaa+JUBl6Ej8q5BPDGSUL7GvfdtkhDSN0dMXt/9vP2mOq yXD3iaArK20Es97GIFLVxfcf746T2nlrCTIPiLkc8PQqND3vBrK69oQhziqtc4x3iCnZaO GIO+W27wkBOmcme2V8RiFjFDf9ZUtoGptt+3fz1781cAYOZKg1LElbRkKG4hqhYEWnrp/7 uGSo2Me41kFsVAAIvG67H54/oPkBqQIBiEr91oawPtSa/KBxgveXJya3UvnNIsCxHfAXCr y8LnlfuZzb3GQWlNX5oFLT0R3d5BbcCqE6yk5YCiTgP34TKxFWTpJgLCbjDrEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718219809; 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=l1DGpO7LZjZinw4EWv2q6PEryVzJVWKjk2OKXkqzkHs=; b=vBSOmGBr+LMjrYdwWReN+1ydIq1DVmVRCQ66jZLdsek3y/Rk5qOAqQ/JSCuZd6UngckEAj rTjL6S4AQvsfdJin8YUkmWYWh4Cs0UTf5GsWwY3ME0JI7kRjLWvjtnYYN62ZTY0kHkRZrJ YbnM1Z+XhJ0Bv54ionmqRffA4Nd4U6ycCeZd7jZ3aE4bSUu7mTLZlOmMNsa6PsqLOzkOAQ Yoq8RLG/RHEbUnZr00v+5vLoo2IY6S35JylMp7UpN/c9IY08xzDAt9JANPwLfF9S+0Yfcv IaqnisFyXwQOXsq7CQsY15onZTSqNpXvBZ9YVLfSHImiBMe68Q3PKZ/R+OuEEQ== 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 4VzwJd56k2z1587; Wed, 12 Jun 2024 19:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45CJGnZD004067; Wed, 12 Jun 2024 19:16:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45CJGned004064; Wed, 12 Jun 2024 19:16:49 GMT (envelope-from git) Date: Wed, 12 Jun 2024 19:16:49 GMT Message-Id: <202406121916.45CJGned004064@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 33929383594a - stable/13 - LinuxKPI: add FIELD_PREP_CONST() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 33929383594abc079f8269e2837b49f265260909 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=33929383594abc079f8269e2837b49f265260909 commit 33929383594abc079f8269e2837b49f265260909 Author: Bjoern A. Zeeb AuthorDate: 2024-05-13 17:40:26 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-06-12 16:58:01 +0000 LinuxKPI: add FIELD_PREP_CONST() Add FIELD_PREP_CONST() like FIELD_PREP() without any extra checks likely expected on this version in Linux. This is called by an updated wireless driver. Sposnored by: The FreeBSD Foundation Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D45180 (cherry picked from commit bb025df257386c5d1087b652e8ed951bceb89862) --- sys/compat/linuxkpi/common/include/linux/bitfield.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/bitfield.h b/sys/compat/linuxkpi/common/include/linux/bitfield.h index a2020d247489..8a91b0663f37 100644 --- a/sys/compat/linuxkpi/common/include/linux/bitfield.h +++ b/sys/compat/linuxkpi/common/include/linux/bitfield.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2020 The FreeBSD Foundation + * Copyright (c) 2020-2024 The FreeBSD Foundation * * This software was developed by Björn Zeeb under sponsorship from * the FreeBSD Foundation. @@ -131,6 +131,10 @@ _uX_replace_bits(8) #define FIELD_PREP(_mask, _value) \ (((typeof(_mask))(_value) << __bf_shf(_mask)) & (_mask)) +/* Likely would need extra sanity checks compared to FIELD_PREP()? */ +#define FIELD_PREP_CONST(_mask, _value) \ + (((typeof(_mask))(_value) << __bf_shf(_mask)) & (_mask)) + #define FIELD_GET(_mask, _value) \ ((typeof(_mask))(((_value) & (_mask)) >> __bf_shf(_mask)))