From nobody Sun May 24 17:50:42 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F39F434DCE6; Sun, 24 May 2026 13:06:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779628014; cv=none; b=AQaV73CxRlULWsevYh2uX+ycgQrqN1ZhfO2bI1apBKwmqgC+HaEW+nAuvhdqV6EE/T5fjC1dxl7KSeQ6T9V/N373pJq/x5r30X0yrCVm23uQWTpXccyXN8TStK4YlMFpnkq+jMK8SLLt/L1WhZxS/8J2gQXISeRr4CkKlO/AwT0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779628014; c=relaxed/simple; bh=a3MKMiQ1YdYjeWFDK76VgkujpPaXG6iuY6V477D5jgQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XdSON+27l45bE2f/B4QupWvQvqKQBGSpryb2IbCcaXf9/GkkzP3ISb1V7dyGtaWqID+DfZ8BD6pq9TPQ8mVUVrC7trC41X3vXwmyqZPQHqZZQLnVZ1rOUWbZ6146Co0CDvzK16O0GjoqxWbFzOUxclCRpligiRJVyml2Pi6ZmL8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=DvnGRkfD; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="DvnGRkfD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1779628008; bh=a3MKMiQ1YdYjeWFDK76VgkujpPaXG6iuY6V477D5jgQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=DvnGRkfDVay7cHdtWnevsce5EHS8daQFGjNJIBLuIXsbEFPyqlVaNWq1h8xrDEs8E IgETUL4XAcLpUCLR0wfRLuDsT413NZSkHnceFgYOheLDA55bPZ7Zpz0o+iR+IVHx8R i9e7mga2S1pjy23Qu7jLaESslBlwh+pLolRgd3+M= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 24 May 2026 15:06:43 +0200 Subject: [PATCH 1/6] thunderbolt: test: Make root_directory independent of host byte order Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260524-thunderbolt-big-endian-v1-1-6044edca78e7@weissschuh.net> References: <20260524-thunderbolt-big-endian-v1-0-6044edca78e7@weissschuh.net> In-Reply-To: <20260524-thunderbolt-big-endian-v1-0-6044edca78e7@weissschuh.net> To: Andreas Noever , Mika Westerberg , Yehezkel Bernat , "David S. Miller" , Andy Shevchenko , Michael Jamet Cc: Mika Westerberg , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Yehezkel Bernat , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1779628007; l=5345; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=a3MKMiQ1YdYjeWFDK76VgkujpPaXG6iuY6V477D5jgQ=; b=I88w5D+iYw6GNdKzVRN7eIXPgXbBtdcXayQiFCVt4ftUZ+Pt+ko78bksws7NygKREjp6zC9x8 +ewztqiE0slClCI2LERz0aAROGjm8YnD3S5+x0VH6Q3TCIV6ic17LB3 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The wire-format is always the same. Make sure the test data doesn't suddenly change on big-endian systems. Fixes: 15a4c7e8f916 ("thunderbolt: Add KUnit tests for XDomain properties") Signed-off-by: Thomas Wei=C3=9Fschuh --- This is actual an assumption. I didn't find the specs. --- drivers/thunderbolt/test.c | 106 ++++++++++++++++++++++-------------------= ---- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/drivers/thunderbolt/test.c b/drivers/thunderbolt/test.c index 1f4318249c22..114ef11cd6f4 100644 --- a/drivers/thunderbolt/test.c +++ b/drivers/thunderbolt/test.c @@ -2604,59 +2604,59 @@ static void tb_test_credit_alloc_all(struct kunit *= test) } =20 static const u32 root_directory[] =3D { - 0x55584401, /* "UXD" v1 */ - 0x00000018, /* Root directory length */ - 0x76656e64, /* "vend" */ - 0x6f726964, /* "orid" */ - 0x76000001, /* "v" R 1 */ - 0x00000a27, /* Immediate value, ! Vendor ID */ - 0x76656e64, /* "vend" */ - 0x6f726964, /* "orid" */ - 0x74000003, /* "t" R 3 */ - 0x0000001a, /* Text leaf offset, (=E2=80=9CApple Inc.=E2=80=9D) */ - 0x64657669, /* "devi" */ - 0x63656964, /* "ceid" */ - 0x76000001, /* "v" R 1 */ - 0x0000000a, /* Immediate value, ! Device ID */ - 0x64657669, /* "devi" */ - 0x63656964, /* "ceid" */ - 0x74000003, /* "t" R 3 */ - 0x0000001d, /* Text leaf offset, (=E2=80=9CMacintosh=E2=80=9D) */ - 0x64657669, /* "devi" */ - 0x63657276, /* "cerv" */ - 0x76000001, /* "v" R 1 */ - 0x80000100, /* Immediate value, Device Revision */ - 0x6e657477, /* "netw" */ - 0x6f726b00, /* "ork" */ - 0x44000014, /* "D" R 20 */ - 0x00000021, /* Directory data offset, (Network Directory) */ - 0x4170706c, /* "Appl" */ - 0x6520496e, /* "e In" */ - 0x632e0000, /* "c." ! */ - 0x4d616369, /* "Maci" */ - 0x6e746f73, /* "ntos" */ - 0x68000000, /* "h" */ - 0x00000000, /* padding */ - 0xca8961c6, /* Directory UUID, Network Directory */ - 0x9541ce1c, /* Directory UUID, Network Directory */ - 0x5949b8bd, /* Directory UUID, Network Directory */ - 0x4f5a5f2e, /* Directory UUID, Network Directory */ - 0x70727463, /* "prtc" */ - 0x69640000, /* "id" */ - 0x76000001, /* "v" R 1 */ - 0x00000001, /* Immediate value, Network Protocol ID */ - 0x70727463, /* "prtc" */ - 0x76657273, /* "vers" */ - 0x76000001, /* "v" R 1 */ - 0x00000001, /* Immediate value, Network Protocol Version */ - 0x70727463, /* "prtc" */ - 0x72657673, /* "revs" */ - 0x76000001, /* "v" R 1 */ - 0x00000001, /* Immediate value, Network Protocol Revision */ - 0x70727463, /* "prtc" */ - 0x73746e73, /* "stns" */ - 0x76000001, /* "v" R 1 */ - 0x00000000, /* Immediate value, Network Protocol Settings */ + le32_to_cpu(0x55584401), /* "UXD" v1 */ + le32_to_cpu(0x00000018), /* Root directory length */ + le32_to_cpu(0x76656e64), /* "vend" */ + le32_to_cpu(0x6f726964), /* "orid" */ + le32_to_cpu(0x76000001), /* "v" R 1 */ + le32_to_cpu(0x00000a27), /* Immediate value, ! Vendor ID */ + le32_to_cpu(0x76656e64), /* "vend" */ + le32_to_cpu(0x6f726964), /* "orid" */ + le32_to_cpu(0x74000003), /* "t" R 3 */ + le32_to_cpu(0x0000001a), /* Text leaf offset, (=E2=80=9CApple Inc.=E2=80= =9D) */ + le32_to_cpu(0x64657669), /* "devi" */ + le32_to_cpu(0x63656964), /* "ceid" */ + le32_to_cpu(0x76000001), /* "v" R 1 */ + le32_to_cpu(0x0000000a), /* Immediate value, ! Device ID */ + le32_to_cpu(0x64657669), /* "devi" */ + le32_to_cpu(0x63656964), /* "ceid" */ + le32_to_cpu(0x74000003), /* "t" R 3 */ + le32_to_cpu(0x0000001d), /* Text leaf offset, (=E2=80=9CMacintosh=E2=80= =9D) */ + le32_to_cpu(0x64657669), /* "devi" */ + le32_to_cpu(0x63657276), /* "cerv" */ + le32_to_cpu(0x76000001), /* "v" R 1 */ + le32_to_cpu(0x80000100), /* Immediate value, Device Revision */ + le32_to_cpu(0x6e657477), /* "netw" */ + le32_to_cpu(0x6f726b00), /* "ork" */ + le32_to_cpu(0x44000014), /* "D" R 20 */ + le32_to_cpu(0x00000021), /* Directory data offset, (Network Directory) */ + le32_to_cpu(0x4170706c), /* "Appl" */ + le32_to_cpu(0x6520496e), /* "e In" */ + le32_to_cpu(0x632e0000), /* "c." ! */ + le32_to_cpu(0x4d616369), /* "Maci" */ + le32_to_cpu(0x6e746f73), /* "ntos" */ + le32_to_cpu(0x68000000), /* "h" */ + le32_to_cpu(0x00000000), /* padding */ + le32_to_cpu(0xca8961c6), /* Directory UUID, Network Directory */ + le32_to_cpu(0x9541ce1c), /* Directory UUID, Network Directory */ + le32_to_cpu(0x5949b8bd), /* Directory UUID, Network Directory */ + le32_to_cpu(0x4f5a5f2e), /* Directory UUID, Network Directory */ + le32_to_cpu(0x70727463), /* "prtc" */ + le32_to_cpu(0x69640000), /* "id" */ + le32_to_cpu(0x76000001), /* "v" R 1 */ + le32_to_cpu(0x00000001), /* Immediate value, Network Protocol ID */ + le32_to_cpu(0x70727463), /* "prtc" */ + le32_to_cpu(0x76657273), /* "vers" */ + le32_to_cpu(0x76000001), /* "v" R 1 */ + le32_to_cpu(0x00000001), /* Immediate value, Network Protocol Version */ + le32_to_cpu(0x70727463), /* "prtc" */ + le32_to_cpu(0x72657673), /* "revs" */ + le32_to_cpu(0x76000001), /* "v" R 1 */ + le32_to_cpu(0x00000001), /* Immediate value, Network Protocol Revision */ + le32_to_cpu(0x70727463), /* "prtc" */ + le32_to_cpu(0x73746e73), /* "stns" */ + le32_to_cpu(0x76000001), /* "v" R 1 */ + le32_to_cpu(0x00000000), /* Immediate value, Network Protocol Settings */ }; =20 static const uuid_t network_dir_uuid =3D --=20 2.54.0 From nobody Sun May 24 17:50:42 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 220D5312837; Sun, 24 May 2026 13:06:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779628014; cv=none; b=XuLNo+Zp443jcd4of2YnXKz1N5Ec8eQqwGgnZyrmy0sTLA6IkftmG9w9VVMZGxamV2qrD83QK+JXFbnxadH5psbyXYCeruvUBf4JdbcScdBsdP5WFUdYs3ZwYtlrWnTuwww5BU47H4W8jOYp5RpWWjVBvmQ4lB6pz0BBShmq6aQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779628014; c=relaxed/simple; bh=0aCQVAPiNGDDzV/DN+4BU73+Gn+hb5QfRdVndf5Z2e8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dHyZ7Vs80v20BUMW/T8XJ58OXBWBmMIOAFcHMnflfdRUUpmhmatFT3ikkLuWqdQ66umQZDEWfPw7EWaM3mNCsEoz5jDdyGuGT+n76w9upYViH5l1JlsrYTdau4nOisOjlHNI2gOiWdIPbDSlln4pwwTmVZ3pHCNffFqmceReli4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=K61kkJIx; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="K61kkJIx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1779628008; bh=0aCQVAPiNGDDzV/DN+4BU73+Gn+hb5QfRdVndf5Z2e8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=K61kkJIxdgWZ80xMMiXBOWCmqIH/UTooMGopfjKYn2bUmpsLyCiYRc0ZIxoEVaqfO Q1Fd4QRltkCCAdGveqdEaZIgSBbpR3tTiq/VZGKoiR4zbE5M8se3ZcqhZYkiB6VQnT xZcFcQnTRCd/sr+FQwmpq1irJNGnB1PWqcFlLEGI= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 24 May 2026 15:06:44 +0200 Subject: [PATCH 2/6] thunderbolt: property: Unify format_dwdata()/parse_dwdata() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260524-thunderbolt-big-endian-v1-2-6044edca78e7@weissschuh.net> References: <20260524-thunderbolt-big-endian-v1-0-6044edca78e7@weissschuh.net> In-Reply-To: <20260524-thunderbolt-big-endian-v1-0-6044edca78e7@weissschuh.net> To: Andreas Noever , Mika Westerberg , Yehezkel Bernat , "David S. Miller" , Andy Shevchenko , Michael Jamet Cc: Mika Westerberg , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Yehezkel Bernat , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1779628007; l=822; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=0aCQVAPiNGDDzV/DN+4BU73+Gn+hb5QfRdVndf5Z2e8=; b=IU5JD2KXOXWKIwBScW0S/lulmQKlOMjdm4QzwgmXAHeVXNv9GUEN8TJVD8IGGaC29p+TsHyd5 4ZvVPq6yHMgDFaXsYLFr144xdtbjHBLFm0zzc9qjtG9ZkCX9VbeC2KW X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Both function do the same. They are about to change. To make that easier, implement one in terms of the other. Signed-off-by: Thomas Wei=C3=9Fschuh --- drivers/thunderbolt/property.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thunderbolt/property.c b/drivers/thunderbolt/property.c index da2c59a17db5..fb96608ca471 100644 --- a/drivers/thunderbolt/property.c +++ b/drivers/thunderbolt/property.c @@ -48,7 +48,7 @@ static inline void parse_dwdata(void *dst, const void *sr= c, size_t dwords) =20 static inline void format_dwdata(void *dst, const void *src, size_t dwords) { - cpu_to_be32_array(dst, src, dwords); + return parse_dwdata(dst, src, dwords); } =20 static bool tb_property_entry_valid(const struct tb_property_entry *entry, --=20 2.54.0 From nobody Sun May 24 17:50:42 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33F0C395AEC; Sun, 24 May 2026 13:06:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779628014; cv=none; b=G9vvrWFPMMDSNDDqgdz5FIvYw4cA3XRvwfHn9wqUW2gld5NsQDKwwEP2dwsidYJhhRtl+Zgp1iWpRcoYzhgHE3wBMEK5i2IumMItevigr8gB/C5wjxKags+invtKwwuITNC8i/wYo0l882/Z7Q6SoJoyA8hrP3v/ot73ObSOgxU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779628014; c=relaxed/simple; bh=6X8NR0jeE8pCWr2zrAvPWg9ZdkccDuB8rGmEkJD1jnU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=I+pawkqVW9dv/+ys1FzklgigynMBMMB9U6unw2ChWwp8sheQHB0aKOZMH/MqaVVOR0bT3rC2cRl+KqcznGadrICgnHTwANFVxw7LTJkralqbfoRQfy9nXl+Adexg6x3JoFvlpR7gmkNBt8Fq/zfK8MsiMxQ0gvciSGkLJhsBmsU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=BbVWijOl; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="BbVWijOl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1779628008; bh=6X8NR0jeE8pCWr2zrAvPWg9ZdkccDuB8rGmEkJD1jnU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BbVWijOly2br8AG9ZIMUkXE6BYuJTsM16oYP7K3Ee1TloksD8FsOFYvRRPBKylj1x nP0sS+raBOC2X5ORVZAKmRKj8Of1GxLS71ELvDVjI2OR8Q4Zj8j7PfiQIiK+riQVjV Slj4vG0FAlrcMQl94YisFy+ITbHMB09rd1K2XtdQ= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 24 May 2026 15:06:45 +0200 Subject: [PATCH 3/6] thunderbolt: property: Make format_dwdata() work on big-endian systems Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260524-thunderbolt-big-endian-v1-3-6044edca78e7@weissschuh.net> References: <20260524-thunderbolt-big-endian-v1-0-6044edca78e7@weissschuh.net> In-Reply-To: <20260524-thunderbolt-big-endian-v1-0-6044edca78e7@weissschuh.net> To: Andreas Noever , Mika Westerberg , Yehezkel Bernat , "David S. Miller" , Andy Shevchenko , Michael Jamet Cc: Mika Westerberg , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Yehezkel Bernat , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1779628007; l=952; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=6X8NR0jeE8pCWr2zrAvPWg9ZdkccDuB8rGmEkJD1jnU=; b=y05lb92ef4IGCyHxE2upeNuGhoycJdkqU20QO4PSaPAByfVmx7X8bjmMjEEJcNyJKQeNuHzWB +kSimBUOdfaA8nsoT3KZR5FYUEccBTJSHyP9BcpbBc/SZr5v7gR5cAE X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The data also needs to be swapped on big-endian systems. Use swab32() which works independently from the host byte order. Fixes: cdae7c07e3e3 ("thunderbolt: Add support for XDomain properties") Signed-off-by: Thomas Wei=C3=9Fschuh --- drivers/thunderbolt/property.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/thunderbolt/property.c b/drivers/thunderbolt/property.c index fb96608ca471..94314fa07d23 100644 --- a/drivers/thunderbolt/property.c +++ b/drivers/thunderbolt/property.c @@ -43,7 +43,8 @@ static struct tb_property_dir *__tb_property_parse_dir(co= nst u32 *block, =20 static inline void parse_dwdata(void *dst, const void *src, size_t dwords) { - be32_to_cpu_array(dst, src, dwords); + for (size_t i =3D 0; i < dwords; i++) + ((u32 *)dst)[i] =3D swab32(((u32 *)src)[i]); } =20 static inline void format_dwdata(void *dst, const void *src, size_t dwords) --=20 2.54.0 From nobody Sun May 24 17:50:42 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E4E03955FF; Sun, 24 May 2026 13:06:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779628014; cv=none; b=FEtuEF/DD2bBCOz2L9HswNYQCcD9h7weGxx/e0dW52lRmZAzBsl2PnvCxVTOpIcPKxvuQSKxO1tq6AsXNpJvQOEzNSNX/m7XevvQ6ofOmXTqQ90Dtgl6K6TKLQdLpS/GxnVlTokmD1ZFJTwSEUAsVfdbO8UJmxN/AvCFtOiooHI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779628014; c=relaxed/simple; bh=wuEPiBeRZL1CQrVYEoBhtUX5fd2eCjhw/OhLyxncI8E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=t3Sb5s9kuYthokIc0mg4LPRF7Paqq/v39OobyvNJrJd0CGY2YAttnGKEQALyHhNoUMgKeQYXEKGdFNTwD96v/YP6YiIojplPRn28MZR2sOMvx8EhCrUwOyG1pgEe+amhfcnxu0OE7OdX/+KYKtMoW3IgG10xU8mD8GHYIVAegGA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=DBW9ec3P; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="DBW9ec3P" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1779628008; bh=wuEPiBeRZL1CQrVYEoBhtUX5fd2eCjhw/OhLyxncI8E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=DBW9ec3PNbkt9GB1tYVbZ0yp2SOlh4Qa+jVrFta0OTu11frSIQex6JkM7cS7t77LK WZm4CD5Z9yVuwN+8e0Wde+TYy9hmSZFl1e45JXXk0q1bfRJvNpoAZOYQOGbqtPzWhX 31LTgjlBSHJwOkByDyYHKM0G5EqBT2+kJS83dsNI= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 24 May 2026 15:06:46 +0200 Subject: [PATCH 4/6] thunderbolt: property: Convert byte order of numeric fields Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260524-thunderbolt-big-endian-v1-4-6044edca78e7@weissschuh.net> References: <20260524-thunderbolt-big-endian-v1-0-6044edca78e7@weissschuh.net> In-Reply-To: <20260524-thunderbolt-big-endian-v1-0-6044edca78e7@weissschuh.net> To: Andreas Noever , Mika Westerberg , Yehezkel Bernat , "David S. Miller" , Andy Shevchenko , Michael Jamet Cc: Mika Westerberg , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Yehezkel Bernat , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1779628007; l=5898; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=wuEPiBeRZL1CQrVYEoBhtUX5fd2eCjhw/OhLyxncI8E=; b=xU1xnLp2GCRm0/BDLr3w1EdP3belohnpEnPR0nJWRx9LWd+HrZt/UXJDgRmRdVAc4ufDc+qqb j4A0bcAI4h5DempukSxDBYYPt3qYQ1GOqP6LftNBho9vdn0TNeX5ZcN X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= On big-endian system the numeric fields need to be converted after reading them from the wireformat before they can be used. Add the necessary conversion. Fixes: cdae7c07e3e3 ("thunderbolt: Add support for XDomain properties") Signed-off-by: Thomas Wei=C3=9Fschuh --- drivers/thunderbolt/property.c | 72 +++++++++++++++++++++++---------------= ---- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/drivers/thunderbolt/property.c b/drivers/thunderbolt/property.c index 94314fa07d23..0cdf1c03efc6 100644 --- a/drivers/thunderbolt/property.c +++ b/drivers/thunderbolt/property.c @@ -15,17 +15,17 @@ #include =20 struct tb_property_entry { - u32 key_hi; - u32 key_lo; - u16 length; + __le32 key_hi; + __le32 key_lo; + __le16 length; u8 reserved; u8 type; - u32 value; + __le32 value; }; =20 struct tb_property_rootdir_entry { - u32 magic; - u32 length; + __le32 magic; + __le32 length; struct tb_property_entry entries[]; }; =20 @@ -61,15 +61,16 @@ static bool tb_property_entry_valid(const struct tb_pro= perty_entry *entry, case TB_PROPERTY_TYPE_DIRECTORY: case TB_PROPERTY_TYPE_DATA: case TB_PROPERTY_TYPE_TEXT: - if (entry->length > block_len) + if (le16_to_cpu(entry->length) > block_len) return false; - if (check_add_overflow(entry->value, entry->length, &end) || + if (check_add_overflow(le32_to_cpu(entry->value), + le16_to_cpu(entry->length), &end) || end > block_len) return false; break; =20 case TB_PROPERTY_TYPE_VALUE: - if (entry->length !=3D 1) + if (le16_to_cpu(entry->length) !=3D 1) return false; break; } @@ -116,12 +117,14 @@ static struct tb_property *tb_property_parse(const u3= 2 *block, size_t block_len, if (!property) return NULL; =20 - property->length =3D entry->length; + property->length =3D le16_to_cpu(entry->length); =20 switch (property->type) { case TB_PROPERTY_TYPE_DIRECTORY: - dir =3D __tb_property_parse_dir(block, block_len, entry->value, - entry->length, false, depth + 1); + dir =3D __tb_property_parse_dir(block, block_len, + le32_to_cpu(entry->value), + le16_to_cpu(entry->length), + false, depth + 1); if (!dir) { kfree(property); return NULL; @@ -136,8 +139,9 @@ static struct tb_property *tb_property_parse(const u32 = *block, size_t block_len, kfree(property); return NULL; } - parse_dwdata(property->value.data, block + entry->value, - entry->length); + parse_dwdata(property->value.data, + block + le32_to_cpu(entry->value), + le16_to_cpu(entry->length)); break; =20 case TB_PROPERTY_TYPE_TEXT: @@ -147,14 +151,15 @@ static struct tb_property *tb_property_parse(const u3= 2 *block, size_t block_len, kfree(property); return NULL; } - parse_dwdata(property->value.text, block + entry->value, - entry->length); + parse_dwdata(property->value.text, + block + le32_to_cpu(entry->value), + le16_to_cpu(entry->length)); /* Force null termination */ property->value.text[property->length * 4 - 1] =3D '\0'; break; =20 case TB_PROPERTY_TYPE_VALUE: - property->value.immediate =3D entry->value; + property->value.immediate =3D le32_to_cpu(entry->value); break; =20 default: @@ -240,12 +245,13 @@ struct tb_property_dir *tb_property_parse_dir(const u= 32 *block, const struct tb_property_rootdir_entry *rootdir =3D (const struct tb_property_rootdir_entry *)block; =20 - if (rootdir->magic !=3D TB_PROPERTY_ROOTDIR_MAGIC) + if (le32_to_cpu(rootdir->magic) !=3D TB_PROPERTY_ROOTDIR_MAGIC) return NULL; - if (rootdir->length > block_len) + if (le32_to_cpu(rootdir->length) > block_len) return NULL; =20 - return __tb_property_parse_dir(block, block_len, 0, rootdir->length, + return __tb_property_parse_dir(block, block_len, 0, + le32_to_cpu(rootdir->length), true, 0); } =20 @@ -438,8 +444,8 @@ static ssize_t __tb_property_format_dir(const struct tb= _property_dir *dir, struct tb_property_rootdir_entry *re; =20 re =3D (struct tb_property_rootdir_entry *)&block[start_offset]; - re->magic =3D TB_PROPERTY_ROOTDIR_MAGIC; - re->length =3D dir_len - sizeof(*re) / 4; + re->magic =3D cpu_to_le32(TB_PROPERTY_ROOTDIR_MAGIC); + re->length =3D cpu_to_le32(dir_len - sizeof(*re) / 4); entry =3D re->entries; } =20 @@ -456,31 +462,31 @@ static ssize_t __tb_property_format_dir(const struct = tb_property_dir *dir, block_len); if (ret < 0) return ret; - entry->length =3D tb_property_dir_length(child, false, - NULL); - entry->value =3D dir_end; + entry->length =3D cpu_to_le16( + tb_property_dir_length(child, false, NULL)); + entry->value =3D cpu_to_le32(dir_end); dir_end =3D ret; break; =20 case TB_PROPERTY_TYPE_DATA: format_dwdata(&block[data_offset], property->value.data, property->length); - entry->length =3D property->length; - entry->value =3D data_offset; - data_offset +=3D entry->length; + entry->length =3D cpu_to_le16(property->length); + entry->value =3D cpu_to_le32(data_offset); + data_offset +=3D property->length; break; =20 case TB_PROPERTY_TYPE_TEXT: format_dwdata(&block[data_offset], property->value.text, property->length); - entry->length =3D property->length; - entry->value =3D data_offset; - data_offset +=3D entry->length; + entry->length =3D cpu_to_le16(property->length); + entry->value =3D cpu_to_le32(data_offset); + data_offset +=3D property->length; break; =20 case TB_PROPERTY_TYPE_VALUE: - entry->length =3D property->length; - entry->value =3D property->value.immediate; + entry->length =3D cpu_to_le16(property->length); + entry->value =3D cpu_to_le32(property->value.immediate); break; =20 default: --=20 2.54.0 From nobody Sun May 24 17:50:42 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1ACDC397E89; Sun, 24 May 2026 13:06:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779628018; cv=none; b=VPjFAD1emV4cMT21f8+JEN6Ii0BX30pPBgBWerFws3nA8ZVFKtSEdeT6+eYvsHKCuM6XvN0WGrMgjUYaFf7s0FoQ1MzC5zIDqCYs/xqKmP8VrEW8HiujHhYqlGZvB4s+LNFKACUGoPuaPsiKgaIUD99yXMAQ+z2G5jInBOVDb6E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779628018; c=relaxed/simple; bh=/Vtaxk+1WG7zj3pzj6DjjKr4B5prkrZSAYDSjnycjHw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UpQ+fscGReovu9tjmWhmPNI5MKKy/aqZd8+/R4kZpy5nQ+oIwD6ysyGOqA7j+V91C5v2LxM18Dw0mWnJQl2QGntJ6aZ4hga+fdQw7zHD+PfPdqexK1cEIbnyapaFrA3GBpgDLXwvGLjTuxqQaqc0/XB0puHev8Ff1OkWRgFGwYE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=ggUr4SOb; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="ggUr4SOb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1779628008; bh=/Vtaxk+1WG7zj3pzj6DjjKr4B5prkrZSAYDSjnycjHw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ggUr4SObUHGmm2ODMrfdo/wK2QXiyrqNqFI4e4VQa948nhn4dAwchaPClwPX+oppT IOd0S59vwd1Rm+xfjHCq93L8+QH1Jz8fY9qjGcAG6hl4CbsevmeLPsSYb9BxwP/5d1 FokL7zrbz24OlFexJXQhkoeRjrt6TChBzWJC8ez8= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 24 May 2026 15:06:47 +0200 Subject: [PATCH 5/6] thunderbolt: property: Unify parse_dwdata()/format_dwdata() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260524-thunderbolt-big-endian-v1-5-6044edca78e7@weissschuh.net> References: <20260524-thunderbolt-big-endian-v1-0-6044edca78e7@weissschuh.net> In-Reply-To: <20260524-thunderbolt-big-endian-v1-0-6044edca78e7@weissschuh.net> To: Andreas Noever , Mika Westerberg , Yehezkel Bernat , "David S. Miller" , Andy Shevchenko , Michael Jamet Cc: Mika Westerberg , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Yehezkel Bernat , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1779628007; l=3600; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=/Vtaxk+1WG7zj3pzj6DjjKr4B5prkrZSAYDSjnycjHw=; b=c1RRqN5R/S1GU1mvZPL7AdVBbG4s41iUitpT5fWHqru8GylPdKAresbBONxYwA+SHWiqHHno6 FW2PHoLu0eoBc4f8m6+/TQIigQaSaN/9hljdqqR2KgFlCmFrXNRtmc2 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Both functions do the same. Unify them. Signed-off-by: Thomas Wei=C3=9Fschuh --- drivers/thunderbolt/property.c | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/drivers/thunderbolt/property.c b/drivers/thunderbolt/property.c index 0cdf1c03efc6..961efcec1795 100644 --- a/drivers/thunderbolt/property.c +++ b/drivers/thunderbolt/property.c @@ -41,17 +41,12 @@ static struct tb_property_dir *__tb_property_parse_dir(= const u32 *block, size_t block_len, unsigned int dir_offset, size_t dir_len, bool is_root, unsigned int depth); =20 -static inline void parse_dwdata(void *dst, const void *src, size_t dwords) +static inline void convert_dwdata(void *dst, const void *src, size_t dword= s) { for (size_t i =3D 0; i < dwords; i++) ((u32 *)dst)[i] =3D swab32(((u32 *)src)[i]); } =20 -static inline void format_dwdata(void *dst, const void *src, size_t dwords) -{ - return parse_dwdata(dst, src, dwords); -} - static bool tb_property_entry_valid(const struct tb_property_entry *entry, size_t block_len) { @@ -110,7 +105,7 @@ static struct tb_property *tb_property_parse(const u32 = *block, size_t block_len, if (!tb_property_entry_valid(entry, block_len)) return NULL; =20 - parse_dwdata(key, entry, 2); + convert_dwdata(key, entry, 2); key[TB_PROPERTY_KEY_SIZE] =3D '\0'; =20 property =3D tb_property_alloc(key, entry->type); @@ -139,9 +134,9 @@ static struct tb_property *tb_property_parse(const u32 = *block, size_t block_len, kfree(property); return NULL; } - parse_dwdata(property->value.data, - block + le32_to_cpu(entry->value), - le16_to_cpu(entry->length)); + convert_dwdata(property->value.data, + block + le32_to_cpu(entry->value), + le16_to_cpu(entry->length)); break; =20 case TB_PROPERTY_TYPE_TEXT: @@ -151,9 +146,9 @@ static struct tb_property *tb_property_parse(const u32 = *block, size_t block_len, kfree(property); return NULL; } - parse_dwdata(property->value.text, - block + le32_to_cpu(entry->value), - le16_to_cpu(entry->length)); + convert_dwdata(property->value.text, + block + le32_to_cpu(entry->value), + le16_to_cpu(entry->length)); /* Force null termination */ property->value.text[property->length * 4 - 1] =3D '\0'; break; @@ -452,7 +447,7 @@ static ssize_t __tb_property_format_dir(const struct tb= _property_dir *dir, list_for_each_entry(property, &dir->properties, list) { const struct tb_property_dir *child; =20 - format_dwdata(entry, property->key, 2); + convert_dwdata(entry, property->key, 2); entry->type =3D property->type; =20 switch (property->type) { @@ -469,16 +464,16 @@ static ssize_t __tb_property_format_dir(const struct = tb_property_dir *dir, break; =20 case TB_PROPERTY_TYPE_DATA: - format_dwdata(&block[data_offset], property->value.data, - property->length); + convert_dwdata(&block[data_offset], property->value.data, + property->length); entry->length =3D cpu_to_le16(property->length); entry->value =3D cpu_to_le32(data_offset); data_offset +=3D property->length; break; =20 case TB_PROPERTY_TYPE_TEXT: - format_dwdata(&block[data_offset], property->value.text, - property->length); + convert_dwdata(&block[data_offset], property->value.text, + property->length); entry->length =3D cpu_to_le16(property->length); entry->value =3D cpu_to_le32(data_offset); data_offset +=3D property->length; --=20 2.54.0 From nobody Sun May 24 17:50:42 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE83A397AFF; Sun, 24 May 2026 13:06:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779628017; cv=none; b=KFuK7WygXwzL5tpxcModWp4H9p0VEsZqSM704F2qqIGDthWkjkHEoQgsX7VcxVIh/vI8P6QhdJpY9t/nD6tox+ZnEGJystxJWGi12FnUI3mPgRgJ98a/Qnb/vwUgVLkbLZn5yd8Cx8NhieNuE67FRf9vLJX1D0CBdgyIMOBHI9U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779628017; c=relaxed/simple; bh=MhWwgbCd/dj7nPgAVmyCoPCA1SbmNeM1KIHvSVdPcMs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MAX/ZicY8ajkItr7NkPlTtq3hdEUUjAIVUqwOn+Cc43HLD4r7Won0YRKj6s0klR1/tahmxIHyxrANdzQzkyBygYzFmgKBLRiOAnMT4E9UFt577tU48ZYHvk/F7A+xy2OL1/gXSdHzwqb09Rc2kNIFvMIc2dcJowg5cpJ4N++Xc4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=aUp9cGzn; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="aUp9cGzn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1779628008; bh=MhWwgbCd/dj7nPgAVmyCoPCA1SbmNeM1KIHvSVdPcMs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=aUp9cGzn6tuYg9/a7jR4pTAXFGO01PxDevNNlcwxgXcTAHiMLlg3ApXq0XZ519sPd FwwADB/Z/nAG7ev4QGjy5mB6V17vbrvF9FsbuQQNlKVSU6pWduuJwA2cbu58I8EGtm ymWDxoSZKyUv10PPRX2mI6izSdkRhHGQJLrGUuVY= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 24 May 2026 15:06:48 +0200 Subject: [PATCH 6/6] thunderbolt: property: Make entry key modifications more visible Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260524-thunderbolt-big-endian-v1-6-6044edca78e7@weissschuh.net> References: <20260524-thunderbolt-big-endian-v1-0-6044edca78e7@weissschuh.net> In-Reply-To: <20260524-thunderbolt-big-endian-v1-0-6044edca78e7@weissschuh.net> To: Andreas Noever , Mika Westerberg , Yehezkel Bernat , "David S. Miller" , Andy Shevchenko , Michael Jamet Cc: Mika Westerberg , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Yehezkel Bernat , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1779628007; l=1380; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=MhWwgbCd/dj7nPgAVmyCoPCA1SbmNeM1KIHvSVdPcMs=; b=Bcmo0SrjhNjoQek8kEnjHNEeWYSt+3jkrR0X1uXROsQhRw/MU91kz2UfBkFekXmqhiZCpiBcn 7vme2RTtFGCB8Lt0o8lgyj1igXoIqelFe8gwTpffM1HyVYaQXf9xpWy X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The modification of the key directly through the entry pointer is confusing. Explicitly use the key member. Signed-off-by: Thomas Wei=C3=9Fschuh --- drivers/thunderbolt/property.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/thunderbolt/property.c b/drivers/thunderbolt/property.c index 961efcec1795..885a8da7e72f 100644 --- a/drivers/thunderbolt/property.c +++ b/drivers/thunderbolt/property.c @@ -15,8 +15,7 @@ #include =20 struct tb_property_entry { - __le32 key_hi; - __le32 key_lo; + u8 key[TB_PROPERTY_KEY_SIZE]; __le16 length; u8 reserved; u8 type; @@ -105,7 +104,7 @@ static struct tb_property *tb_property_parse(const u32 = *block, size_t block_len, if (!tb_property_entry_valid(entry, block_len)) return NULL; =20 - convert_dwdata(key, entry, 2); + convert_dwdata(key, &entry->key, 2); key[TB_PROPERTY_KEY_SIZE] =3D '\0'; =20 property =3D tb_property_alloc(key, entry->type); @@ -447,7 +446,7 @@ static ssize_t __tb_property_format_dir(const struct tb= _property_dir *dir, list_for_each_entry(property, &dir->properties, list) { const struct tb_property_dir *child; =20 - convert_dwdata(entry, property->key, 2); + convert_dwdata(&entry->key, property->key, 2); entry->type =3D property->type; =20 switch (property->type) { --=20 2.54.0