summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-04-21 15:24:21 +0000
committerpfg <pfg@FreeBSD.org>2016-04-21 15:24:21 +0000
commitfdf39652a42767663d4a74a1a367d193185c51e9 (patch)
treee922eb1381be28e7721707beaa482bb435de6fe0
parent5d68ebcc9d16aac55f20ecbe316e8a59989bb6a7 (diff)
downloadFreeBSD-src-fdf39652a42767663d4a74a1a367d193185c51e9.zip
FreeBSD-src-fdf39652a42767663d4a74a1a367d193185c51e9.tar.gz
siba(4): remove slightly used 'bound' variable.
It can be replaced with nitems(). While here simplify the function Suggested by: jhb
-rw-r--r--sys/dev/siba/siba.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/dev/siba/siba.c b/sys/dev/siba/siba.c
index f0bcd9f..1c429a2 100644
--- a/sys/dev/siba/siba.c
+++ b/sys/dev/siba/siba.c
@@ -337,22 +337,19 @@ siba_attach(device_t dev)
static struct siba_devid *
siba_dev_match(uint16_t vid, uint16_t devid, uint8_t rev)
{
- size_t i, bound;
+ size_t i;
struct siba_devid *sd;
- bound = sizeof(siba_devids) / sizeof(struct siba_devid);
sd = &siba_devids[0];
- for (i = 0; i < bound; i++, sd++) {
+ for (i = 0; i < nitems(siba_devids); i++, sd++) {
if (((vid == SIBA_VID_ANY) || (vid == sd->sd_vendor)) &&
((devid == SIBA_DEVID_ANY) || (devid == sd->sd_device)) &&
((rev == SIBA_REV_ANY) || (rev == sd->sd_rev) ||
(sd->sd_rev == SIBA_REV_ANY)))
- break;
+ return(sd);
}
- if (i == bound)
- sd = NULL;
- return (sd);
+ return (NULL);
}
static int
OpenPOWER on IntegriCloud