From nobody Sat Jan 11 04:03:53 2025 X-Original-To: dev-commits-src-main@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 4YVPyx6gpxz5l9kB; Sat, 11 Jan 2025 04:03:53 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVPyx5LRxz4VXW; Sat, 11 Jan 2025 04:03:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736568233; 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=rXyMkXT0C9qVs0EL8Q2cdDPh7rVrgPpduxIqTcqmA1k=; b=a7KDpq8bd0tPYBq50jMq25jmnYHnDCstrUaRgKBWGT1LxWz342FOUYeBI+OicYjFhhS6wT azx+Ik/gZe/9WywVc85ttx499OvQxK5QQrA/A1IVdZAc9HJMJ0iR7y7CTaOQ8vcJIT78eh 1fC3KjPQDyGO91UPZqBe5DwUo6RyNCpzWtHw3DRhmMwNp/7GCR2u7bVFp7lW/ed5RHCxNW dR2X6q5Ir/Gj/odyTf2pEKSQ6n85Yw7uw8JsnVRlTqYt5WVEb6Hbo6AzHkJPxlGYBYWZmb fzClTIHFLIlS8g1ar/+ADPIJqIO9zi+AQsriPoTB8R6nyNcxr2L9Z/mPABq1Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736568233; 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=rXyMkXT0C9qVs0EL8Q2cdDPh7rVrgPpduxIqTcqmA1k=; b=uXTWpIqiQQz3Wmx5nl9mmDumUiy9SAgJ/JWLNf3YtfKCBvNxAV61JfJw5qt+yBSbZTztIr j7H5mvdhZG+By/MFp5X4MiPzspmMLEaOw2Djaf/zzq0ppLNgozsnHDFfILSZUanmdNH8wX WBDE4FU4U9rux0+o/oWH6HcpBDcOmd7LNEsrGfOpAQrnOxihMBxOsg0BPRgtUGw4WF2uko V3JBzWt9cdSyrMzV8P8sKHNLZ9Ij2h7lPm8uAAGhNCGb4084r3Fpw4DE4GDvEFRsLvY79W BWTJsvycZumU0UTXDTFH2PLhqvbWPJ9y+OffjWo46EIozaGIob1pid0zD5A/tQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736568233; a=rsa-sha256; cv=none; b=EP9gl5yxQL1nDJm+n/lkTjmaRdppS5peBdje7yZq1+6AZ6rd2UJtdtwwjufRd0OL/RhceO BQJG62j4i0pIP7qW0JNUb8Vbu3SSFTXftrqyUBEofqm7lPIOu4r8h7427bbeNDJYZ6qaoh zlGdLfZI2EiOQYDRNYZRq4bQhjbz7/huVPxWEwQwPda+bCufpgcBYB5wQvROtKEq35UkxM PNzbnihzQKcfJJruXx4xI9ihv/VCDRxVqPIkCGYvVgB4zM3gkQ/R+YNPX0l9M6z5+GxH3q GRUXu1LCgz3fSAT8VGSJQsWUz81RkdtuQenkpZ2Bll0F+uo4TbLifkdKMq4M0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YVPyx4yT1zj5L; Sat, 11 Jan 2025 04:03:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B43rwn017880; Sat, 11 Jan 2025 04:03:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B43rIg017877; Sat, 11 Jan 2025 04:03:53 GMT (envelope-from git) Date: Sat, 11 Jan 2025 04:03:53 GMT Message-Id: <202501110403.50B43rIg017877@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 40d7ba087737 - main - stand/kshim: Replace devclass_equal with calls to strcmp List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40d7ba08773751ff7d0df1a3f112b32d1d04e5ec Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=40d7ba08773751ff7d0df1a3f112b32d1d04e5ec commit 40d7ba08773751ff7d0df1a3f112b32d1d04e5ec Author: John Baldwin AuthorDate: 2025-01-11 04:03:02 +0000 Commit: John Baldwin CommitDate: 2025-01-11 04:03:32 +0000 stand/kshim: Replace devclass_equal with calls to strcmp Reviewed by: imp, markj, emaste Differential Revision: https://reviews.freebsd.org/D48412 --- stand/kshim/bsd_kernel.c | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/stand/kshim/bsd_kernel.c b/stand/kshim/bsd_kernel.c index 371aaa6e96bf..91ca46e18d74 100644 --- a/stand/kshim/bsd_kernel.c +++ b/stand/kshim/bsd_kernel.c @@ -557,27 +557,6 @@ static TAILQ_HEAD(, module_data) module_head = static TAILQ_HEAD(, devclass) devclasses = TAILQ_HEAD_INITIALIZER(devclasses); -static uint8_t -devclass_equal(const char *a, const char *b) -{ - char ta, tb; - - if (a == b) - return (1); - - while (1) { - ta = *a; - tb = *b; - if (ta != tb) - return (0); - if (ta == 0) - break; - a++; - b++; - } - return (1); -} - int bus_generic_resume(device_t dev) { @@ -906,7 +885,7 @@ device_get_method(device_t dev, const char *what) mtod = dev->dev_module->driver->methods; while (mtod->func != NULL) { - if (devclass_equal(mtod->desc, what)) { + if (strcmp(mtod->desc, what) == 0) { return (mtod->func); } mtod++; @@ -959,7 +938,7 @@ device_probe_and_attach(device_t dev) bus_name_parent = device_get_name(device_get_parent(dev)); TAILQ_FOREACH(mod, &module_head, entry) { - if (!devclass_equal(mod->bus_name, bus_name_parent)) + if (strcmp(mod->bus_name, bus_name_parent) != 0) continue; dc = devclass_find(mod->mod_name); @@ -1092,7 +1071,7 @@ devclass_find(const char *classname) devclass_t dc; TAILQ_FOREACH(dc, &devclasses, link) { - if (devclass_equal(dc->name, classname)) + if (strcmp(dc->name, classname) == 0) return (dc); } return (NULL);