aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha/kernel
diff options
context:
space:
mode:
authorChen Gang <xili_gchen_5257@hotmail.com>2015-05-18 00:37:08 -0400
committerMatt Turner <mattst88@gmail.com>2015-05-26 13:01:51 -0400
commitcceaeddc2edf710141563c65808b5cea6829b925 (patch)
treebe524c12ee03ceb28d9ed4ddb5457cc1714a6406 /arch/alpha/kernel
parent228fa858e5865c9407b0d6710fd504e0b68bc371 (diff)
alpha: kernel: osf_sys: Set 'kts.tv_nsec' only when 'tv' has effect
The related warning: CC init/do_mounts.o arch/alpha/kernel/osf_sys.c: In function 'SyS_osf_settimeofday': arch/alpha/kernel/osf_sys.c:1028:14: warning: 'kts.tv_nsec' may be used uninitialized in this function [-Wmaybe-uninitialized] kts.tv_nsec *= 1000; ^ arch/alpha/kernel/osf_sys.c:1016:18: note: 'kts' was declared here struct timespec kts; ^ Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'arch/alpha/kernel')
-rw-r--r--arch/alpha/kernel/osf_sys.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index e51f578636a5..36dc91ace83a 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -1019,14 +1019,13 @@ SYSCALL_DEFINE2(osf_settimeofday, struct timeval32 __user *, tv,
1019 if (tv) { 1019 if (tv) {
1020 if (get_tv32((struct timeval *)&kts, tv)) 1020 if (get_tv32((struct timeval *)&kts, tv))
1021 return -EFAULT; 1021 return -EFAULT;
1022 kts.tv_nsec *= 1000;
1022 } 1023 }
1023 if (tz) { 1024 if (tz) {
1024 if (copy_from_user(&ktz, tz, sizeof(*tz))) 1025 if (copy_from_user(&ktz, tz, sizeof(*tz)))
1025 return -EFAULT; 1026 return -EFAULT;
1026 } 1027 }
1027 1028
1028 kts.tv_nsec *= 1000;
1029
1030 return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL); 1029 return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL);
1031} 1030}
1032 1031