build: fix build err [1/1]

PD#SWPL-4150

Problem:
When switch to the toolchain shipped with android P, multipile
"-Werror=maybe-uninitialized" error occurs, and the code fail
to be compiled

Solution:
Initialize variables if necessary

Verify:
Locally on Ampere

Change-Id: I280de648914565656831e211539bf41a7dee2b4a
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
This commit is contained in:
Jiamin Ma
2019-01-14 18:56:54 +08:00
committed by Jianxin Pan
parent de4e1485d3
commit 740409335a
7 changed files with 23 additions and 3 deletions

View File

@@ -112,6 +112,11 @@ COMPAT_SYSCALL_DEFINE2(settimeofday, struct compat_timeval __user *, tv,
struct timespec new_ts;
struct timezone new_tz;
#ifdef CONFIG_AMLOGIC_MODIFY
new_ts.tv_sec = 0;
new_ts.tv_nsec = 0;
#endif
if (tv) {
if (compat_get_timeval(&user_tv, tv))
return -EFAULT;

View File

@@ -1222,6 +1222,10 @@ void set_process_cpu_timer(struct task_struct *tsk, unsigned int clock_idx,
{
unsigned long long now;
#ifdef CONFIG_AMLOGIC_MODIFY
now = 0;
#endif
WARN_ON_ONCE(clock_idx == CPUCLOCK_SCHED);
cpu_timer_sample_group(clock_idx, tsk, &now);

View File

@@ -198,6 +198,11 @@ SYSCALL_DEFINE2(settimeofday, struct timeval __user *, tv,
struct timespec new_ts;
struct timezone new_tz;
#ifdef CONFIG_AMLOGIC_MODIFY
new_ts.tv_sec = 0;
new_ts.tv_nsec = 0;
#endif
if (tv) {
if (copy_from_user(&user_tv, tv, sizeof(*tv)))
return -EFAULT;