devmatch: Ignore the pnp fields tagged as ignore ('#')

When matching entries, we should ignore those with a name of '#'. It's
the standard way to skip elements and need to be present to have the
proper offsets to the fields that are observed. No bus has a pnp
attribute of '#' and that is now disallowed for future buses that are
written.

Sponsored by:		Netflix
Reviewed by:		kbowling
Differential Revision:	https://reviews.freebsd.org/D31482
This commit is contained in:
Warner Losh 2021-08-10 15:45:50 -06:00
parent c7bb0f47f7
commit 5dedd2517d

View File

@ -313,6 +313,13 @@ search_hints(const char *bus, const char *dev, const char *pnpinfo)
}
if (bit >= 0 && ((1 << bit) & mask) == 0)
break;
if (strcmp(cp + 2, "#") == 0) {
if (verbose_flag) {
printf("Ignoring %s (%c) table=%#x tomatch=%#x\n",
cp + 2, *cp, v, ival);
}
break;
}
v = pnpval_as_int(cp + 2, pnpinfo);
if (verbose_flag)
printf("Matching %s (%c) table=%#x tomatch=%#x\n",
@ -351,6 +358,13 @@ search_hints(const char *bus, const char *dev, const char *pnpinfo)
break;
if (bit >= 0 && ((1 << bit) & mask) == 0)
break;
if (strcmp(cp + 2, "#") == 0) {
if (verbose_flag) {
printf("Ignoring %s (%c) table=%#x tomatch=%#x\n",
cp + 2, *cp, v, ival);
}
break;
}
s = pnpval_as_str(cp + 2, pnpinfo);
if (verbose_flag)
printf("Matching %s (%c) table=%s tomatch=%s\n",