From owner-dev-commits-src-main@freebsd.org Tue Aug 10 21:55:28 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4604266F661; Tue, 10 Aug 2021 21:55:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GkmwJ11qsz58Sc; Tue, 10 Aug 2021 21:55:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0556623442; Tue, 10 Aug 2021 21:55:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17ALtRXP060332; Tue, 10 Aug 2021 21:55:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17ALtRfG060331; Tue, 10 Aug 2021 21:55:27 GMT (envelope-from git) Date: Tue, 10 Aug 2021 21:55:27 GMT Message-Id: <202108102155.17ALtRfG060331@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 5dedd2517db3 - main - devmatch: Ignore the pnp fields tagged as ignore ('#') MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5dedd2517db3ac1fc48e07c7daba684e5497d250 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Aug 2021 21:55:28 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5dedd2517db3ac1fc48e07c7daba684e5497d250 commit 5dedd2517db3ac1fc48e07c7daba684e5497d250 Author: Warner Losh AuthorDate: 2021-08-10 21:45:50 +0000 Commit: Warner Losh 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",