Re: [PATCH v7 net-next 07/10] net: dsa: microchip: add support for ethtool port counters
From: Jakub Kicinski <kuba@kernel.org>
Date: 2022-02-05 03:27:30
Also in:
linux-devicetree, lkml
From: Jakub Kicinski <kuba@kernel.org>
Date: 2022-02-05 03:27:30
Also in:
linux-devicetree, lkml
On Fri, 4 Feb 2022 23:14:57 +0530 Prasanna Vengateshan wrote:
+static void lan937x_get_strings(struct dsa_switch *ds, int port, u32 stringset, + uint8_t *buf)
not stdint types in the kernel, please use u8 instead
+{
+ struct ksz_device *dev = ds->priv;
+ int i;
+
+ if (stringset != ETH_SS_STATS)
+ return;
+
+ for (i = 0; i < dev->mib_cnt; i++) {
+ memcpy(buf + i * ETH_GSTRING_LEN, lan937x_mib_names[i].string,
+ ETH_GSTRING_LEN);
+ }parenthesis unnecessary around single expression Also check out ethtool_sprintf(), although not strictly necessary since you're not formatting