atkbd(4): Just use nitems() for quirk enumeration
Reviewed by: imp, wulf X-MFC-With: r368365 Differential Revision: https://reviews.freebsd.org/D27489
This commit is contained in:
parent
23e0c68a47
commit
3a52ffb8b3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=368374
@ -119,7 +119,6 @@ static struct atkbdc_quirks quirks[] = {
|
||||
KBDC_QUIRK_RESET_AFTER_PROBE | KBDC_QUIRK_SETLEDS_ON_INIT},
|
||||
/* KBDC hangs on Lenovo X120e and X121e after disabling AUX MUX */
|
||||
{NULL, "LENOVO", NULL, KBDC_QUIRK_DISABLE_MUX_PROBE},
|
||||
{NULL, NULL, NULL, 0}
|
||||
};
|
||||
|
||||
#define QUIRK_STR_MATCH(s1, s2) (s1 == NULL || \
|
||||
@ -133,8 +132,7 @@ atkbdc_getquirks(void)
|
||||
char* maker = kern_getenv("smbios.system.maker");
|
||||
char* product = kern_getenv("smbios.system.product");
|
||||
|
||||
for (i=0; quirks[i].bios_vendor != NULL || quirks[i].maker != NULL ||
|
||||
quirks[i].product != NULL; ++i)
|
||||
for (i = 0; i < nitems(quirks); i++)
|
||||
if (QUIRK_STR_MATCH(quirks[i].bios_vendor, bios_vendor) &&
|
||||
QUIRK_STR_MATCH(quirks[i].maker, maker) &&
|
||||
QUIRK_STR_MATCH(quirks[i].product, product))
|
||||
|
Loading…
Reference in New Issue
Block a user