git: 2571d6f331a4 - stable/13 - ddb: use _FLAGS command macros where appropriate

From: Mitchell Horne <mhorne_at_FreeBSD.org>
Date: Thu, 11 Aug 2022 14:32:51 UTC
The branch stable/13 has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=2571d6f331a46e2a5065874dc6bbcca4aa6613d8

commit 2571d6f331a46e2a5065874dc6bbcca4aa6613d8
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2022-07-05 14:47:55 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2022-08-11 14:25:53 +0000

    ddb: use _FLAGS command macros where appropriate
    
    Some command definitions were forced to use DB_FUNC in order to specify
    their required flags, CS_OWN or CS_MORE. Use the new macros to simplify
    these.
    
    Reviewed by:    markj, jhb
    MFC after:      3 days
    Sponsored by:   Juniper Networks, Inc.
    Sponsored by:   Klara, Inc.
    Differential Revision:  https://reviews.freebsd.org/D35582
    
    (cherry picked from commit 258958b3c7e017266080ae7fc9e3d8e64b6450d4)
---
 sys/dev/aic7xxx/aic79xx_osm.c        | 2 +-
 sys/dev/bxe/bxe_debug.c              | 8 +-------
 sys/gdb/netgdb.c                     | 2 +-
 sys/kern/kern_sysctl.c               | 2 +-
 sys/net/route/route_ddb.c            | 2 +-
 sys/netinet/netdump/netdump_client.c | 2 +-
 sys/x86/iommu/intel_drv.c            | 2 +-
 7 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/sys/dev/aic7xxx/aic79xx_osm.c b/sys/dev/aic7xxx/aic79xx_osm.c
index 1c01cbbcfa07..6f9df656cda7 100644
--- a/sys/dev/aic7xxx/aic79xx_osm.c
+++ b/sys/dev/aic7xxx/aic79xx_osm.c
@@ -1472,7 +1472,7 @@ DB_COMMAND(ahd_in, ahd_ddb_in)
 	}
 }
 
-DB_FUNC(ahd_out, ahd_ddb_out, db_cmd_table, CS_MORE, NULL)
+DB_COMMAND_FLAGS(ahd_out, ahd_ddb_out, CS_MORE)
 {
 	db_expr_t old_value;
 	db_expr_t new_value;
diff --git a/sys/dev/bxe/bxe_debug.c b/sys/dev/bxe/bxe_debug.c
index cd7678d7844e..f6d7dd832367 100644
--- a/sys/dev/bxe/bxe_debug.c
+++ b/sys/dev/bxe/bxe_debug.c
@@ -292,13 +292,7 @@ static void bxe_ddb_usage()
     db_printf("Usage: bxe[/hpv] <instance> [<address>]\n");
 }
 
-static db_cmdfcn_t bxe_ddb;
-_DB_SET(_cmd, bxe, bxe_ddb, db_cmd_table, CS_OWN, NULL);
-
-static void bxe_ddb(db_expr_t blah1,
-                    boolean_t blah2,
-                    db_expr_t blah3,
-                    char      *blah4)
+DB_COMMAND_FLAGS(bxe, bxe_ddb, CS_OWN)
 {
     char if_xname[IFNAMSIZ];
     if_t ifp = NULL;
diff --git a/sys/gdb/netgdb.c b/sys/gdb/netgdb.c
index 599841b33eae..e10f864173c4 100644
--- a/sys/gdb/netgdb.c
+++ b/sys/gdb/netgdb.c
@@ -333,7 +333,7 @@ netgdb_fini(void)
  * Currently, this command does not support configuring encryption or
  * compression.
  */
-DB_FUNC(netgdb, db_netgdb_cmd, db_cmd_table, CS_OWN, NULL)
+DB_COMMAND_FLAGS(netgdb, db_netgdb_cmd, CS_OWN)
 {
 	struct debugnet_ddb_config params;
 	struct debugnet_conn_params dcp;
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index f1e249ace89a..ade5eed8edc3 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -2970,7 +2970,7 @@ db_sysctl_cmd_usage(void)
 /*
  * Show a specific sysctl similar to sysctl (8).
  */
-DB_FUNC(sysctl, db_sysctl_cmd, db_cmd_table, CS_OWN, NULL)
+DB_COMMAND_FLAGS(sysctl, db_sysctl_cmd, CS_OWN)
 {
 	char name[TOK_STRING_SIZE];
 	int error, i, t, flags;
diff --git a/sys/net/route/route_ddb.c b/sys/net/route/route_ddb.c
index 93c457c2ba57..437ede01b4a8 100644
--- a/sys/net/route/route_ddb.c
+++ b/sys/net/route/route_ddb.c
@@ -203,7 +203,7 @@ DB_SHOW_COMMAND(routetable, db_show_routetable_cmd)
 	}
 }
 
-_DB_FUNC(_show, route, db_show_route_cmd, db_show_table, CS_OWN, NULL)
+DB_SHOW_COMMAND_FLAGS(route, db_show_route_cmd, CS_OWN)
 {
 	char abuf[INET6_ADDRSTRLEN], *buf, *end;
 	struct rib_head *rh;
diff --git a/sys/netinet/netdump/netdump_client.c b/sys/netinet/netdump/netdump_client.c
index 8210a48046e2..152feeb8c0c3 100644
--- a/sys/netinet/netdump/netdump_client.c
+++ b/sys/netinet/netdump/netdump_client.c
@@ -769,7 +769,7 @@ DECLARE_MODULE(netdump, netdump_mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
  * Currently, this command does not support configuring encryption or
  * compression.
  */
-DB_FUNC(netdump, db_netdump_cmd, db_cmd_table, CS_OWN, NULL)
+DB_COMMAND_FLAGS(netdump, db_netdump_cmd, CS_OWN)
 {
 	static struct diocskerneldump_arg conf;
 	static char blockbuf[NETDUMP_DATASIZE];
diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c
index c7647c1f7b1d..61da86c098fc 100644
--- a/sys/x86/iommu/intel_drv.c
+++ b/sys/x86/iommu/intel_drv.c
@@ -1158,7 +1158,7 @@ dmar_print_domain(struct dmar_domain *domain, bool show_mappings)
 	}
 }
 
-DB_FUNC(dmar_domain, db_dmar_print_domain, db_show_table, CS_OWN, NULL)
+DB_SHOW_COMMAND_FLAGS(dmar_domain, db_dmar_print_domain, CS_OWN)
 {
 	struct dmar_unit *unit;
 	struct dmar_domain *domain;