Date: Tue, 10 Aug 2021 21:55:27 GMT From: Warner Losh <imp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 5dedd2517db3 - main - devmatch: Ignore the pnp fields tagged as ignore ('#') Message-ID: <202108102155.17ALtRfG060331@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5dedd2517db3ac1fc48e07c7daba684e5497d250 commit 5dedd2517db3ac1fc48e07c7daba684e5497d250 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2021-08-10 21:45:50 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2021-08-10 21:47:55 +0000 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 --- sbin/devmatch/devmatch.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sbin/devmatch/devmatch.c b/sbin/devmatch/devmatch.c index c1ed11f6e41f..fbb05222fa5e 100644 --- a/sbin/devmatch/devmatch.c +++ b/sbin/devmatch/devmatch.c @@ -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",
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108102155.17ALtRfG060331>