lkml.org 
[lkml]   [2020]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 5.4 286/459] wan: ixp4xx_hss: fix compile-testing on 64-bit
    Date
    From: Arnd Bergmann <arnd@arndb.de>

    [ Upstream commit 504c28c853ec5c626900b914b5833daf0581a344 ]

    Change the driver to use portable integer types to avoid
    warnings during compile testing:

    drivers/net/wan/ixp4xx_hss.c:863:21: error: cast to 'u32 *' (aka 'unsigned int *') from smaller integer type 'int' [-Werror,-Wint-to-pointer-cast]
    memcpy_swab32(mem, (u32 *)((int)skb->data & ~3), bytes / 4);
    ^
    drivers/net/wan/ixp4xx_hss.c:979:12: error: incompatible pointer types passing 'u32 *' (aka 'unsigned int *') to parameter of type 'dma_addr_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
    &port->desc_tab_phys)))
    ^~~~~~~~~~~~~~~~~~~~
    include/linux/dmapool.h:27:20: note: passing argument to parameter 'handle' here
    dma_addr_t *handle);
    ^

    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/net/wan/ixp4xx_hss.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
    index ea6ee6a608ce3..e7619cec978a8 100644
    --- a/drivers/net/wan/ixp4xx_hss.c
    +++ b/drivers/net/wan/ixp4xx_hss.c
    @@ -258,7 +258,7 @@ struct port {
    struct hss_plat_info *plat;
    buffer_t *rx_buff_tab[RX_DESCS], *tx_buff_tab[TX_DESCS];
    struct desc *desc_tab; /* coherent */
    - u32 desc_tab_phys;
    + dma_addr_t desc_tab_phys;
    unsigned int id;
    unsigned int clock_type, clock_rate, loopback;
    unsigned int initialized, carrier;
    @@ -858,7 +858,7 @@ static int hss_hdlc_xmit(struct sk_buff *skb, struct net_device *dev)
    dev->stats.tx_dropped++;
    return NETDEV_TX_OK;
    }
    - memcpy_swab32(mem, (u32 *)((int)skb->data & ~3), bytes / 4);
    + memcpy_swab32(mem, (u32 *)((uintptr_t)skb->data & ~3), bytes / 4);
    dev_kfree_skb(skb);
    #endif

    --
    2.20.1
    \
     
     \ /
      Last update: 2020-02-14 17:09    [W:2.411 / U:0.180 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site