Fix signed/unsigned pointer warning
authorKevin Cernekee <cernekee@gmail.com>
Mon, 10 Nov 2014 21:09:23 +0000 (13:09 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 30 Apr 2017 03:49:15 +0000 (05:49 +0200)
commita3f3f11f8b70f9f5a886fe0ce72ae1a9a4018cbc
tree857c8000cdef818bbf0e0ed7aca9897e0931a64b
parenta5fd3dcbf0973a6a832f81e476c90aa9a027ea87
Fix signed/unsigned pointer warning

commit 97c7134ae22fbd2b8730211f9d4d4517264a8efe upstream.

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>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/netmisc.c