aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ldpaa_eth/ldpaa_eth.c
diff options
context:
space:
mode:
authorIoana Ciornei <ioana.ciornei@nxp.com>2023-05-23 16:47:44 +0300
committerPeng Fan <peng.fan@nxp.com>2023-06-14 18:40:16 +0800
commit13ca5c2f56a172a3df1d5b84a084ed437ea26cde (patch)
tree430e4914fa8e32ca2ee7a49c2496d9d4fb64048b /drivers/net/ldpaa_eth/ldpaa_eth.c
parent3e697627400fea74f2d4c5e63dac31eb557e9a83 (diff)
net: ldpaa_eth: transform dpni_statistics from a struct to a union
In order to simplify code, dpni_statistics can be written as a union. Using the raw accessors we can just loop through all the statistics from a page without trying to access each an every one independently. Make this change to a union. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers/net/ldpaa_eth/ldpaa_eth.c')
-rw-r--r--drivers/net/ldpaa_eth/ldpaa_eth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c b/drivers/net/ldpaa_eth/ldpaa_eth.c
index 2cb6e9b7d7..fe901baf5a 100644
--- a/drivers/net/ldpaa_eth/ldpaa_eth.c
+++ b/drivers/net/ldpaa_eth/ldpaa_eth.c
@@ -68,7 +68,7 @@ static const char *dpni_statistics[][DPNI_STATS_PER_PAGE] = {
};
static void print_dpni_stats(const char *strings[],
- struct dpni_statistics dpni_stats)
+ union dpni_statistics dpni_stats)
{
uint64_t *stat;
int i;
@@ -86,7 +86,7 @@ static void ldpaa_eth_get_dpni_counter(void)
{
int err = 0;
unsigned int page = 0;
- struct dpni_statistics dpni_stats;
+ union dpni_statistics dpni_stats;
printf("DPNI counters ..\n");
for (page = 0; page < 3; page++) {