diff mbox series

[nft,1/2] Reduce signature of do_list_table()

Message ID 20230320134659.13731-1-phil@nwl.cc
State Accepted
Delegated to: Pablo Neira
Headers show
Series [nft,1/2] Reduce signature of do_list_table() | expand

Commit Message

Phil Sutter March 20, 2023, 1:46 p.m. UTC
Since commit 16fac7d11bdf5 ("src: use cache infrastructure for rule
objects"), the function does not use the passed 'cmd' object anymore.
Remove it to affirm correctness of a follow-up fix and simplification in
do_list_ruleset().

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 src/rule.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Phil Sutter March 21, 2023, 9:08 a.m. UTC | #1
On Mon, Mar 20, 2023 at 02:46:58PM +0100, Phil Sutter wrote:
> Since commit 16fac7d11bdf5 ("src: use cache infrastructure for rule
> objects"), the function does not use the passed 'cmd' object anymore.
> Remove it to affirm correctness of a follow-up fix and simplification in
> do_list_ruleset().
> 
> Signed-off-by: Phil Sutter <phil@nwl.cc>

Series applied.
diff mbox series

Patch

diff --git a/src/rule.c b/src/rule.c
index a04063f7faf7d..fadd7670d97a2 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -1553,8 +1553,7 @@  static int do_command_delete(struct netlink_ctx *ctx, struct cmd *cmd)
 	}
 }
 
-static int do_list_table(struct netlink_ctx *ctx, struct cmd *cmd,
-			 struct table *table)
+static int do_list_table(struct netlink_ctx *ctx, struct table *table)
 {
 	table_print(table, &ctx->nft->output);
 	return 0;
@@ -2188,7 +2187,7 @@  static int do_list_ruleset(struct netlink_ctx *ctx, struct cmd *cmd)
 		cmd->handle.family = table->handle.family;
 		cmd->handle.table.name = table->handle.table.name;
 
-		if (do_list_table(ctx, cmd, table) < 0)
+		if (do_list_table(ctx, table) < 0)
 			return -1;
 	}
 
@@ -2319,7 +2318,7 @@  static int do_command_list(struct netlink_ctx *ctx, struct cmd *cmd)
 	case CMD_OBJ_TABLE:
 		if (!cmd->handle.table.name)
 			return do_list_tables(ctx, cmd);
-		return do_list_table(ctx, cmd, table);
+		return do_list_table(ctx, table);
 	case CMD_OBJ_CHAIN:
 		return do_list_chain(ctx, cmd, table);
 	case CMD_OBJ_CHAINS: