[PATCH 6/6] thunderbolt: property: Make entry key modifications more visible

From: Thomas Weißschuh

Date: Sun May 24 2026 - 09:08:44 EST


The modification of the key directly through the entry pointer is
confusing. Explicitly use the key member.

Signed-off-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
---
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 <linux/thunderbolt.h>

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;

- convert_dwdata(key, entry, 2);
+ convert_dwdata(key, &entry->key, 2);
key[TB_PROPERTY_KEY_SIZE] = '\0';

property = 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;

- convert_dwdata(entry, property->key, 2);
+ convert_dwdata(&entry->key, property->key, 2);
entry->type = property->type;

switch (property->type) {

--
2.54.0