git: 258958b3c7e0 - main - ddb: use _FLAGS command macros where appropriate

From: Mitchell Horne <mhorne_at_FreeBSD.org>
Date: Tue, 05 Jul 2022 15:08:59 UTC
The branch main has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=258958b3c7e017266080ae7fc9e3d8e64b6450d4

commit 258958b3c7e017266080ae7fc9e3d8e64b6450d4
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2022-07-05 14:47:55 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2022-07-05 14:56:55 +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
---
 sys/arm/arm/gic.c                    | 2 +-
 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 +-
 8 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c
index 434c491b4d56..93bfdc29d930 100644
--- a/sys/arm/arm/gic.c
+++ b/sys/arm/arm/gic.c
@@ -1248,7 +1248,7 @@ DEFINE_CLASS_0(gic, arm_gic_driver, arm_gic_methods,
     sizeof(struct arm_gic_softc));
 
 #ifdef DDB
-DB_FUNC(gic, db_show_gic, db_show_table, CS_OWN, NULL)
+DB_SHOW_COMMAND_FLAGS(gic, db_show_gic, CS_OWN)
 {
 	device_t dev;
 	int t;
diff --git a/sys/dev/aic7xxx/aic79xx_osm.c b/sys/dev/aic7xxx/aic79xx_osm.c
index f98c5bcfe301..c9d720f48994 100644
--- a/sys/dev/aic7xxx/aic79xx_osm.c
+++ b/sys/dev/aic7xxx/aic79xx_osm.c
@@ -1473,7 +1473,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 3d55a0e65883..9bc595f111cc 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 9f7b3da8ea5e..f857cf8c6b55 100644
--- a/sys/netinet/netdump/netdump_client.c
+++ b/sys/netinet/netdump/netdump_client.c
@@ -689,7 +689,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 9e049cab7b06..10709fc0db61 100644
--- a/sys/x86/iommu/intel_drv.c
+++ b/sys/x86/iommu/intel_drv.c
@@ -1172,7 +1172,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;