Re: [PATCH 1/1] hung_task: fix warnings by enforcing alignment on lock structures

From: Finn Thain
Date: Sat Aug 23 2025 - 20:48:06 EST



On Sun, 24 Aug 2025, kernel test robot wrote:

>
> All warnings (new ones prefixed by >>):
>
> In file included from sound/soc/codecs/mt6660.c:15:
> >> sound/soc/codecs/mt6660.h:28:1: warning: alignment 1 of 'struct mt6660_chip' is less than 8 [-Wpacked-not-aligned]
> 28 | };
> | ^
> >> sound/soc/codecs/mt6660.h:25:22: warning: 'io_lock' offset 49 in 'struct mt6660_chip' isn't aligned to 8 [-Wpacked-not-aligned]
> 25 | struct mutex io_lock;
> | ^~~~~~~
>

Misalignment warnings like this one won't work if you just pick an
alignment arbitrarily i.e. to suit whatever bitfield you happen to need.

Instead, I think I would naturally align the actual locks, that is,
arch_spinlock_t and arch_rwlock_t in include/linux/spinlock_types*.h.