ANDROID: fix incorrect #ifdef for CONFIG_ANDROID_VENDOR_OEM_DATA
If a kernel is built with CONFIG_ANDROID_VENDOR_HOOK
but not CONFIG_ANDROID_VENDOR_OEM_DATA, we get a build error
in uid_sys_stat.c because &OEM_DATA(x) resolves to &0. Remove
all cases of &OEM_DATA().
Fixes: 5f450572c8 ("ANDROID: uid_sys_stats: add ANDROID_OEM_DATA in struct uid_entry and update_stats_work")
Change-Id: Ib9333541a8bff4b279c4cdeb804e05500b7ab7ae
Signed-off-by: Todd Kjos <tkjos@google.com>
This commit is contained in:
committed by
Treehugger Robot
parent
d52356998b
commit
06a574beb9
@@ -52,9 +52,12 @@ spinlock_t uid_lock[UID_HASH_NUMS];
|
||||
trace_android_vh_update_uid_stats(target, source, task, type)
|
||||
|
||||
#ifdef CONFIG_ANDROID_VENDOR_OEM_DATA
|
||||
#define OEM_DATA(x) x->android_oem_data1
|
||||
#define OEM_DATA(x) ((x)->android_oem_data1)
|
||||
#define OEM_DATA_PTR(x) (&(x)->android_oem_data1)
|
||||
#else
|
||||
static inline u64 *oem_data_ptr(void *x) { return NULL; }
|
||||
#define OEM_DATA(x) 0
|
||||
#define OEM_DATA_PTR(x) oem_data_ptr(x)
|
||||
#endif
|
||||
|
||||
static struct proc_dir_entry *cpu_parent;
|
||||
@@ -505,8 +508,8 @@ static void update_stats_workfn(struct work_struct *work)
|
||||
|
||||
uid_entry->utime += usw->utime;
|
||||
uid_entry->stime += usw->stime;
|
||||
UPDATE_ANDROID_OEM_DATA(&OEM_DATA(uid_entry),
|
||||
&OEM_DATA(usw), NULL, 0);
|
||||
UPDATE_ANDROID_OEM_DATA(OEM_DATA_PTR(uid_entry),
|
||||
OEM_DATA_PTR(usw), NULL, 0);
|
||||
|
||||
__add_uid_io_stats(uid_entry, &usw->ioac, UID_STATE_DEAD_TASKS);
|
||||
next:
|
||||
@@ -544,7 +547,7 @@ static int process_notifier(struct notifier_block *self,
|
||||
#ifdef CONFIG_ANDROID_VENDOR_OEM_DATA
|
||||
usw->android_oem_data1 = 0;
|
||||
#endif
|
||||
UPDATE_ANDROID_OEM_DATA(NULL, &OEM_DATA(usw), task, 1);
|
||||
UPDATE_ANDROID_OEM_DATA(NULL, OEM_DATA_PTR(usw), task, 1);
|
||||
llist_add(&usw->node, &work_usw);
|
||||
schedule_work(&update_stats_work);
|
||||
}
|
||||
@@ -560,7 +563,7 @@ static int process_notifier(struct notifier_block *self,
|
||||
task_cputime_adjusted(task, &utime, &stime);
|
||||
uid_entry->utime += utime;
|
||||
uid_entry->stime += stime;
|
||||
UPDATE_ANDROID_OEM_DATA(&OEM_DATA(uid_entry), NULL, task, 2);
|
||||
UPDATE_ANDROID_OEM_DATA(OEM_DATA_PTR(uid_entry), NULL, task, 2);
|
||||
|
||||
add_uid_io_stats(uid_entry, task, UID_STATE_DEAD_TASKS);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user