siba(4): remove slightly used 'bound' variable.
It can be replaced with nitems(). While here simplify the function Suggested by: jhb
This commit is contained in:
parent
b8c2cd15e9
commit
c3f2d05727
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298409
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user