From nobody Fri Apr 12 23:12:29 2024 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 4VGXQj4yCcz5GL2T; Fri, 12 Apr 2024 23:12:29 +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 4VGXQj4W79z4y9w; Fri, 12 Apr 2024 23:12:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712963549; 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=6POEk55lPXSGakUBojb5NNn1MWpKzTOOJ4xxDmnEd5E=; b=P/GP29M21kuC/uHeWZOEnpsqhM2nGonuMDPSn2ZX1MZfqroXlTZD+zRGD6/74PG9fPFDD9 1T7Objtes6cTDwzJbkOZR2qUYI6hTg7uGw6OplNza0CVqjBDdE8RoBvf3T5jPZaOz7Jk8W g0edasYhnW/rWSPKjoks5U+D65A1mqPgXH9y6nyfIi64sxFSDoZXoqEWSFX8pFDY2bhffC bKXVIbSYibgZZ+lh57bnayIrS4SF3Jis3ZdonofJVjxQOVD1nRSUqzhow2h9Vjvx5KDzYd HbsPlu8PllvrdGZAVCefce0iE6D037bvBJBLkk5mehyYCletsdu1QlTSZSd6TA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712963549; a=rsa-sha256; cv=none; b=IJ8aBIFrUAAowb+2GlMmFnTSBnzymr0Qmd4iq1rp7MWfkQ4ls4h0w2iIU7H1IPDaTBYl0b q3bOaddDQW596/vwBGHSapeYx/C4PKlhI5RbmdxBop41WrYhk/zHC9puvJWI9YOkCuofFc HBfJv1JevNlZ9NkVwrZKvJ04XT1D81X7Pc+vEtZDfwxym0go6P96dhQl2FHuUOVGDLjJa7 76BTRd0FuCOPnN1ognLDXeiO3gcSoFhliuBUI3rmecdRFpMF6UW5buc2U2vnsd1aEe7HPB Y2Kz5xg+OWf2gQqz4lGsHFjXaWm4PEySPd6qHQdKq3xKuFzLZpQlyb1/3usEcA== 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=1712963549; 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=6POEk55lPXSGakUBojb5NNn1MWpKzTOOJ4xxDmnEd5E=; b=SMoCVDfq8wHvNnpRn4ZHGn6P5svbtGknNzizCuYdZyM2FhMb/t/OT9qCLTYb7uRRDWIayY vFRiwg8CDcrW2qjVHhKQ0BiAmVdFuDNbOa6RWWbuhuEho5HyzG7x//eSBYq269TB8ZwYD/ Cr1HFa7dPgiK5S3ufKo4OHBCzyPqN0chBBZ8RsPvHYq/mM7oT4i7bkDs32faR4JX1Jg50a 522mTxeveK8FKI6kLgtNQUrKHfkkouavoqWO8rh6bCxjy5gPatGYmNdB18IcWMxUKWNWfd BMRWAkT0KZCKnjAcCc2cbvoEn3P5nuJoRuAd3p32uvKJWZsrrdvvMj7u2+g8HA== 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 4VGXQj467Sz17qL; Fri, 12 Apr 2024 23:12:29 +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 43CNCT1F086266; Fri, 12 Apr 2024 23:12:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43CNCTrc086263; Fri, 12 Apr 2024 23:12:29 GMT (envelope-from git) Date: Fri, 12 Apr 2024 23:12:29 GMT Message-Id: <202404122312.43CNCTrc086263@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: f674f016c03d - main - LinuxKPI: add BITS_TO_BYTES() 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: 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f674f016c03d49e14f1c651ed088a6f2d01a62ee Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f674f016c03d49e14f1c651ed088a6f2d01a62ee commit f674f016c03d49e14f1c651ed088a6f2d01a62ee Author: Bjoern A. Zeeb AuthorDate: 2024-04-02 23:48:05 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-04-12 23:11:47 +0000 LinuxKPI: add BITS_TO_BYTES() Just like BITS_TO_LONG() ... used in rtw89. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D44603 --- sys/compat/linuxkpi/common/include/linux/bitops.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/compat/linuxkpi/common/include/linux/bitops.h b/sys/compat/linuxkpi/common/include/linux/bitops.h index 58677631b604..1415d5224084 100644 --- a/sys/compat/linuxkpi/common/include/linux/bitops.h +++ b/sys/compat/linuxkpi/common/include/linux/bitops.h @@ -54,6 +54,7 @@ #define GENMASK_ULL(h, l) (((~0ULL) >> (BITS_PER_LONG_LONG - (h) - 1)) & ((~0ULL) << (l))) #define BITS_PER_BYTE 8 #define BITS_PER_TYPE(t) (sizeof(t) * BITS_PER_BYTE) +#define BITS_TO_BYTES(n) howmany((n), BITS_PER_BYTE) #define hweight8(x) bitcount((uint8_t)(x)) #define hweight16(x) bitcount16(x)