From 5bc0787f2919b886036380fb76078891418aef26 Mon Sep 17 00:00:00 2001 From: Matthew D Fleming Date: Tue, 18 Jan 2011 21:14:23 +0000 Subject: [PATCH] Specify a CTLTYPE_FOO so that a future sysctl(8) change does not need to rely on the format string. --- sys/dev/e1000/if_em.c | 16 ++++++++++------ sys/dev/e1000/if_igb.c | 14 +++++++++----- sys/dev/e1000/if_lem.c | 12 ++++++------ sys/dev/en/midway.c | 4 ++-- sys/dev/fatm/if_fatm.c | 8 ++++---- sys/dev/iscsi/initiator/isc_sm.c | 6 +++--- sys/dev/ixgbe/ixgbe.c | 11 ++++++----- sys/dev/patm/if_patm_attach.c | 8 ++++---- sys/dev/usb/net/usb_ethernet.c | 2 +- 9 files changed, 45 insertions(+), 36 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 23b044d0279a..f2e52572d003 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -5082,11 +5082,11 @@ em_add_hw_stats(struct adapter *adapter) "Watchdog timeouts"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "device_control", - CTLFLAG_RD, adapter, E1000_CTRL, + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_CTRL, em_sysctl_reg_handler, "IU", "Device Control Register"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_control", - CTLFLAG_RD, adapter, E1000_RCTL, + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_RCTL, em_sysctl_reg_handler, "IU", "Receiver Control Register"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "fc_high_water", @@ -5103,11 +5103,13 @@ em_add_hw_stats(struct adapter *adapter) queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head", - CTLFLAG_RD, adapter, E1000_TDH(txr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, + E1000_TDH(txr->me), em_sysctl_reg_handler, "IU", "Transmit Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_tail", - CTLFLAG_RD, adapter, E1000_TDT(txr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, + E1000_TDT(txr->me), em_sysctl_reg_handler, "IU", "Transmit Descriptor Tail"); SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "tx_irq", @@ -5118,11 +5120,13 @@ em_add_hw_stats(struct adapter *adapter) "Queue No Descriptor Available"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_head", - CTLFLAG_RD, adapter, E1000_RDH(rxr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, + E1000_RDH(rxr->me), em_sysctl_reg_handler, "IU", "Receive Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_tail", - CTLFLAG_RD, adapter, E1000_RDT(rxr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, + E1000_RDT(rxr->me), em_sysctl_reg_handler, "IU", "Receive Descriptor Tail"); SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "rx_irq", diff --git a/sys/dev/e1000/if_igb.c b/sys/dev/e1000/if_igb.c index 3a616237a0e1..3fff3909b55d 100644 --- a/sys/dev/e1000/if_igb.c +++ b/sys/dev/e1000/if_igb.c @@ -5120,17 +5120,19 @@ igb_add_hw_stats(struct adapter *adapter) queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "interrupt_rate", - CTLFLAG_RD, &adapter->queues[i], + CTLTYPE_UINT | CTLFLAG_RD, &adapter->queues[i], sizeof(&adapter->queues[i]), igb_sysctl_interrupt_rate_handler, "IU", "Interrupt Rate"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head", - CTLFLAG_RD, adapter, E1000_TDH(txr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, + E1000_TDH(txr->me), igb_sysctl_reg_handler, "IU", "Transmit Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_tail", - CTLFLAG_RD, adapter, E1000_TDT(txr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, + E1000_TDT(txr->me), igb_sysctl_reg_handler, "IU", "Transmit Descriptor Tail"); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "no_desc_avail", @@ -5141,11 +5143,13 @@ igb_add_hw_stats(struct adapter *adapter) "Queue Packets Transmitted"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_head", - CTLFLAG_RD, adapter, E1000_RDH(rxr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, + E1000_RDH(rxr->me), igb_sysctl_reg_handler, "IU", "Receive Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_tail", - CTLFLAG_RD, adapter, E1000_RDT(rxr->me), + CTLTYPE_UINT | CTLFLAG_RD, adapter, + E1000_RDT(rxr->me), igb_sysctl_reg_handler, "IU", "Receive Descriptor Tail"); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_packets", diff --git a/sys/dev/e1000/if_lem.c b/sys/dev/e1000/if_lem.c index 254e17b25e4d..7f10909b79c6 100644 --- a/sys/dev/e1000/if_lem.c +++ b/sys/dev/e1000/if_lem.c @@ -4297,11 +4297,11 @@ lem_add_hw_stats(struct adapter *adapter) "Watchdog timeouts"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "device_control", - CTLFLAG_RD, adapter, E1000_CTRL, + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_CTRL, lem_sysctl_reg_handler, "IU", "Device Control Register"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_control", - CTLFLAG_RD, adapter, E1000_RCTL, + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_RCTL, lem_sysctl_reg_handler, "IU", "Receiver Control Register"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "fc_high_water", @@ -4318,19 +4318,19 @@ lem_add_hw_stats(struct adapter *adapter) "TX FIFO resets"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "txd_head", - CTLFLAG_RD, adapter, E1000_TDH(0), + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_TDH(0), lem_sysctl_reg_handler, "IU", "Transmit Descriptor Head"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "txd_tail", - CTLFLAG_RD, adapter, E1000_TDT(0), + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_TDT(0), lem_sysctl_reg_handler, "IU", "Transmit Descriptor Tail"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rxd_head", - CTLFLAG_RD, adapter, E1000_RDH(0), + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_RDH(0), lem_sysctl_reg_handler, "IU", "Receive Descriptor Head"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rxd_tail", - CTLFLAG_RD, adapter, E1000_RDT(0), + CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_RDT(0), lem_sysctl_reg_handler, "IU", "Receive Descriptor Tail"); diff --git a/sys/dev/en/midway.c b/sys/dev/en/midway.c index e94ca78b094b..c343db63def6 100644 --- a/sys/dev/en/midway.c +++ b/sys/dev/en/midway.c @@ -2908,8 +2908,8 @@ en_attach(struct en_softc *sc) goto fail; if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), - OID_AUTO, "istats", CTLFLAG_RD, sc, 0, en_sysctl_istats, - "S", "internal statistics") == NULL) + OID_AUTO, "istats", CTLTYPE_OPAQUE | CTLFLAG_RD, sc, 0, + en_sysctl_istats, "S", "internal statistics") == NULL) goto fail; #ifdef EN_DEBUG diff --git a/sys/dev/fatm/if_fatm.c b/sys/dev/fatm/if_fatm.c index 5dd0c1ddf233..8ddda95d7b43 100644 --- a/sys/dev/fatm/if_fatm.c +++ b/sys/dev/fatm/if_fatm.c @@ -2794,13 +2794,13 @@ fatm_attach(device_t dev) goto fail; if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), - OID_AUTO, "istats", CTLFLAG_RD, sc, 0, fatm_sysctl_istats, - "LU", "internal statistics") == NULL) + OID_AUTO, "istats", CTLTYPE_ULONG | CTLFLAG_RD, sc, 0, + fatm_sysctl_istats, "LU", "internal statistics") == NULL) goto fail; if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), - OID_AUTO, "stats", CTLFLAG_RD, sc, 0, fatm_sysctl_stats, - "LU", "card statistics") == NULL) + OID_AUTO, "stats", CTLTYPE_ULONG | CTLFLAG_RD, sc, 0, + fatm_sysctl_stats, "LU", "card statistics") == NULL) goto fail; if (SYSCTL_ADD_INT(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), diff --git a/sys/dev/iscsi/initiator/isc_sm.c b/sys/dev/iscsi/initiator/isc_sm.c index 25a091978af1..ae043c97e69c 100644 --- a/sys/dev/iscsi/initiator/isc_sm.c +++ b/sys/dev/iscsi/initiator/isc_sm.c @@ -666,7 +666,7 @@ isc_add_sysctls(isc_session_t *sp) SYSCTL_CHILDREN(sp->oid), OID_AUTO, "targetname", - CTLFLAG_RD, + CTLTYPE_STRING | CTLFLAG_RD, (void *)&sp->opt.targetName, 0, isc_sysctl_targetName, "A", "target name"); @@ -674,7 +674,7 @@ isc_add_sysctls(isc_session_t *sp) SYSCTL_CHILDREN(sp->oid), OID_AUTO, "targeaddress", - CTLFLAG_RD, + CTLTYPE_STRING | CTLFLAG_RD, (void *)&sp->opt.targetAddress, 0, isc_sysctl_targetAddress, "A", "target address"); @@ -682,7 +682,7 @@ isc_add_sysctls(isc_session_t *sp) SYSCTL_CHILDREN(sp->oid), OID_AUTO, "stats", - CTLFLAG_RD, + CTLTYPE_STRING | CTLFLAG_RD, (void *)sp, 0, isc_dump_stats, "A", "statistics"); diff --git a/sys/dev/ixgbe/ixgbe.c b/sys/dev/ixgbe/ixgbe.c index 9f84ae2792d1..cf18ac4f01e3 100644 --- a/sys/dev/ixgbe/ixgbe.c +++ b/sys/dev/ixgbe/ixgbe.c @@ -5044,15 +5044,16 @@ ixgbe_add_hw_stats(struct adapter *adapter) queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "interrupt_rate", - CTLFLAG_RD, &adapter->queues[i], sizeof(&adapter->queues[i]), + CTLTYPE_UINT | CTLFLAG_RD, &adapter->queues[i], + sizeof(&adapter->queues[i]), ixgbe_sysctl_interrupt_rate_handler, "IU", "Interrupt Rate"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head", - CTLFLAG_RD, txr, sizeof(txr), + CTLTYPE_UINT | CTLFLAG_RD, txr, sizeof(txr), ixgbe_sysctl_tdh_handler, "IU", "Transmit Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_tail", - CTLFLAG_RD, txr, sizeof(txr), + CTLTYPE_UINT | CTLFLAG_RD, txr, sizeof(txr), ixgbe_sysctl_tdt_handler, "IU", "Transmit Descriptor Tail"); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "no_desc_avail", @@ -5077,11 +5078,11 @@ ixgbe_add_hw_stats(struct adapter *adapter) queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_head", - CTLFLAG_RD, rxr, sizeof(rxr), + CTLTYPE_UINT | CTLFLAG_RD, rxr, sizeof(rxr), ixgbe_sysctl_rdh_handler, "IU", "Receive Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_tail", - CTLFLAG_RD, rxr, sizeof(rxr), + CTLTYPE_UINT | CTLFLAG_RD, rxr, sizeof(rxr), ixgbe_sysctl_rdt_handler, "IU", "Receive Descriptor Tail"); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_packets", diff --git a/sys/dev/patm/if_patm_attach.c b/sys/dev/patm/if_patm_attach.c index 12dfa1498cc7..2e01d0f92e6c 100644 --- a/sys/dev/patm/if_patm_attach.c +++ b/sys/dev/patm/if_patm_attach.c @@ -254,13 +254,13 @@ patm_attach(device_t dev) goto fail; if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), - OID_AUTO, "istats", CTLFLAG_RD, sc, 0, patm_sysctl_istats, - "S", "internal statistics") == NULL) + OID_AUTO, "istats", CTLTYPE_OPAQUE | CTLFLAG_RD, sc, 0, + patm_sysctl_istats, "S", "internal statistics") == NULL) goto fail; if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), - OID_AUTO, "eeprom", CTLFLAG_RD, sc, 0, patm_sysctl_eeprom, - "S", "EEPROM contents") == NULL) + OID_AUTO, "eeprom", CTLTYPE_OPAQUE | CTLFLAG_RD, sc, 0, + patm_sysctl_eeprom, "S", "EEPROM contents") == NULL) goto fail; if (SYSCTL_ADD_UINT(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), diff --git a/sys/dev/usb/net/usb_ethernet.c b/sys/dev/usb/net/usb_ethernet.c index 7ca7894d5fd8..7fbd9efa1c1b 100644 --- a/sys/dev/usb/net/usb_ethernet.c +++ b/sys/dev/usb/net/usb_ethernet.c @@ -240,7 +240,7 @@ ue_attach_post_task(struct usb_proc_msg *_task) OID_AUTO, num, CTLFLAG_RD, NULL, ""); SYSCTL_ADD_PROC(&ue->ue_sysctl_ctx, SYSCTL_CHILDREN(ue->ue_sysctl_oid), OID_AUTO, - "%parent", CTLFLAG_RD, ue, 0, + "%parent", CTLTYPE_STRING | CTLFLAG_RD, ue, 0, ue_sysctl_parent, "A", "parent device"); UE_LOCK(ue);