[patch iproute2-next 0/2] devlink: fix couple of cosmetic issues

STALE1437d

4 messages, 2 authors, 2022-09-29 · open the first message on its own page

[patch iproute2-next 0/2] devlink: fix couple of cosmetic issues

From: Jiri Pirko <jiri@resnulli.us>
Date: 2022-09-29 10:24:51

From: Jiri Pirko <redacted>

Just cosmetics, more or less.

Jiri Pirko (2):
  devlink: move use_iec into struct dl
  devlink: fix typo in variable name in ifname_map_cb()

 devlink/devlink.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

-- 
2.37.1

[patch iproute2-next 2/2] devlink: fix typo in variable name in ifname_map_cb()

From: Jiri Pirko <jiri@resnulli.us>
Date: 2022-09-29 10:24:53

From: Jiri Pirko <redacted>

s/port_ifindex/port_index/

Signed-off-by: Jiri Pirko <redacted>
---
 devlink/devlink.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index 0e194c9800b7..8c02730b27a9 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -782,7 +782,7 @@ static int ifname_map_cb(const struct nlmsghdr *nlh, void *data)
 	struct ifname_map *ifname_map;
 	const char *bus_name;
 	const char *dev_name;
-	uint32_t port_ifindex;
+	uint32_t port_index;
 	const char *port_ifname;
 
 	mnl_attr_parse(nlh, sizeof(*genl), attr_cb, tb);
@@ -795,10 +795,10 @@ static int ifname_map_cb(const struct nlmsghdr *nlh, void *data)
 
 	bus_name = mnl_attr_get_str(tb[DEVLINK_ATTR_BUS_NAME]);
 	dev_name = mnl_attr_get_str(tb[DEVLINK_ATTR_DEV_NAME]);
-	port_ifindex = mnl_attr_get_u32(tb[DEVLINK_ATTR_PORT_INDEX]);
+	port_index = mnl_attr_get_u32(tb[DEVLINK_ATTR_PORT_INDEX]);
 	port_ifname = mnl_attr_get_str(tb[DEVLINK_ATTR_PORT_NETDEV_NAME]);
 	ifname_map = ifname_map_alloc(bus_name, dev_name,
-				      port_ifindex, port_ifname);
+				      port_index, port_ifname);
 	if (!ifname_map)
 		return MNL_CB_ERROR;
 	list_add(&ifname_map->list, &dl->ifname_map_list);
-- 
2.37.1

[patch iproute2-next 1/2] devlink: move use_iec into struct dl

From: Jiri Pirko <jiri@resnulli.us>
Date: 2022-09-29 10:24:55

From: Jiri Pirko <redacted>

Similar to other bool opts that could be set by the user, move the
global variable use_iec to be part of struct dl.

Signed-off-by: Jiri Pirko <redacted>
---
 devlink/devlink.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index 4f77e42f2d48..0e194c9800b7 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -71,8 +71,6 @@ static bool g_indent_newline;
 #define INDENT_STR_MAXLEN 32
 static char g_indent_str[INDENT_STR_MAXLEN + 1] = "";
 
-static bool use_iec = false;
-
 static void __attribute__((format(printf, 1, 2)))
 pr_err(const char *fmt, ...)
 {
@@ -374,6 +372,7 @@ struct dl {
 	bool verbose;
 	bool stats;
 	bool hex;
+	bool use_iec;
 	bool map_loaded;
 	struct {
 		bool present;
@@ -4926,7 +4925,7 @@ static void pr_out_port_fn_rate(struct dl *dl, struct nlattr **tb)
 			mnl_attr_get_u64(tb[DEVLINK_ATTR_RATE_TX_SHARE]);
 
 		if (rate)
-			print_rate(use_iec, PRINT_ANY, "tx_share",
+			print_rate(dl->use_iec, PRINT_ANY, "tx_share",
 				   " tx_share %s", rate);
 	}
 	if (tb[DEVLINK_ATTR_RATE_TX_MAX]) {
@@ -4934,7 +4933,7 @@ static void pr_out_port_fn_rate(struct dl *dl, struct nlattr **tb)
 			mnl_attr_get_u64(tb[DEVLINK_ATTR_RATE_TX_MAX]);
 
 		if (rate)
-			print_rate(use_iec, PRINT_ANY, "tx_max",
+			print_rate(dl->use_iec, PRINT_ANY, "tx_max",
 				   " tx_max %s", rate);
 	}
 	if (tb[DEVLINK_ATTR_RATE_PARENT_NODE_NAME]) {
@@ -9739,7 +9738,7 @@ int main(int argc, char **argv)
 			}
 			break;
 		case 'i':
-			use_iec = true;
+			dl->use_iec = true;
 			break;
 		case 'x':
 			dl->hex = true;
-- 
2.37.1

Re: [patch iproute2-next 0/2] devlink: fix couple of cosmetic issues

From: patchwork-bot+netdevbpf@kernel.org
Date: 2022-09-29 15:00:28

Hello:

This series was applied to iproute2/iproute2-next.git (main)
by David Ahern [off-list ref]:

On Thu, 29 Sep 2022 12:24:34 +0200 you wrote:
From: Jiri Pirko <redacted>

Just cosmetics, more or less.

Jiri Pirko (2):
  devlink: move use_iec into struct dl
  devlink: fix typo in variable name in ifname_map_cb()

[...]
Here is the summary with links:
  - [iproute2-next,1/2] devlink: move use_iec into struct dl
    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=16d2732a5283
  - [iproute2-next,2/2] devlink: fix typo in variable name in ifname_map_cb()
    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=d8d3aadf347c

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help