diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h index b5ea64d15f43..8404847cf93e 100644 --- a/include/linux/sched/task.h +++ b/include/linux/sched/task.h @@ -56,7 +56,9 @@ extern spinlock_t mmlist_lock; extern union thread_union init_thread_union; extern struct task_struct init_task; +#ifdef CONFIG_GKI_DYNAMIC_TASK_STRUCT_SIZE extern u64 vendor_data_pad[CONFIG_GKI_TASK_STRUCT_VENDOR_SIZE_MAX / sizeof(u64)]; +#endif extern int lockdep_tasklist_lock_is_held(void); diff --git a/init/init_task.c b/init/init_task.c index 7fa55779b9cb..8827bd6f17b1 100644 --- a/init/init_task.c +++ b/init/init_task.c @@ -226,8 +226,10 @@ struct task_struct init_task __aligned(L1_CACHE_BYTES) = { }; EXPORT_SYMBOL(init_task); +#ifdef CONFIG_GKI_DYNAMIC_TASK_STRUCT_SIZE u64 vendor_data_pad[CONFIG_GKI_TASK_STRUCT_VENDOR_SIZE_MAX / sizeof(u64)]; EXPORT_SYMBOL_GPL(vendor_data_pad); +#endif /* * Initial thread structure. Alignment of this is handled by a special diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 32ece39e4d70..4f3420cd071a 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -3865,6 +3865,7 @@ void sched_enq_and_set_task(struct sched_enq_and_set_ctx *ctx); #include "ext.h" +#ifdef CONFIG_GKI_DYNAMIC_TASK_STRUCT_SIZE static inline void *android_task_vendor_data(struct task_struct *p) { if (p == &init_task) @@ -3872,5 +3873,6 @@ static inline void *android_task_vendor_data(struct task_struct *p) return p + 1; } +#endif #endif /* _KERNEL_SCHED_SCHED_H */