Thread (9 messages) 9 messages, 2 authors, 2025-10-18

Re: [PATCH net-next v14 4/5] net: rnpgbe: Add basic mbx_fw support

flat view

From: Jakub Kicinski <kuba@kernel.org>
Date: 2025-10-18 00:06:11
Also in: linux-doc, lkml

On Tue, 14 Oct 2025 15:27:10 +0800 Dong Yibo wrote:
quoted hunk ↗ jump to hunk
+/* FW stores extended information in 'ext_info' as a 32-bit
+ * little-endian value. To make these flags easily accessible in the
+ * kernel (via named 'bitfields' instead of raw bitmask operations),
+ * we use the union's 'e_host' struct, which provides named bits
+ * (e.g., 'wol_en', 'smbus_en')
+ */
+static inline void mucse_hw_info_update_host_endian(struct mucse_hw_info *info)
+{
+	u32 host_val = le32_to_cpu(info->ext_info);
+
+	memcpy(&info->e_host, &host_val, sizeof(info->e_host));
This is not going to be enough. C bitfields are also affected by endian.
The best practice in the kernel is to define the fields as #defines
and user FIELD_GET() or direct & / | operations with the constants.
-- 
pw-bot: cr
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help