diff --git a/sys/ddb/db_variables.c b/sys/ddb/db_variables.c index f48897adf147..b20b93a34fb2 100644 --- a/sys/ddb/db_variables.c +++ b/sys/ddb/db_variables.c @@ -53,8 +53,7 @@ static struct db_variable db_vars[] = { { "db_vnet", NULL, db_var_db_vnet }, #endif }; -static struct db_variable *db_evars = - db_vars + nitems(db_vars); +static struct db_variable *db_evars = db_vars + nitems(db_vars); static int db_find_variable(struct db_variable **varp) diff --git a/sys/geom/part/g_part_bsd.c b/sys/geom/part/g_part_bsd.c index eaa5394b7c7c..ee88b4636a69 100644 --- a/sys/geom/part/g_part_bsd.c +++ b/sys/geom/part/g_part_bsd.c @@ -140,8 +140,7 @@ bsd_parse_type(const char *type, uint8_t *fstype) *fstype = (u_int)lt; return (0); } - for (i = 0; - i < nitems(bsd_alias_match); i++) { + for (i = 0; i < nitems(bsd_alias_match); i++) { alias = g_part_alias_name(bsd_alias_match[i].alias); if (strcasecmp(type, alias) == 0) { *fstype = bsd_alias_match[i].type; diff --git a/sys/geom/part/g_part_ebr.c b/sys/geom/part/g_part_ebr.c index e3e7e8f63db0..658b6ef495cb 100644 --- a/sys/geom/part/g_part_ebr.c +++ b/sys/geom/part/g_part_ebr.c @@ -188,8 +188,7 @@ ebr_parse_type(const char *type, u_char *dp_typ) *dp_typ = (u_char)lt; return (0); } - for (i = 0; - i < nitems(ebr_alias_match); i++) { + for (i = 0; i < nitems(ebr_alias_match); i++) { alias = g_part_alias_name(ebr_alias_match[i].alias); if (strcasecmp(type, alias) == 0) { *dp_typ = ebr_alias_match[i].typ; @@ -603,8 +602,7 @@ g_part_ebr_type(struct g_part_table *basetable, struct g_part_entry *baseentry, int i; entry = (struct g_part_ebr_entry *)baseentry; - for (i = 0; - i < nitems(ebr_alias_match); i++) { + for (i = 0; i < nitems(ebr_alias_match); i++) { if (ebr_alias_match[i].typ == entry->ent.dp_typ) return (g_part_alias_name(ebr_alias_match[i].alias)); } diff --git a/sys/geom/part/g_part_ldm.c b/sys/geom/part/g_part_ldm.c index fec8e7716d41..374a77a86602 100644 --- a/sys/geom/part/g_part_ldm.c +++ b/sys/geom/part/g_part_ldm.c @@ -453,8 +453,7 @@ ldm_privhdr_check(struct ldm_db *db, struct g_consumer *cp, int is_gpt) cp2->provider->mediasize / cp2->provider->sectorsize - 1; } else last = pp->mediasize / pp->sectorsize - 1; - for (found = 0, i = is_gpt; - i < nitems(ldm_ph_off); i++) { + for (found = 0, i = is_gpt; i < nitems(ldm_ph_off); i++) { offset = ldm_ph_off[i]; /* * In the GPT case consumer is attached to the LDM metadata @@ -1468,8 +1467,7 @@ g_part_ldm_type(struct g_part_table *basetable, struct g_part_entry *baseentry, int i; entry = (struct g_part_ldm_entry *)baseentry; - for (i = 0; - i < nitems(ldm_alias_match); i++) { + for (i = 0; i < nitems(ldm_alias_match); i++) { if (ldm_alias_match[i].typ == entry->type) return (g_part_alias_name(ldm_alias_match[i].alias)); } diff --git a/sys/geom/part/g_part_mbr.c b/sys/geom/part/g_part_mbr.c index 1bb9702a9ec6..d3f1cebd5ba6 100644 --- a/sys/geom/part/g_part_mbr.c +++ b/sys/geom/part/g_part_mbr.c @@ -158,8 +158,7 @@ mbr_parse_type(const char *type, u_char *dp_typ) *dp_typ = (u_char)lt; return (0); } - for (i = 0; - i < nitems(mbr_alias_match); i++) { + for (i = 0; i < nitems(mbr_alias_match); i++) { alias = g_part_alias_name(mbr_alias_match[i].alias); if (strcasecmp(type, alias) == 0) { *dp_typ = mbr_alias_match[i].typ; @@ -560,8 +559,7 @@ g_part_mbr_type(struct g_part_table *basetable, struct g_part_entry *baseentry, int i; entry = (struct g_part_mbr_entry *)baseentry; - for (i = 0; - i < nitems(mbr_alias_match); i++) { + for (i = 0; i < nitems(mbr_alias_match); i++) { if (mbr_alias_match[i].typ == entry->ent.dp_typ) return (g_part_alias_name(mbr_alias_match[i].alias)); } diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c index 22845bb53d88..1ed0da2ebfee 100644 --- a/sys/kern/sysv_msg.c +++ b/sys/kern/sysv_msg.c @@ -1518,8 +1518,7 @@ sys_msgsys(td, uap) if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) return (ENOSYS); - if (uap->which < 0 || - uap->which >= nitems(msgcalls)) + if (uap->which < 0 || uap->which >= nitems(msgcalls)) return (EINVAL); error = (*msgcalls[uap->which])(td, &uap->a2); return (error); diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index d3546a186430..c9b832edd331 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -1400,8 +1400,7 @@ sys_semsys(td, uap) if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) return (ENOSYS); - if (uap->which < 0 || - uap->which >= nitems(semcalls)) + if (uap->which < 0 || uap->which >= nitems(semcalls)) return (EINVAL); error = (*semcalls[uap->which])(td, &uap->a2); return (error); diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 91e4c5902570..8c8b5d7b4ff9 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1896,8 +1896,7 @@ syncookie_generate(struct syncache_head *sch, struct syncache *sc) /* Map our computed MSS into the 3-bit index. */ mss = min(tcp_mssopt(&sc->sc_inc), max(sc->sc_peer_mss, V_tcp_minmss)); - for (i = nitems(tcp_sc_msstab) - 1; - tcp_sc_msstab[i] > mss && i > 0; + for (i = nitems(tcp_sc_msstab) - 1; tcp_sc_msstab[i] > mss && i > 0; i--) ; cookie.flags.mss_idx = i; @@ -1909,7 +1908,7 @@ syncookie_generate(struct syncache_head *sch, struct syncache *sc) if (sc->sc_flags & SCF_WINSCALE) { wscale = sc->sc_requested_s_scale; for (i = nitems(tcp_sc_wstab) - 1; - tcp_sc_wstab[i] > wscale && i > 0; + tcp_sc_wstab[i] > wscale && i > 0; i--) ; cookie.flags.wscale_idx = i; diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index 68cb8fd7bdad..0e43cca4c23a 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -381,8 +381,7 @@ struct domain inet6domain = { .dom_family = AF_INET6, .dom_name = "internet6", .dom_protosw = (struct protosw *)inet6sw, - .dom_protoswNPROTOSW = (struct protosw *) - &inet6sw[nitems(inet6sw)], + .dom_protoswNPROTOSW = (struct protosw *)&inet6sw[nitems(inet6sw)], #ifdef RADIX_MPATH .dom_rtattach = rn6_mpath_inithead, #else