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 162b371
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 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
30 changes: 13 additions & 17 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 Expand Up @@ -2318,7 +2317,6 @@ static int fxgmac_write_rss_reg(struct fxgmac_pdata *pdata, unsigned int type,
unsigned int index, u32 val)
{
int ret = 0;
type = type;

writereg(pdata->pAdapter, val, (pdata->base_mem + index));

Expand Down Expand Up @@ -4563,7 +4561,6 @@ static int fxgmac_dismiss_DMA_int(struct fxgmac_channel *channel, int int_id)
{
u32 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 Expand Up @@ -4885,7 +4882,6 @@ static void fxgmac_pre_powerdown(struct fxgmac_pdata *pdata, bool phyloopback)
#ifdef FXGMAC_LINK_SPEED_CHECK_PHY_LINK
int link;
#endif
speed = speed;

fxgmac_disable_rx(pdata);

Expand Down

0 comments on commit 162b371

Please sign in to comment.