usb(4): Substitute "unsigned int" using the equivalent and shorter "unsigned" keyword.

MFC after:	1 week
Sponsored by:	NVIDIA Networking
This commit is contained in:
Hans Petter Selasky 2022-10-07 13:31:51 +02:00
parent 8758aabb16
commit 62d42655bc
22 changed files with 72 additions and 72 deletions

View File

@ -337,7 +337,7 @@ static int
err_intr(void *arg)
{
ehci_softc_t *sc = arg;
unsigned int cause;
unsigned cause;
cause = EREAD4(sc, USB_BRIDGE_INTR_CAUSE);
if (cause) {

View File

@ -700,10 +700,10 @@ xhci_generic_done_sub(struct usb_xfer *xfer)
len = td->remainder;
DPRINTFN(4, "xfer=%p[%u/%u] rem=%u/%u status=%u\n",
xfer, (unsigned int)xfer->aframes,
(unsigned int)xfer->nframes,
(unsigned int)len, (unsigned int)td->len,
(unsigned int)status);
xfer, (unsigned)xfer->aframes,
(unsigned)xfer->nframes,
(unsigned)len, (unsigned)td->len,
(unsigned)status);
/*
* Verify the status length and

View File

@ -217,7 +217,7 @@ static int axe_get_phyno(struct axe_softc *, int);
static int axe_ioctl(struct ifnet *, u_long, caddr_t);
static int axe_rx_frame(struct usb_ether *, struct usb_page_cache *, int);
static int axe_rxeof(struct usb_ether *, struct usb_page_cache *,
unsigned int offset, unsigned int, struct axe_csum_hdr *);
unsigned offset, unsigned, struct axe_csum_hdr *);
static void axe_csum_cfg(struct usb_ether *);
static const struct usb_config axe_config[AXE_N_TRANSFER] = {
@ -1103,8 +1103,8 @@ axe_rx_frame(struct usb_ether *ue, struct usb_page_cache *pc, int actlen)
}
static int
axe_rxeof(struct usb_ether *ue, struct usb_page_cache *pc, unsigned int offset,
unsigned int len, struct axe_csum_hdr *csum_hdr)
axe_rxeof(struct usb_ether *ue, struct usb_page_cache *pc, unsigned offset,
unsigned len, struct axe_csum_hdr *csum_hdr)
{
struct ifnet *ifp = ue->ue_ifp;
struct mbuf *m;

View File

@ -135,7 +135,7 @@ static void axge_ifmedia_sts(struct ifnet *, struct ifmediareq *);
static int axge_ioctl(struct ifnet *, u_long, caddr_t);
static void axge_rx_frame(struct usb_ether *, struct usb_page_cache *, int);
static void axge_rxeof(struct usb_ether *, struct usb_page_cache *,
unsigned int, unsigned int, uint32_t);
unsigned, unsigned, uint32_t);
static void axge_csum_cfg(struct usb_ether *);
#define AXGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP)
@ -997,8 +997,8 @@ axge_rx_frame(struct usb_ether *ue, struct usb_page_cache *pc, int actlen)
}
static void
axge_rxeof(struct usb_ether *ue, struct usb_page_cache *pc, unsigned int offset,
unsigned int len, uint32_t status)
axge_rxeof(struct usb_ether *ue, struct usb_page_cache *pc, unsigned offset,
unsigned len, uint32_t status)
{
struct ifnet *ifp;
struct mbuf *m;

View File

@ -1101,7 +1101,7 @@ uhso_mux_intr_callback(struct usb_xfer *xfer, usb_error_t error)
struct usb_page_cache *pc;
struct usb_page_search res;
struct uhso_softc *sc = usbd_xfer_softc(xfer);
unsigned int i, mux;
unsigned i, mux;
UHSO_DPRINTF(3, "status %d\n", USB_GET_STATE(xfer));
@ -1556,7 +1556,7 @@ uhso_attach_ifnet(struct uhso_softc *sc, struct usb_interface *iface, int type)
usb_error_t uerr;
struct sysctl_ctx_list *sctx;
struct sysctl_oid *soid;
unsigned int devunit;
unsigned devunit;
uerr = usbd_transfer_setup(sc->sc_udev,
&iface->idesc->bInterfaceNumber, sc->sc_if_xfer,

View File

@ -91,7 +91,7 @@ static void ue_watchdog(void *);
* Else: device has been detached
*/
uint8_t
uether_pause(struct usb_ether *ue, unsigned int _ticks)
uether_pause(struct usb_ether *ue, unsigned _ticks)
{
if (usb_proc_is_gone(&ue->ue_tq)) {
/* nothing to do */
@ -596,7 +596,7 @@ uether_newbuf(void)
int
uether_rxmbuf(struct usb_ether *ue, struct mbuf *m,
unsigned int len)
unsigned len)
{
struct ifnet *ifp = ue->ue_ifp;
@ -614,7 +614,7 @@ uether_rxmbuf(struct usb_ether *ue, struct mbuf *m,
int
uether_rxbuf(struct usb_ether *ue, struct usb_page_cache *pc,
unsigned int offset, unsigned int len)
unsigned offset, unsigned len)
{
struct ifnet *ifp = ue->ue_ifp;
struct mbuf *m;

View File

@ -104,7 +104,7 @@ struct usb_ether {
#define uether_do_request(ue,req,data,timo) \
usbd_do_request_proc((ue)->ue_udev,&(ue)->ue_tq,req,data,0,NULL,timo)
uint8_t uether_pause(struct usb_ether *, unsigned int);
uint8_t uether_pause(struct usb_ether *, unsigned);
struct ifnet *uether_getifp(struct usb_ether *);
struct mii_data *uether_getmii(struct usb_ether *);
void *uether_getsc(struct usb_ether *);
@ -116,10 +116,10 @@ void uether_init(void *);
int uether_ioctl(struct ifnet *, u_long, caddr_t);
struct mbuf *uether_newbuf(void);
int uether_rxmbuf(struct usb_ether *, struct mbuf *,
unsigned int);
unsigned);
int uether_rxbuf(struct usb_ether *,
struct usb_page_cache *,
unsigned int, unsigned int);
unsigned, unsigned);
void uether_rxflush(struct usb_ether *);
uint8_t uether_is_gone(struct usb_ether *);
void uether_start(struct ifnet *);

View File

@ -759,7 +759,7 @@ u3g_sael_m460_init(struct usb_device *udev)
}
if (err) {
DPRINTFN(1, "request %u failed\n",
(unsigned int)n);
(unsigned)n);
/*
* Some of the requests will fail. Stop doing
* requests when we are getting timeouts so

View File

@ -760,7 +760,7 @@ static const uint32_t uplcom_rates[] = {
#define N_UPLCOM_RATES nitems(uplcom_rates)
static int
uplcom_baud_supported(unsigned int speed)
uplcom_baud_supported(unsigned speed)
{
int i;
for (i = 0; i < N_UPLCOM_RATES; i++) {
@ -812,10 +812,10 @@ uplcom_pre_param(struct ucom_softc *ucom, struct termios *t)
return (EIO);
}
static unsigned int
uplcom_encode_baud_rate_divisor(uint8_t *buf, unsigned int baud)
static unsigned
uplcom_encode_baud_rate_divisor(uint8_t *buf, unsigned baud)
{
unsigned int baseline, mantissa, exponent;
unsigned baseline, mantissa, exponent;
/* Determine the baud rate divisor. This algorithm is taken from Linux. */
/*

View File

@ -124,11 +124,11 @@ SYSCTL_INT(_hw_usb_ucom, OID_AUTO, debug, CTLFLAG_RWTUN,
static uint8_t ucom_cons_rx_buf[UCOM_CONS_BUFSIZE];
static uint8_t ucom_cons_tx_buf[UCOM_CONS_BUFSIZE];
static unsigned int ucom_cons_rx_low = 0;
static unsigned int ucom_cons_rx_high = 0;
static unsigned ucom_cons_rx_low = 0;
static unsigned ucom_cons_rx_high = 0;
static unsigned int ucom_cons_tx_low = 0;
static unsigned int ucom_cons_tx_high = 0;
static unsigned ucom_cons_tx_low = 0;
static unsigned ucom_cons_tx_high = 0;
static int ucom_cons_unit = -1;
static int ucom_cons_subunit = 0;
@ -1392,7 +1392,7 @@ ucom_get_data(struct ucom_softc *sc, struct usb_page_cache *pc,
UCOM_MTX_ASSERT(sc, MA_OWNED);
if (sc->sc_flag & UCOM_FLAG_CONSOLE) {
unsigned int temp;
unsigned temp;
/* get total TX length */
@ -1470,7 +1470,7 @@ ucom_put_data(struct ucom_softc *sc, struct usb_page_cache *pc,
UCOM_MTX_ASSERT(sc, MA_OWNED);
if (sc->sc_flag & UCOM_FLAG_CONSOLE) {
unsigned int temp;
unsigned temp;
/* get maximum RX length */
@ -1652,7 +1652,7 @@ static void
ucom_cnputc(struct consdev *cd, int c)
{
struct ucom_softc *sc = ucom_cons_softc;
unsigned int temp;
unsigned temp;
if (sc == NULL)
return;

View File

@ -239,17 +239,17 @@ usb_dump_xfer(struct usb_xfer *xfer)
}
#ifdef USB_DEBUG
unsigned int usb_port_reset_delay = USB_PORT_RESET_DELAY;
unsigned int usb_port_root_reset_delay = USB_PORT_ROOT_RESET_DELAY;
unsigned int usb_port_reset_recovery = USB_PORT_RESET_RECOVERY;
unsigned int usb_port_powerup_delay = USB_PORT_POWERUP_DELAY;
unsigned int usb_port_resume_delay = USB_PORT_RESUME_DELAY;
unsigned int usb_set_address_settle = USB_SET_ADDRESS_SETTLE;
unsigned int usb_resume_delay = USB_RESUME_DELAY;
unsigned int usb_resume_wait = USB_RESUME_WAIT;
unsigned int usb_resume_recovery = USB_RESUME_RECOVERY;
unsigned int usb_extra_power_up_time = USB_EXTRA_POWER_UP_TIME;
unsigned int usb_enum_nice_time = USB_ENUM_NICE_TIME;
unsigned usb_port_reset_delay = USB_PORT_RESET_DELAY;
unsigned usb_port_root_reset_delay = USB_PORT_ROOT_RESET_DELAY;
unsigned usb_port_reset_recovery = USB_PORT_RESET_RECOVERY;
unsigned usb_port_powerup_delay = USB_PORT_POWERUP_DELAY;
unsigned usb_port_resume_delay = USB_PORT_RESUME_DELAY;
unsigned usb_set_address_settle = USB_SET_ADDRESS_SETTLE;
unsigned usb_resume_delay = USB_RESUME_DELAY;
unsigned usb_resume_wait = USB_RESUME_WAIT;
unsigned usb_resume_recovery = USB_RESUME_RECOVERY;
unsigned usb_extra_power_up_time = USB_EXTRA_POWER_UP_TIME;
unsigned usb_enum_nice_time = USB_ENUM_NICE_TIME;
/*------------------------------------------------------------------------*
* usb_timings_sysctl_handler

View File

@ -64,17 +64,17 @@ void usb_dump_endpoint(struct usb_endpoint *ep);
void usb_dump_xfer(struct usb_xfer *xfer);
#ifdef USB_DEBUG
extern unsigned int usb_port_reset_delay;
extern unsigned int usb_port_root_reset_delay;
extern unsigned int usb_port_reset_recovery;
extern unsigned int usb_port_powerup_delay;
extern unsigned int usb_port_resume_delay;
extern unsigned int usb_set_address_settle;
extern unsigned int usb_resume_delay;
extern unsigned int usb_resume_wait;
extern unsigned int usb_resume_recovery;
extern unsigned int usb_extra_power_up_time;
extern unsigned int usb_enum_nice_time;
extern unsigned usb_port_reset_delay;
extern unsigned usb_port_root_reset_delay;
extern unsigned usb_port_reset_recovery;
extern unsigned usb_port_powerup_delay;
extern unsigned usb_port_resume_delay;
extern unsigned usb_set_address_settle;
extern unsigned usb_resume_delay;
extern unsigned usb_resume_wait;
extern unsigned usb_resume_recovery;
extern unsigned usb_extra_power_up_time;
extern unsigned usb_enum_nice_time;
#else
#define usb_port_reset_delay USB_PORT_RESET_DELAY
#define usb_port_root_reset_delay USB_PORT_ROOT_RESET_DELAY

View File

@ -774,8 +774,8 @@ ugen_get_iface_driver(struct usb_fifo *f, struct usb_gen_descriptor *ugd)
struct usb_interface *iface;
const char *ptr;
const char *desc;
unsigned int len;
unsigned int maxlen;
unsigned len;
unsigned maxlen;
char buf[128];
int error;
@ -1934,7 +1934,7 @@ ugen_get_port_path(struct usb_fifo *f, struct usb_device_port_path *dpp)
{
struct usb_device *udev = f->udev;
struct usb_device *next;
unsigned int nlevel = 0;
unsigned nlevel = 0;
if (udev == NULL)
goto error;

View File

@ -136,7 +136,7 @@ acpi_uhub_upc_type(uint8_t type)
}
static int
acpi_uhub_parse_upc(device_t dev, unsigned int p, ACPI_HANDLE ah, struct sysctl_oid_list *poid)
acpi_uhub_parse_upc(device_t dev, unsigned p, ACPI_HANDLE ah, struct sysctl_oid_list *poid)
{
ACPI_BUFFER buf;
struct acpi_uhub_softc *sc = device_get_softc(dev);
@ -262,7 +262,7 @@ acpi_uhub_port_sysctl(SYSCTL_HANDLER_ARGS)
}
static int
acpi_uhub_parse_pld(device_t dev, unsigned int p, ACPI_HANDLE ah, struct sysctl_oid_list *tree)
acpi_uhub_parse_pld(device_t dev, unsigned p, ACPI_HANDLE ah, struct sysctl_oid_list *tree)
{
ACPI_BUFFER buf;
struct acpi_uhub_softc *sc = device_get_softc(dev);

View File

@ -1590,7 +1590,7 @@ usbd_setup_ctrl_transfer(struct usb_xfer *xfer)
* parts a time.
*/
DPRINTFN(0, "Too many frames: %u\n",
(unsigned int)xfer->nframes);
(unsigned)xfer->nframes);
goto error;
}

View File

@ -82,7 +82,7 @@ hid_get_data_unsigned(const uint8_t *buf, hid_size_t len,
}
static __inline void
hid_put_data_unsigned(uint8_t *buf, hid_size_t len, struct hid_location *loc,
unsigned int value)
unsigned value)
{
return (hid_put_udata(buf, len, loc, value));
}

View File

@ -1076,7 +1076,7 @@ rum_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error)
struct rum_tx_data *data;
struct mbuf *m;
struct usb_page_cache *pc;
unsigned int len;
unsigned len;
int actlen, sumlen;
usbd_xfer_status(xfer, &actlen, &sumlen, NULL, NULL);
@ -2490,7 +2490,7 @@ rum_read_eeprom(struct rum_softc *sc)
static int
rum_bbp_wakeup(struct rum_softc *sc)
{
unsigned int ntries;
unsigned ntries;
for (ntries = 0; ntries < 100; ntries++) {
if (rum_read(sc, RT2573_MAC_CSR12) & 8)

View File

@ -477,7 +477,7 @@ uath_detach(device_t dev)
{
struct uath_softc *sc = device_get_softc(dev);
struct ieee80211com *ic = &sc->sc_ic;
unsigned int x;
unsigned x;
/*
* Prevent further allocations from RX/TX/CMD

View File

@ -1930,7 +1930,7 @@ upgt_detach(device_t dev)
{
struct upgt_softc *sc = device_get_softc(dev);
struct ieee80211com *ic = &sc->sc_ic;
unsigned int x;
unsigned x;
/*
* Prevent further allocations from RX/TX/CMD

View File

@ -929,8 +929,8 @@ urtw_detach(device_t dev)
{
struct urtw_softc *sc = device_get_softc(dev);
struct ieee80211com *ic = &sc->sc_ic;
unsigned int x;
unsigned int n_xfers;
unsigned x;
unsigned n_xfers;
/* Prevent further ioctls */
URTW_LOCK(sc);
@ -1964,7 +1964,7 @@ urtw_set_rate(struct urtw_softc *sc)
static uint16_t
urtw_rtl2rate(uint32_t rate)
{
unsigned int i;
unsigned i;
for (i = 0; i < nitems(urtw_ratetable); i++) {
if (rate == urtw_ratetable[i].val)
@ -2487,7 +2487,7 @@ urtw_led_init(struct urtw_softc *sc)
static usb_error_t
urtw_8225_rf_init(struct urtw_softc *sc)
{
unsigned int i;
unsigned i;
uint16_t data;
usb_error_t error;
@ -2867,7 +2867,7 @@ urtw_8225_rf_stop(struct urtw_softc *sc)
static usb_error_t
urtw_8225v2_rf_init(struct urtw_softc *sc)
{
unsigned int i;
unsigned i;
uint16_t data;
uint32_t data32;
usb_error_t error;
@ -3201,7 +3201,7 @@ urtw_8225v2b_rf_init(struct urtw_softc *sc)
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
const uint8_t *macaddr;
unsigned int i;
unsigned i;
uint8_t data8;
usb_error_t error;

View File

@ -82,7 +82,7 @@ struct urtw_tx_radiotap_header {
(1 << IEEE80211_RADIOTAP_CHANNEL))
struct urtw_stats {
unsigned int txrates[12];
unsigned txrates[12];
};
struct urtw_vap {

View File

@ -440,7 +440,7 @@ zyd_detach(device_t dev)
{
struct zyd_softc *sc = device_get_softc(dev);
struct ieee80211com *ic = &sc->sc_ic;
unsigned int x;
unsigned x;
/*
* Prevent further allocations from RX/TX data