From nobody Mon Jun 27 20:46:10 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AF9C787B6C6; Mon, 27 Jun 2022 20:46:10 +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 4LX0BB4P43z4TPC; Mon, 27 Jun 2022 20:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656362770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eOiF1GwJBv9qeN1sePttj32zxwUN/1yrRLAUhsaXxxs=; b=Htm17BmI7/iE+nO5Nn1PrOF5QtxPkclNEpjKe+fwQwJdZshiFFKowgtnsBi6Qmkj8EfjMd kfmA0yJGK4QyUNv/XdWP6dWX/bctALAhWafnMtAW25UsOiwiV5UV9qoxhNpw7NcazWDVAW 8lZ9BY91Kgzj5A2/tqP27XQu9xXmVXFlwaQ+mvPHDePrFCv9D+IiZpg4Zr6Ea7DhghgVRC 5RDDq56jwOZWgQp8JQxy2EX5Jemfx0IguDDWYeBuQzBtsAcs8HUh1mNjoZsq11uSYSJbC7 AcUatsTsI+v5kvOyT3i9a73HaZBDX7hYXuhmk4Ye1ua51pK5j8o4TFuMvoIBuw== 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 779D974E1; Mon, 27 Jun 2022 20:46:10 +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 25RKkAhE015617; Mon, 27 Jun 2022 20:46:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25RKkAQi015616; Mon, 27 Jun 2022 20:46:10 GMT (envelope-from git) Date: Mon, 27 Jun 2022 20:46:10 GMT Message-Id: <202206272046.25RKkAQi015616@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: e6ba4cda739c - main - devmatch: Properly ignore commented fields List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org 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: e6ba4cda739c555e341460a5d3279890206c9b3c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656362770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eOiF1GwJBv9qeN1sePttj32zxwUN/1yrRLAUhsaXxxs=; b=x4aJ4zGliYVFSvbCz4Lx4/nBBmD4SVhn/KqLF966HikCv9p2Gc+CECSAaKBErYoNLf9UN0 ng4PtR1/Icx6xtZ6h8TKQ8N0Pt8sqt6WOf0DtHS95scdriFEn65kycGNm4wUlkW/y8BVYU QQvnS/UJzvBh2Kb9G+GhmXoQbExZR36qgtUn7+iSslKM0umHKUihJT122r9J7DtqszdR/w /4ztDCN5DONCaWO3QoTxTHFU+Z1QYikR1A+GHBjyK0Gv8Kq4gzmridE5bBnkrxY1GJXknZ Uk3YSnzAFjDmvMj/qW2oRDK31IvGIPLQnbd+yvGHI+5k5wi5DobQI98ckxzJxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656362770; a=rsa-sha256; cv=none; b=Q7yRYY2JIGNssaoqbPRSayve18YSwX3KK+8zOTpq0mMdQjjm4Ij1byPIIZVCv4/gCzd/Lt LpfW1/ZUh/lUU+I+c3gzaPhooyzT3dJMKvDtGN1/Knab+ly8CmzPZ4YwkdoP7+ENzVN8vE zZwF4AeHM4NiS8f7BbOD7J3KCkFdLlFUhU9FQTyuN8cwfgKTWnr07xqa9ra1G6zGF0HTwx RApYixR68Bi0qnk2Q8bQUenuImmASnhQ7K2IoPmy81mZyebf2R6aSz5AcFgtnLVgvONvbQ OfhYAcVx+WOEou8ogjiImEEgHk5uAdgkR1tvHFAXEFBxmJt3x1gK9fl18/F/Wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e6ba4cda739c555e341460a5d3279890206c9b3c commit e6ba4cda739c555e341460a5d3279890206c9b3c Author: Greg V AuthorDate: 2022-06-27 20:41:59 +0000 Commit: Warner Losh CommitDate: 2022-06-27 20:44:23 +0000 devmatch: Properly ignore commented fields Any field that starts with # is a commented out field (there as a place holder only, the data in that place holder is completely ignored). The previous code improperly detected this using strcmp. Instead, any field whose names starts with '#' is ignored. Differential Reivsion: https://reviews.freebsd.org/D34633 --- sbin/devmatch/devmatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/devmatch/devmatch.c b/sbin/devmatch/devmatch.c index fbb05222fa5e..20a57353ecf6 100644 --- a/sbin/devmatch/devmatch.c +++ b/sbin/devmatch/devmatch.c @@ -313,7 +313,7 @@ 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 (cp[2] == '#') { if (verbose_flag) { printf("Ignoring %s (%c) table=%#x tomatch=%#x\n", cp + 2, *cp, v, ival); @@ -358,7 +358,7 @@ 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 (cp[2] == '#') { if (verbose_flag) { printf("Ignoring %s (%c) table=%#x tomatch=%#x\n", cp + 2, *cp, v, ival);