• Anders Roxell's avatar
    dmaengine: imx-dma: fix warning comparison of distinct pointer types · 56d276b5
    Anders Roxell authored
    [ Upstream commit 9227ab56 ]
    
    The warning got introduced by commit 930507c1 ("arm64: add basic
    Kconfig symbols for i.MX8"). Since it got enabled for arm64. The warning
    haven't been seen before since size_t was 'unsigned int' when built on
    arm32.
    
    ../drivers/dma/imx-dma.c: In function ‘imxdma_sg_next’:
    ../include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast
       (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
                                 ^~
    ../include/linux/kernel.h:860:4: note: in expansion of macro ‘__typecheck’
       (__typecheck(x, y) && __no_side_effects(x, y))
        ^~~~~~~~~~~
    ../include/linux/kernel.h:870:24: note: in expansion of macro ‘__safe_cmp’
      __builtin_choose_expr(__safe_cmp(x, y), \
                            ^~~~~~~~~~
    ../include/linux/kernel.h:879:19: note: in expansion of macro ‘__careful_cmp’
     #define min(x, y) __careful_cmp(x, y, <)
                       ^~~~~~~~~~~~~
    ../drivers/dma/imx-dma.c:288:8: note: in expansion of macro ‘min’
      now = min(d->len, sg_dma_len(sg));
            ^~~
    
    Rework so that we use min_t and pass in the size_t that returns the
    minimum of two values, using the specified type.
    Signed-off-by: 's avatarAnders Roxell <anders.roxell@linaro.org>
    Acked-by: Olof Johansson's avatarOlof Johansson <olof@lixom.net>
    Reviewed-by: Fabio Estevam's avatarFabio Estevam <festevam@gmail.com>
    Signed-off-by: Vinod Koul's avatarVinod Koul <vkoul@kernel.org>
    Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
    56d276b5
Name
Last commit
Last update
Documentation Loading commit data...
LICENSES Loading commit data...
arch Loading commit data...
block Loading commit data...
certs Loading commit data...
crypto Loading commit data...
drivers Loading commit data...
firmware Loading commit data...
fs Loading commit data...
include Loading commit data...
init Loading commit data...
ipc Loading commit data...
kernel Loading commit data...
lib Loading commit data...
mm Loading commit data...
net Loading commit data...
samples Loading commit data...
scripts Loading commit data...
security Loading commit data...
sound Loading commit data...
tools Loading commit data...
usr Loading commit data...
virt Loading commit data...
.clang-format Loading commit data...
.cocciconfig Loading commit data...
.get_maintainer.ignore Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Kbuild Loading commit data...
Kconfig Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README Loading commit data...