summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-04-21 15:38:28 +0000
committerpfg <pfg@FreeBSD.org>2016-04-21 15:38:28 +0000
commitfc65edc1cd05de15ef17e14dc54c2bf6c41ccab8 (patch)
tree45622d9ce5a6c394316a37f672cfd0a033c48374 /sys/dev/sound
parentfdf39652a42767663d4a74a1a367d193185c51e9 (diff)
downloadFreeBSD-src-fc65edc1cd05de15ef17e14dc54c2bf6c41ccab8.zip
FreeBSD-src-fc65edc1cd05de15ef17e14dc54c2bf6c41ccab8.tar.gz
Remove slightly used const values that can be replaced with nitems().
Suggested by: jhb
Diffstat (limited to 'sys/dev/sound')
-rw-r--r--sys/dev/sound/pci/emu10kx.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/dev/sound/pci/emu10kx.c b/sys/dev/sound/pci/emu10kx.c
index cb441bb..3d5bfb3 100644
--- a/sys/dev/sound/pci/emu10kx.c
+++ b/sys/dev/sound/pci/emu10kx.c
@@ -564,16 +564,14 @@ emu_getcard(device_t dev)
{
uint16_t device;
uint16_t subdevice;
- int n_cards;
unsigned int thiscard;
int i;
device = pci_read_config(dev, PCIR_DEVICE, /* bytes */ 2);
subdevice = pci_read_config(dev, PCIR_SUBDEV_0, /* bytes */ 2);
- n_cards = sizeof(emu_cards) / sizeof(struct emu_hwinfo);
thiscard = 0;
- for (i = 1; i < n_cards; i++) {
+ for (i = 1; i < nitems(emu_cards); i++) {
if (device == emu_cards[i].device) {
if (subdevice == emu_cards[i].subdevice) {
thiscard = i;
@@ -589,8 +587,7 @@ emu_getcard(device_t dev)
}
}
- n_cards = sizeof(emu_bad_cards) / sizeof(struct emu_hwinfo);
- for (i = 0; i < n_cards; i++) {
+ for (i = 0; i < nitems(emu_cards); i++) {
if (device == emu_bad_cards[i].device) {
if (subdevice == emu_bad_cards[i].subdevice) {
thiscard = 0;
OpenPOWER on IntegriCloud