From 3beac033c2bc2d0f2924a14de542548f741afc47 Mon Sep 17 00:00:00 2001 From: WangYuli Date: Thu, 28 Nov 2024 15:30:54 +0800 Subject: [PATCH] eth: yt6801: donot assigning value of variable of type to itself Fix follow compile errors with clang-19: drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c:500:8: error: explicitly assigning value of variable of type 'struct fxgmac_pdata *' to itself [-Werror,-Wself-assign] 500 | pdata = pdata; | ~~~~~ ^ ~~~~~ drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c:611:8: error: explicitly assigning value of variable of type 'struct fxgmac_pdata *' to itself [-Werror,-Wself-assign] 611 | pdata = pdata; | ~~~~~ ^ ~~~~~ drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c:1321:14: error: explicitly assigning value of variable of type 'int' to itself [-Werror,-Wself-assign] 1321 | start_index = start_index; | ~~~~~~~~~~~ ^ ~~~~~~~~~~~ drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c:1618:8: error: explicitly assigning value of variable of type 'struct fxgmac_pdata *' to itself [-Werror,-Wself-assign] 1618 | pdata = pdata; | ~~~~~ ^ ~~~~~ drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c:2628:7: error: explicitly assigning value of variable of type 'unsigned int' to itself [-Werror,-Wself-assign] 2628 | type = type; | ~~~~ ^ ~~~~ drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c:5019:9: error: explicitly assigning value of variable of type 'int' to itself [-Werror,-Wself-assign] 5019 | int_id = int_id; | ~~~~~~ ^ ~~~~~~ 6 errors generated. Signed-off-by: WangYuli --- .../ethernet/motorcomm/yt6801/fuxi-gmac-hw.c | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c b/drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c index 0517968365d74..ba0d1d86ddaaf 100644 --- a/drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c +++ b/drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c @@ -486,23 +486,23 @@ static void fxgmac_config_multicast_mac_hash_table(struct fxgmac_pdata *pdata, writereg(pdata->pAdapter, regval, pdata->mac_regs + hash_reg); } -static void fxgmac_set_mac_hash_table(struct fxgmac_pdata *pdata) -{ #ifndef DPDK #if FUXI_MAC_HASH_TABLE +static void fxgmac_set_mac_hash_table(struct fxgmac_pdata *pdata) +{ struct net_device *netdev = pdata->netdev; struct netdev_hw_addr *ha; netdev_for_each_mc_addr(ha, netdev) { fxgmac_config_multicast_mac_hash_table(pdata, ha->addr, 1); } -#endif - pdata = pdata; - +} #else - (void)pdata; -#endif +static inline void fxgmac_set_mac_hash_table(void) +{ } +#endif /* FUXI_MAC_HASH_TABLE */ +#endif /* DPDK */ static int fxgmac_add_mac_addresses(struct fxgmac_pdata *pdata) { @@ -608,8 +608,6 @@ static void fxgmac_prepare_tx_stop(struct fxgmac_pdata *pdata, unsigned long tx_timeout; unsigned int tx_status; - pdata = pdata; - /* Calculate the status register to read and the position within */ if (channel->queue_index < DMA_DSRX_FIRST_QUEUE) { tx_dsr = DMA_DSR0; @@ -1318,7 +1316,6 @@ static void fxgmac_tx_desc_init(struct fxgmac_channel *channel) struct fxgmac_desc_data *desc_data; int start_index = ring->cur; unsigned int i; - start_index = start_index; /* Initialize all descriptors */ for (i = 0; i < ring->dma_desc_count; i++) { @@ -1613,9 +1610,8 @@ static void fxgmac_config_rx_fup_enable(struct fxgmac_pdata *pdata) } } -static int fxgmac_config_tx_coalesce(struct fxgmac_pdata *pdata) +static inline int fxgmac_config_tx_coalesce(struct fxgmac_pdata *pdata) { - pdata = pdata; return 0; } @@ -2625,7 +2621,6 @@ static int fxgmac_write_rss_reg(struct fxgmac_pdata *pdata, unsigned int type, unsigned int index, unsigned int val) { int ret = 0; - type = type; writereg(pdata->pAdapter, val, (pdata->base_mem + index)); @@ -5016,7 +5011,6 @@ static int fxgmac_dismiss_DMA_int(struct fxgmac_channel *channel, int int_id) { unsigned int dma_ch_ier; - int_id = int_id; dma_ch_ier = readreg(channel->pdata->pAdapter, FXGMAC_DMA_REG(channel, DMA_CH_SR /*1160*/)); writereg(channel->pdata->pAdapter, dma_ch_ier,