net: sock.h: fix build error for RT kernel

error log:
  CC      fs/select.o
In file included from ./include/linux/timer.h:10:0,
                 from ./include/linux/workqueue.h:9,
                 from ./include/linux/rhashtable-types.h:15,
                 from ./include/linux/ipc.h:7,
                 from ./include/uapi/linux/sem.h:5,
                 from ./include/linux/sem.h:5,
                 from ./include/linux/sched.h:15,
                 from ./arch/arm64/include/asm/compat.h:25,
                 from ./arch/arm64/include/asm/stat.h:24,
                 from ./include/linux/stat.h:6,
                 from ./include/linux/module.h:10,
                 from init/do_mounts.c:1:
./include/linux/android_kabi.h:43:3: error: static assertion failed: "./include/net/sock.h:523: spinlock_t sk_peer_lock is larger than u64 android_kabi_reserved1"
   _Static_assert(sizeof(struct{_new;}) <= sizeof(struct{_orig;}), \
   ^
./include/linux/android_kabi.h:67:3: note: in expansion of macro '__ANDROID_KABI_CHECK_SIZE_ALIGN'
   __ANDROID_KABI_CHECK_SIZE_ALIGN(_orig, _new); \
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/android_kabi.h:100:2: note: in expansion of macro '_ANDROID_KABI_REPLACE'
  _ANDROID_KABI_REPLACE(_ANDROID_KABI_RESERVE(number), _new)
  ^~~~~~~~~~~~~~~~~~~~~
./include/net/sock.h:523:2: note: in expansion of macro 'ANDROID_KABI_USE'
  ANDROID_KABI_USE(1, spinlock_t sk_peer_lock);
  ^~~~~~~~~~~~~~~~
scripts/Makefile.build:333: recipe for target 'init/do_mounts.o' failed
make[1]: *** [init/do_mounts.o] Error 1
Makefile:1194: recipe for target 'init' failed
make: *** [init] Error 2

Signed-off-by: Liang Chen <cl@rock-chips.com>
Change-Id: I06555dbbd025100fc95bbb80a8fbde1a5b6058e5
This commit is contained in:
Liang Chen
2022-08-27 11:26:26 +08:00
parent 46d6c6285d
commit 131b6e4db5

View File

@@ -472,7 +472,7 @@ struct sock {
u32 sk_ack_backlog;
u32 sk_max_ack_backlog;
kuid_t sk_uid;
#if IS_ENABLED(CONFIG_DEBUG_SPINLOCK) || IS_ENABLED(CONFIG_DEBUG_LOCK_ALLOC)
#if IS_ENABLED(CONFIG_DEBUG_SPINLOCK) || IS_ENABLED(CONFIG_DEBUG_LOCK_ALLOC) || IS_ENABLED(CONFIG_PREEMPT_RT)
spinlock_t sk_peer_lock;
#else
/* sk_peer_lock is in the ANDROID_KABI_RESERVE(1) field below */
@@ -517,7 +517,7 @@ struct sock {
struct sock_reuseport __rcu *sk_reuseport_cb;
struct rcu_head sk_rcu;
#if IS_ENABLED(CONFIG_DEBUG_SPINLOCK) || IS_ENABLED(CONFIG_DEBUG_LOCK_ALLOC)
#if IS_ENABLED(CONFIG_DEBUG_SPINLOCK) || IS_ENABLED(CONFIG_DEBUG_LOCK_ALLOC) || IS_ENABLED(CONFIG_PREEMPT_RT)
ANDROID_KABI_RESERVE(1);
#else
ANDROID_KABI_USE(1, spinlock_t sk_peer_lock);