diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2025-06-10 11:29:21 +0200 |
|---|---|---|
| committer | Boqun Feng <boqun.feng@gmail.com> | 2025-07-14 21:57:20 -0700 |
| commit | d7c36d6350b5a4b27256eaeeea3b72621a819c9a (patch) | |
| tree | 7726a614b487b660ad908659df4f5598fbcd241f /include/linux | |
| parent | f84a15b90d96f3da99f67fea2e116850d99fb7c4 (diff) | |
locking/lockdep: Avoid struct return in lock_stats()
Returning a large structure from the lock_stats() function causes clang
to have multiple copies of it on the stack and copy between them, which
can end up exceeding the frame size warning limit:
kernel/locking/lockdep.c:300:25: error: stack frame size (1464) exceeds limit (1280) in 'lock_stats' [-Werror,-Wframe-larger-than]
300 | struct lock_class_stats lock_stats(struct lock_class *class)
Change the calling conventions to directly operate on the caller's copy,
which apparently is what gcc does already.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://lore.kernel.org/r/20250610092941.2642847-1-arnd@kernel.org
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/lockdep_types.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/lockdep_types.h b/include/linux/lockdep_types.h index 9f361d3ab9d9..eae115a26488 100644 --- a/include/linux/lockdep_types.h +++ b/include/linux/lockdep_types.h @@ -175,7 +175,7 @@ struct lock_class_stats { unsigned long bounces[nr_bounce_types]; }; -struct lock_class_stats lock_stats(struct lock_class *class); +void lock_stats(struct lock_class *class, struct lock_class_stats *stats); void clear_lock_stats(struct lock_class *class); #endif |
