Skip to content

Commit

Permalink
eth: yt6801: donot assigning value of variable of type to itself
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Avenger-285714 committed Nov 28, 2024
1 parent f39973c commit 3beac03
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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++) {
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 3beac03

Please sign in to comment.