diff options
author | Kevin Cernekee <cernekee@gmail.com> | 2014-11-10 16:09:23 -0500 |
---|---|---|
committer | Steve French <steve.french@primarydata.com> | 2014-12-14 15:55:57 -0500 |
commit | 97c7134ae22fbd2b8730211f9d4d4517264a8efe (patch) | |
tree | bb59df354df66cdfcb1a58f9940c7ebd0ccf3467 /fs/cifs | |
parent | 9235d09873316d602937b5d45c431fb653f3aed8 (diff) |
Fix signed/unsigned pointer warning
Commit 2ae83bf93882d1 ("[CIFS] Fix setting time before epoch (negative
time values)") changed "u64 t" to "s64 t", which makes do_div() complain
about a pointer signedness mismatch:
CC fs/cifs/netmisc.o
In file included from ./arch/mips/include/asm/div64.h:12:0,
from include/linux/kernel.h:124,
from include/linux/list.h:8,
from include/linux/wait.h:6,
from include/linux/net.h:23,
from fs/cifs/netmisc.c:25:
fs/cifs/netmisc.c: In function ‘cifs_NTtimeToUnix’:
include/asm-generic/div64.h:43:28: warning: comparison of distinct pointer types lacks a cast [enabled by default]
(void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
^
fs/cifs/netmisc.c:941:22: note: in expansion of macro ‘do_div’
ts.tv_nsec = (long)do_div(t, 10000000) * 100;
Introduce a temporary "u64 abs_t" variable to fix this.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Steve French <steve.french@primarydata.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/netmisc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c index b333ff60781d..abae6dd2c6b9 100644 --- a/fs/cifs/netmisc.c +++ b/fs/cifs/netmisc.c | |||
@@ -926,6 +926,7 @@ cifs_NTtimeToUnix(__le64 ntutc) | |||
926 | 926 | ||
927 | /* Subtract the NTFS time offset, then convert to 1s intervals. */ | 927 | /* Subtract the NTFS time offset, then convert to 1s intervals. */ |
928 | s64 t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET; | 928 | s64 t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET; |
929 | u64 abs_t; | ||
929 | 930 | ||
930 | /* | 931 | /* |
931 | * Unfortunately can not use normal 64 bit division on 32 bit arch, but | 932 | * Unfortunately can not use normal 64 bit division on 32 bit arch, but |
@@ -933,13 +934,14 @@ cifs_NTtimeToUnix(__le64 ntutc) | |||
933 | * to special case them | 934 | * to special case them |
934 | */ | 935 | */ |
935 | if (t < 0) { | 936 | if (t < 0) { |
936 | t = -t; | 937 | abs_t = -t; |
937 | ts.tv_nsec = (long)(do_div(t, 10000000) * 100); | 938 | ts.tv_nsec = (long)(do_div(abs_t, 10000000) * 100); |
938 | ts.tv_nsec = -ts.tv_nsec; | 939 | ts.tv_nsec = -ts.tv_nsec; |
939 | ts.tv_sec = -t; | 940 | ts.tv_sec = -abs_t; |
940 | } else { | 941 | } else { |
941 | ts.tv_nsec = (long)do_div(t, 10000000) * 100; | 942 | abs_t = t; |
942 | ts.tv_sec = t; | 943 | ts.tv_nsec = (long)do_div(abs_t, 10000000) * 100; |
944 | ts.tv_sec = abs_t; | ||
943 | } | 945 | } |
944 | 946 | ||
945 | return ts; | 947 | return ts; |