summaryrefslogtreecommitdiffstats
path: root/sys/dev/speaker/spkr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/speaker/spkr.c')
-rw-r--r--sys/dev/speaker/spkr.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c
index 94d4792..ec890ff 100644
--- a/sys/dev/speaker/spkr.c
+++ b/sys/dev/speaker/spkr.c
@@ -327,15 +327,13 @@ playstring(char *cp, size_t slen)
slen--;
} else {
GETNUM(cp, octave);
- if (octave >= sizeof(pitchtab) / sizeof(pitchtab[0]) /
- OCTAVE_NOTES)
+ if (octave >= nitems(pitchtab) / OCTAVE_NOTES)
octave = DFLT_OCTAVE;
octprefix = TRUE;
}
break;
case '>':
- if (octave < sizeof(pitchtab) / sizeof(pitchtab[0]) /
- OCTAVE_NOTES - 1)
+ if (octave < nitems(pitchtab) / OCTAVE_NOTES - 1)
octave++;
octprefix = TRUE;
break;
OpenPOWER on IntegriCloud