summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorIoana Ciornei <[email protected]>2023-05-23 16:47:44 +0300
committerPeng Fan <[email protected]>2023-06-14 18:40:16 +0800
commit13ca5c2f56a172a3df1d5b84a084ed437ea26cde (patch)
tree430e4914fa8e32ca2ee7a49c2496d9d4fb64048b /drivers
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 <[email protected]> Reviewed-by: Ramon Fried <[email protected]> Signed-off-by: Peng Fan <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/fsl-mc/dpni.c2
-rw-r--r--drivers/net/ldpaa_eth/ldpaa_eth.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/fsl-mc/dpni.c b/drivers/net/fsl-mc/dpni.c
index 5290be20c85..a31abbff71b 100644
--- a/drivers/net/fsl-mc/dpni.c
+++ b/drivers/net/fsl-mc/dpni.c
@@ -491,7 +491,7 @@ int dpni_get_statistics(struct fsl_mc_io *mc_io,
uint32_t cmd_flags,
uint16_t token,
uint8_t page,
- struct dpni_statistics *stat)
+ union dpni_statistics *stat)
{
struct mc_command cmd = { 0 };
int err;
diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c b/drivers/net/ldpaa_eth/ldpaa_eth.c
index 2cb6e9b7d70..fe901baf5a4 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++) {