ethernet: ucc_geth: remove {rx,tx}_glbl_pram_offset from struct ucc_geth_private
These fields are only used within ucc_geth_startup(), so they might as
well be local variables in that function rather than being stashed in
struct ucc_geth_private.
Aside from making that struct a tiny bit smaller, it also shortens
some lines (getting rid of pointless casts while here), and fixes the
problems with using IS_ERR_VALUE() on a u32 as explained in commit
800cd6fb76 ("soc: fsl: qe: change return type of cpm_muram_alloc()
to s32").
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
830c8ddc66
commit
7d9fe90036
@@ -2351,6 +2351,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
|
|||||||
u8 function_code = 0;
|
u8 function_code = 0;
|
||||||
u8 __iomem *endOfRing;
|
u8 __iomem *endOfRing;
|
||||||
u8 numThreadsRxNumerical, numThreadsTxNumerical;
|
u8 numThreadsRxNumerical, numThreadsTxNumerical;
|
||||||
|
s32 rx_glbl_pram_offset, tx_glbl_pram_offset;
|
||||||
|
|
||||||
ugeth_vdbg("%s: IN", __func__);
|
ugeth_vdbg("%s: IN", __func__);
|
||||||
uccf = ugeth->uccf;
|
uccf = ugeth->uccf;
|
||||||
@@ -2495,17 +2496,15 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
|
|||||||
*/
|
*/
|
||||||
/* Tx global PRAM */
|
/* Tx global PRAM */
|
||||||
/* Allocate global tx parameter RAM page */
|
/* Allocate global tx parameter RAM page */
|
||||||
ugeth->tx_glbl_pram_offset =
|
tx_glbl_pram_offset =
|
||||||
qe_muram_alloc(sizeof(struct ucc_geth_tx_global_pram),
|
qe_muram_alloc(sizeof(struct ucc_geth_tx_global_pram),
|
||||||
UCC_GETH_TX_GLOBAL_PRAM_ALIGNMENT);
|
UCC_GETH_TX_GLOBAL_PRAM_ALIGNMENT);
|
||||||
if (IS_ERR_VALUE(ugeth->tx_glbl_pram_offset)) {
|
if (tx_glbl_pram_offset < 0) {
|
||||||
if (netif_msg_ifup(ugeth))
|
if (netif_msg_ifup(ugeth))
|
||||||
pr_err("Can not allocate DPRAM memory for p_tx_glbl_pram\n");
|
pr_err("Can not allocate DPRAM memory for p_tx_glbl_pram\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
ugeth->p_tx_glbl_pram =
|
ugeth->p_tx_glbl_pram = qe_muram_addr(tx_glbl_pram_offset);
|
||||||
(struct ucc_geth_tx_global_pram __iomem *) qe_muram_addr(ugeth->
|
|
||||||
tx_glbl_pram_offset);
|
|
||||||
/* Fill global PRAM */
|
/* Fill global PRAM */
|
||||||
|
|
||||||
/* TQPTR */
|
/* TQPTR */
|
||||||
@@ -2656,17 +2655,15 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
|
|||||||
|
|
||||||
/* Rx global PRAM */
|
/* Rx global PRAM */
|
||||||
/* Allocate global rx parameter RAM page */
|
/* Allocate global rx parameter RAM page */
|
||||||
ugeth->rx_glbl_pram_offset =
|
rx_glbl_pram_offset =
|
||||||
qe_muram_alloc(sizeof(struct ucc_geth_rx_global_pram),
|
qe_muram_alloc(sizeof(struct ucc_geth_rx_global_pram),
|
||||||
UCC_GETH_RX_GLOBAL_PRAM_ALIGNMENT);
|
UCC_GETH_RX_GLOBAL_PRAM_ALIGNMENT);
|
||||||
if (IS_ERR_VALUE(ugeth->rx_glbl_pram_offset)) {
|
if (rx_glbl_pram_offset < 0) {
|
||||||
if (netif_msg_ifup(ugeth))
|
if (netif_msg_ifup(ugeth))
|
||||||
pr_err("Can not allocate DPRAM memory for p_rx_glbl_pram\n");
|
pr_err("Can not allocate DPRAM memory for p_rx_glbl_pram\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
ugeth->p_rx_glbl_pram =
|
ugeth->p_rx_glbl_pram = qe_muram_addr(rx_glbl_pram_offset);
|
||||||
(struct ucc_geth_rx_global_pram __iomem *) qe_muram_addr(ugeth->
|
|
||||||
rx_glbl_pram_offset);
|
|
||||||
/* Fill global PRAM */
|
/* Fill global PRAM */
|
||||||
|
|
||||||
/* RQPTR */
|
/* RQPTR */
|
||||||
@@ -2928,7 +2925,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
|
|||||||
((u32) ug_info->numThreadsTx) << ENET_INIT_PARAM_TGF_SHIFT;
|
((u32) ug_info->numThreadsTx) << ENET_INIT_PARAM_TGF_SHIFT;
|
||||||
|
|
||||||
ugeth->p_init_enet_param_shadow->rgftgfrxglobal |=
|
ugeth->p_init_enet_param_shadow->rgftgfrxglobal |=
|
||||||
ugeth->rx_glbl_pram_offset | ug_info->riscRx;
|
rx_glbl_pram_offset | ug_info->riscRx;
|
||||||
if ((ug_info->largestexternallookupkeysize !=
|
if ((ug_info->largestexternallookupkeysize !=
|
||||||
QE_FLTR_LARGEST_EXTERNAL_TABLE_LOOKUP_KEY_SIZE_NONE) &&
|
QE_FLTR_LARGEST_EXTERNAL_TABLE_LOOKUP_KEY_SIZE_NONE) &&
|
||||||
(ug_info->largestexternallookupkeysize !=
|
(ug_info->largestexternallookupkeysize !=
|
||||||
@@ -2966,7 +2963,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ugeth->p_init_enet_param_shadow->txglobal =
|
ugeth->p_init_enet_param_shadow->txglobal =
|
||||||
ugeth->tx_glbl_pram_offset | ug_info->riscTx;
|
tx_glbl_pram_offset | ug_info->riscTx;
|
||||||
if ((ret_val =
|
if ((ret_val =
|
||||||
fill_init_enet_entries(ugeth,
|
fill_init_enet_entries(ugeth,
|
||||||
&(ugeth->p_init_enet_param_shadow->
|
&(ugeth->p_init_enet_param_shadow->
|
||||||
|
|||||||
@@ -1165,9 +1165,7 @@ struct ucc_geth_private {
|
|||||||
struct ucc_geth_exf_global_pram __iomem *p_exf_glbl_param;
|
struct ucc_geth_exf_global_pram __iomem *p_exf_glbl_param;
|
||||||
u32 exf_glbl_param_offset;
|
u32 exf_glbl_param_offset;
|
||||||
struct ucc_geth_rx_global_pram __iomem *p_rx_glbl_pram;
|
struct ucc_geth_rx_global_pram __iomem *p_rx_glbl_pram;
|
||||||
u32 rx_glbl_pram_offset;
|
|
||||||
struct ucc_geth_tx_global_pram __iomem *p_tx_glbl_pram;
|
struct ucc_geth_tx_global_pram __iomem *p_tx_glbl_pram;
|
||||||
u32 tx_glbl_pram_offset;
|
|
||||||
struct ucc_geth_send_queue_mem_region __iomem *p_send_q_mem_reg;
|
struct ucc_geth_send_queue_mem_region __iomem *p_send_q_mem_reg;
|
||||||
u32 send_q_mem_reg_offset;
|
u32 send_q_mem_reg_offset;
|
||||||
struct ucc_geth_thread_data_tx __iomem *p_thread_data_tx;
|
struct ucc_geth_thread_data_tx __iomem *p_thread_data_tx;
|
||||||
|
|||||||
Reference in New Issue
Block a user