All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch iproute2-next 0/2] devlink: fix couple of cosmetic issues
@ 2022-09-29 10:24 Jiri Pirko
  2022-09-29 10:24 ` [patch iproute2-next 1/2] devlink: move use_iec into struct dl Jiri Pirko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jiri Pirko @ 2022-09-29 10:24 UTC (permalink / raw)
  To: netdev; +Cc: sthemmin, dsahern

From: Jiri Pirko <jiri@nvidia.com>

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch iproute2-next 1/2] devlink: move use_iec into struct dl
  2022-09-29 10:24 [patch iproute2-next 0/2] devlink: fix couple of cosmetic issues Jiri Pirko
@ 2022-09-29 10:24 ` Jiri Pirko
  2022-09-29 10:24 ` [patch iproute2-next 2/2] devlink: fix typo in variable name in ifname_map_cb() Jiri Pirko
  2022-09-29 15:00 ` [patch iproute2-next 0/2] devlink: fix couple of cosmetic issues patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2022-09-29 10:24 UTC (permalink / raw)
  To: netdev; +Cc: sthemmin, dsahern

From: Jiri Pirko <jiri@nvidia.com>

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 <jiri@nvidia.com>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [patch iproute2-next 2/2] devlink: fix typo in variable name in ifname_map_cb()
  2022-09-29 10:24 [patch iproute2-next 0/2] devlink: fix couple of cosmetic issues Jiri Pirko
  2022-09-29 10:24 ` [patch iproute2-next 1/2] devlink: move use_iec into struct dl Jiri Pirko
@ 2022-09-29 10:24 ` Jiri Pirko
  2022-09-29 15:00 ` [patch iproute2-next 0/2] devlink: fix couple of cosmetic issues patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2022-09-29 10:24 UTC (permalink / raw)
  To: netdev; +Cc: sthemmin, dsahern

From: Jiri Pirko <jiri@nvidia.com>

s/port_ifindex/port_index/

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch iproute2-next 0/2] devlink: fix couple of cosmetic issues
  2022-09-29 10:24 [patch iproute2-next 0/2] devlink: fix couple of cosmetic issues Jiri Pirko
  2022-09-29 10:24 ` [patch iproute2-next 1/2] devlink: move use_iec into struct dl Jiri Pirko
  2022-09-29 10:24 ` [patch iproute2-next 2/2] devlink: fix typo in variable name in ifname_map_cb() Jiri Pirko
@ 2022-09-29 15:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-09-29 15:00 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: netdev, sthemmin, dsahern

Hello:

This series was applied to iproute2/iproute2-next.git (main)
by David Ahern <dsahern@kernel.org>:

On Thu, 29 Sep 2022 12:24:34 +0200 you wrote:
> From: Jiri Pirko <jiri@nvidia.com>
> 
> 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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-29 15:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-29 10:24 [patch iproute2-next 0/2] devlink: fix couple of cosmetic issues Jiri Pirko
2022-09-29 10:24 ` [patch iproute2-next 1/2] devlink: move use_iec into struct dl Jiri Pirko
2022-09-29 10:24 ` [patch iproute2-next 2/2] devlink: fix typo in variable name in ifname_map_cb() Jiri Pirko
2022-09-29 15:00 ` [patch iproute2-next 0/2] devlink: fix couple of cosmetic issues patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.