Re: [PATCH 6/6] thunderbolt: property: Make entry key modifications more visible
From: Andy Shevchenko
Date: Tue Jun 02 2026 - 20:27:48 EST
On Sun, May 24, 2026 at 03:06:48PM +0200, Thomas Weißschuh wrote:
> The modification of the key directly through the entry pointer is
> confusing. Explicitly use the key member.
...
> struct tb_property_entry {
> - __le32 key_hi;
> - __le32 key_lo;
> + u8 key[TB_PROPERTY_KEY_SIZE];
> __le16 length;
> u8 reserved;
> u8 type;
> 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);
> 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);
In such case this should use the get_unaligned_le64() or le64_to_cpu() rather
than this strange thing...
--
With Best Regards,
Andy Shevchenko