浏览代码

kernel/compat.c: use sizeof() instead of sizeof

Fix 4 checkpatch warnings
WARNING: sizeof *tv should be sizeof(*tv)

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Fabian Frederick 11 年之前
父节点
当前提交
6516a46619
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      kernel/compat.c

+ 4 - 4
kernel/compat.c

@@ -157,7 +157,7 @@ static int __compat_put_timespec(const struct timespec *ts, struct compat_timesp
 int compat_get_timeval(struct timeval *tv, const void __user *utv)
 int compat_get_timeval(struct timeval *tv, const void __user *utv)
 {
 {
 	if (COMPAT_USE_64BIT_TIME)
 	if (COMPAT_USE_64BIT_TIME)
-		return copy_from_user(tv, utv, sizeof *tv) ? -EFAULT : 0;
+		return copy_from_user(tv, utv, sizeof(*tv)) ? -EFAULT : 0;
 	else
 	else
 		return __compat_get_timeval(tv, utv);
 		return __compat_get_timeval(tv, utv);
 }
 }
@@ -166,7 +166,7 @@ EXPORT_SYMBOL_GPL(compat_get_timeval);
 int compat_put_timeval(const struct timeval *tv, void __user *utv)
 int compat_put_timeval(const struct timeval *tv, void __user *utv)
 {
 {
 	if (COMPAT_USE_64BIT_TIME)
 	if (COMPAT_USE_64BIT_TIME)
-		return copy_to_user(utv, tv, sizeof *tv) ? -EFAULT : 0;
+		return copy_to_user(utv, tv, sizeof(*tv)) ? -EFAULT : 0;
 	else
 	else
 		return __compat_put_timeval(tv, utv);
 		return __compat_put_timeval(tv, utv);
 }
 }
@@ -175,7 +175,7 @@ EXPORT_SYMBOL_GPL(compat_put_timeval);
 int compat_get_timespec(struct timespec *ts, const void __user *uts)
 int compat_get_timespec(struct timespec *ts, const void __user *uts)
 {
 {
 	if (COMPAT_USE_64BIT_TIME)
 	if (COMPAT_USE_64BIT_TIME)
-		return copy_from_user(ts, uts, sizeof *ts) ? -EFAULT : 0;
+		return copy_from_user(ts, uts, sizeof(*ts)) ? -EFAULT : 0;
 	else
 	else
 		return __compat_get_timespec(ts, uts);
 		return __compat_get_timespec(ts, uts);
 }
 }
@@ -184,7 +184,7 @@ EXPORT_SYMBOL_GPL(compat_get_timespec);
 int compat_put_timespec(const struct timespec *ts, void __user *uts)
 int compat_put_timespec(const struct timespec *ts, void __user *uts)
 {
 {
 	if (COMPAT_USE_64BIT_TIME)
 	if (COMPAT_USE_64BIT_TIME)
-		return copy_to_user(uts, ts, sizeof *ts) ? -EFAULT : 0;
+		return copy_to_user(uts, ts, sizeof(*ts)) ? -EFAULT : 0;
 	else
 	else
 		return __compat_put_timespec(ts, uts);
 		return __compat_put_timespec(ts, uts);
 }
 }