Skip to content

Commit

Permalink
net: fs_enet: Fix address space and base types mismatches
Browse files Browse the repository at this point in the history
CHECK   drivers/net/ethernet/freescale/fs_enet/mac-fcc.c
drivers/net/ethernet/freescale/fs_enet/mac-fcc.c:550:9: warning: cast removes address space '__iomem' of expression
drivers/net/ethernet/freescale/fs_enet/mac-fcc.c:550:9: error: subtraction of different types can't work (different address spaces)
  CC      drivers/net/ethernet/freescale/fs_enet/mii-bitbang.o
  CHECK   drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c
drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c:95:31: warning: incorrect type in argument 1 (different base types)
drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c:95:31:    expected unsigned int [noderef] [usertype] __iomem *p
drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c:95:31:    got restricted __be32 [noderef] [usertype] __iomem *dat
...
drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c:63:31: warning: incorrect type in argument 1 (different base types)
drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c:63:31:    expected unsigned int [noderef] [usertype] __iomem *p
drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c:63:31:    got restricted __be32 [noderef] [usertype] __iomem *dir
...

Fix those address space and base type mismatches reported by sparse.

Signed-off-by: Christophe Leroy <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Link: https://lore.kernel.org/r/25c7965e6aeeb6bbe1b6be5a3c2c7125182fcb02.1691155346.git.christophe.leroy@csgroup.eu
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
chleroy authored and kuba-moo committed Aug 8, 2023
1 parent 78d3902 commit ae9e78a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/freescale/fs_enet/mac-fcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ static void tx_restart(struct net_device *dev)
}
/* Now update the TBPTR and dirty flag to the current buffer */
W32(ep, fen_genfcc.fcc_tbptr,
(uint) (((void *)recheck_bd - fep->ring_base) +
(uint)(((void __iomem *)recheck_bd - fep->ring_base) +
fep->ring_mem_addr));
fep->dirty_tx = recheck_bd;

Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

struct bb_info {
struct mdiobb_ctrl ctrl;
__be32 __iomem *dir;
__be32 __iomem *dat;
u32 __iomem *dir;
u32 __iomem *dat;
u32 mdio_msk;
u32 mdc_msk;
};
Expand Down

0 comments on commit ae9e78a

Please sign in to comment.