Skip to content

Commit 09aa788

Browse files
LorenzoBianconiPaolo Abeni
authored andcommitted
net: airoha: Do not store hfwd references in airoha_qdma struct
Since hfwd descriptor and buffer queues are allocated via dmam_alloc_coherent() we do not need to store their references in airoha_qdma struct. This patch does not introduce any logical changes, just code clean-up. Signed-off-by: Lorenzo Bianconi <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 2d13b45 commit 09aa788

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

drivers/net/ethernet/airoha/airoha_eth.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,17 +1077,13 @@ static int airoha_qdma_init_hfwd_queues(struct airoha_qdma *qdma)
10771077
int size;
10781078

10791079
size = HW_DSCP_NUM * sizeof(struct airoha_qdma_fwd_desc);
1080-
qdma->hfwd.desc = dmam_alloc_coherent(eth->dev, size, &dma_addr,
1081-
GFP_KERNEL);
1082-
if (!qdma->hfwd.desc)
1080+
if (!dmam_alloc_coherent(eth->dev, size, &dma_addr, GFP_KERNEL))
10831081
return -ENOMEM;
10841082

10851083
airoha_qdma_wr(qdma, REG_FWD_DSCP_BASE, dma_addr);
10861084

10871085
size = AIROHA_MAX_PACKET_SIZE * HW_DSCP_NUM;
1088-
qdma->hfwd.q = dmam_alloc_coherent(eth->dev, size, &dma_addr,
1089-
GFP_KERNEL);
1090-
if (!qdma->hfwd.q)
1086+
if (!dmam_alloc_coherent(eth->dev, size, &dma_addr, GFP_KERNEL))
10911087
return -ENOMEM;
10921088

10931089
airoha_qdma_wr(qdma, REG_FWD_BUF_BASE, dma_addr);

drivers/net/ethernet/airoha/airoha_eth.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -513,12 +513,6 @@ struct airoha_qdma {
513513

514514
struct airoha_queue q_tx[AIROHA_NUM_TX_RING];
515515
struct airoha_queue q_rx[AIROHA_NUM_RX_RING];
516-
517-
/* descriptor and packet buffers for qdma hw forward */
518-
struct {
519-
void *desc;
520-
void *q;
521-
} hfwd;
522516
};
523517

524518
struct airoha_gdm_port {

0 commit comments

Comments
 (0)