• Yanteng Si's avatar
    spi: Fix distinct pointer types warning for ARCH=mips · 8728a81b
    Yanteng Si authored
    Fix a new warning report by build for make ARCH=MIPS allmodconfig:
    
    drivers/spi/spi-cadence-quadspi.c: In function 'cqspi_direct_read_execute':
     ./include/linux/minmax.h:18:28: warning: comparison of distinct pointer types lacks a cast
        18 |  (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
           |                            ^~
     ./include/linux/minmax.h:32:4: note: in expansion of macro '__typecheck'
        32 |   (__typecheck(x, y) && __no_side_effects(x, y))
           |    ^~~~~~~~~~~
     ./include/linux/minmax.h:42:24: note: in expansion of macro '__safe_cmp'
        42 |  __builtin_choose_expr(__safe_cmp(x, y), \
           |                        ^~~~~~~~~~
     ./include/linux/minmax.h:58:19: note: in expansion of macro '__careful_cmp'
        58 | #define max(x, y) __careful_cmp(x, y, >)
           |                   ^~~~~~~~~~~~~
     drivers/spi/spi-cadence-quadspi.c:1153:24: note: in expansion of macro 'max'
      1153 |       msecs_to_jiffies(max(len, 500UL)))) {
           |                        ^~~
    
    "len" is unsigned,however,"500" is unsigned long.
    Signed-off-by: default avatarYanteng Si <siyanteng@loongson.cn>
    Link: https://lore.kernel.org/r/20210107115704.3835282-1-siyanteng@loongson.cnSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    8728a81b
spi-cadence-quadspi.c 43.2 KB