mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
Altera TSE: Correct typecast issue detected by kbuild test robot
This patch addresses a portable pointer arithmetic issue in the original submission found by the kbuild test robot. config: make ARCH=i386 allyesconfig altera_sgdma.c: In function 'sgdma_txphysaddr': >> altera_sgdma.c:393:33: warning: cast from >> pointer to integer of different size [-Wpointer-to-int-cast] dma_addr_t offs = (dma_addr_t)((dma_addr_t)desc - ^ >> altera_sgdma.c:394:5: warning: cast from >> pointer to integer of different size [-Wpointer-to-int-cast] (dma_addr_t)priv->tx_dma_desc); ^ altera_sgdma.c: In function 'sgdma_rxphysaddr': >> altera_sgdma.c:403:33: warning: cast from >> pointer to integer of different size [-Wpointer-to-int-cast] dma_addr_t offs = (dma_addr_t)((dma_addr_t)desc - ^ >> altera_sgdma.c:404:5: warning: cast from >> pointer to integer of different size [-Wpointer-to-int-cast] (dma_addr_t)priv->rx_dma_desc); ^ Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8adfc3ae45
commit
a804ad0e3b
1 changed files with 4 additions and 6 deletions
|
@ -390,9 +390,8 @@ sgdma_txphysaddr(struct altera_tse_private *priv,
|
|||
struct sgdma_descrip *desc)
|
||||
{
|
||||
dma_addr_t paddr = priv->txdescmem_busaddr;
|
||||
dma_addr_t offs = (dma_addr_t)((dma_addr_t)desc -
|
||||
(dma_addr_t)priv->tx_dma_desc);
|
||||
return paddr + offs;
|
||||
uintptr_t offs = (uintptr_t)desc - (uintptr_t)priv->tx_dma_desc;
|
||||
return (dma_addr_t)((uintptr_t)paddr + offs);
|
||||
}
|
||||
|
||||
static dma_addr_t
|
||||
|
@ -400,9 +399,8 @@ sgdma_rxphysaddr(struct altera_tse_private *priv,
|
|||
struct sgdma_descrip *desc)
|
||||
{
|
||||
dma_addr_t paddr = priv->rxdescmem_busaddr;
|
||||
dma_addr_t offs = (dma_addr_t)((dma_addr_t)desc -
|
||||
(dma_addr_t)priv->rx_dma_desc);
|
||||
return paddr + offs;
|
||||
uintptr_t offs = (uintptr_t)desc - (uintptr_t)priv->rx_dma_desc;
|
||||
return (dma_addr_t)((uintptr_t)paddr + offs);
|
||||
}
|
||||
|
||||
#define list_remove_head(list, entry, type, member) \
|
||||
|
|
Loading…
Reference in a new issue