aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/boot/common/part.c2
-rw-r--r--sys/boot/efi/loader/bootinfo.c2
-rw-r--r--sys/boot/mips/beri/boot2/boot2.c2
-rw-r--r--sys/boot/uboot/common/metadata.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/sys/boot/common/part.c b/sys/boot/common/part.c
index b349e9677408..7761de370bec 100644
--- a/sys/boot/common/part.c
+++ b/sys/boot/common/part.c
@@ -104,7 +104,7 @@ parttype2str(enum partition_type type)
{
size_t i;
- for (i = 0; i < sizeof(ptypes) / sizeof(ptypes[0]); i++)
+ for (i = 0; i < nitems(ptypes); i++)
if (ptypes[i].type == type)
return (ptypes[i].desc);
return (ptypes[0].desc);
diff --git a/sys/boot/efi/loader/bootinfo.c b/sys/boot/efi/loader/bootinfo.c
index c6a76abc0845..1f45ea3493b3 100644
--- a/sys/boot/efi/loader/bootinfo.c
+++ b/sys/boot/efi/loader/bootinfo.c
@@ -445,7 +445,7 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp)
/* Do relocation fixup on metadata of each module. */
for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) {
- for (i = 0; i < sizeof mdt / sizeof mdt[0]; i++) {
+ for (i = 0; i < nitems(mdt); i++) {
md = file_findmetadata(xp, mdt[i]);
if (md) {
bcopy(md->md_data, &vaddr, sizeof vaddr);
diff --git a/sys/boot/mips/beri/boot2/boot2.c b/sys/boot/mips/beri/boot2/boot2.c
index 2f02c8264c41..3db33c4ea0b0 100644
--- a/sys/boot/mips/beri/boot2/boot2.c
+++ b/sys/boot/mips/beri/boot2/boot2.c
@@ -116,7 +116,7 @@ static const unsigned char flags[NOPT] = {
/* These must match BOOTINFO_DEV_TYPE constants. */
static const char *const dev_nm[] = {"dram", "cfi", "sdcard"};
-static const u_int dev_nm_count = sizeof(dev_nm) / sizeof(dev_nm[0]);
+static const u_int dev_nm_count = nitems(dev_nm);
static struct dmadat __dmadat;
diff --git a/sys/boot/uboot/common/metadata.c b/sys/boot/uboot/common/metadata.c
index c00b56006dfd..38db4bca44b5 100644
--- a/sys/boot/uboot/common/metadata.c
+++ b/sys/boot/uboot/common/metadata.c
@@ -349,7 +349,7 @@ md_load(char *args, vm_offset_t *modulep)
/* Do relocation fixup on metadata of each module. */
for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) {
- for (i = 0; i < sizeof mdt / sizeof mdt[0]; i++) {
+ for (i = 0; i < nitems(mdt); i++) {
md = file_findmetadata(xp, mdt[i]);
if (md) {
bcopy(md->md_data, &vaddr, sizeof vaddr);