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-desc.c:478:14: error: explicitly assigning value of variable of type 'int' to itself [-Werror,-Wself-assign]
  478 |         start_index = start_index;
      |         ~~~~~~~~~~~ ^ ~~~~~~~~~~~
1 error generated.

drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c:497:8: error: explicitly assigning value of variable of type 'struct fxgmac_pdata *' to itself [-Werror,-Wself-assign]
  497 |         pdata = pdata;
      |         ~~~~~ ^ ~~~~~
drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c:623:8: error: explicitly assigning value of variable of type 'struct fxgmac_pdata *' to itself [-Werror,-Wself-assign]
  623 |         pdata = pdata;
      |         ~~~~~ ^ ~~~~~
drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c:1232:8: error: explicitly assigning value of variable of type 'struct fxgmac_pdata *' to itself [-Werror,-Wself-assign]
 1232 |         pdata = pdata;
      |         ~~~~~ ^ ~~~~~
drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c:2321:7: error: explicitly assigning value of variable of type 'unsigned int' to itself [-Werror,-Wself-assign]
 2321 |         type = type;
      |         ~~~~ ^ ~~~~
drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c:4566:9: error: explicitly assigning value of variable of type 'int' to itself [-Werror,-Wself-assign]
 4566 |         int_id = int_id;
      |         ~~~~~~ ^ ~~~~~~
drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c:4888:8: error: explicitly assigning value of variable of type 'int' to itself [-Werror,-Wself-assign]
 4888 |         speed = speed;
      |         ~~~~~ ^ ~~~~~
6 errors generated.

Signed-off-by: WangYuli <[email protected]>
  • Loading branch information
Avenger-285714 committed Nov 27, 2024
1 parent dc90b09 commit 24a26ae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-desc.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ static void fxgmac_tx_desc_init_channel(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++) {
desc_data = FXGMAC_GET_DESC_DATA(ring, i);
Expand Down
27 changes: 13 additions & 14 deletions drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,24 +482,25 @@ 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 FXGMAC_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;

fxgmac_config_multicast_mac_hash_table(pdata, (unsigned char *)0, 1);
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 /* FXGMAC_MAC_HASH_TABLE */
#endif /* DPDK */

static int fxgmac_set_mc_addresses(struct fxgmac_pdata *pdata)
{
Expand Down Expand Up @@ -612,16 +613,14 @@ static int fxgmac_config_rx_mode(struct fxgmac_pdata *pdata)
return 0;
}

#ifdef FXGMAC_WAIT_TX_STOP
static void fxgmac_prepare_tx_stop(struct fxgmac_pdata *pdata,
struct fxgmac_channel *channel)
{
#ifdef FXGMAC_WAIT_TX_STOP
unsigned int tx_dsr, tx_pos, tx_qidx;
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 @@ -655,11 +654,12 @@ static void fxgmac_prepare_tx_stop(struct fxgmac_pdata *pdata,
netdev_info(pdata->netdev,
"timed out waiting for Tx DMA channel %u to stop\n",
channel->queue_index);
}
#else
pdata = pdata;
channel = channel;
#endif
static inline void fxgmac_prepare_tx_stop(void)
{
}
#endif /* FXGMAC_WAIT_TX_STOP */

static void fxgmac_enable_tx(struct fxgmac_pdata *pdata)
{
Expand Down Expand Up @@ -1229,7 +1229,6 @@ static void fxgmac_config_rx_fup_enable(struct fxgmac_pdata *pdata)

static int fxgmac_config_tx_coalesce(struct fxgmac_pdata *pdata)
{
pdata = pdata;
return 0;
}

Expand Down

0 comments on commit 24a26ae

Please sign in to comment.