From nobody Mon Apr 29 04:27:25 2024 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 4VSVfk2L97z5JBvQ; Mon, 29 Apr 2024 04:27:26 +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 4VSVfj34SBz417w; Mon, 29 Apr 2024 04:27:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364845; 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=+zbHBsd2/fVftsu6m+A/6c3nube3vJv3wjNBaLL0byA=; b=gx7w1N5sFo+7cTjAy477rFCRZVe8rmEzCW+VltWRA8IQwBQ4Nvx21cv1wKeo0Oo6XjDqA4 hwVYgMEUPpY18cOL/7VmgofBo4Im5PxK3vmCFsOEO/reXVw1qpNWNCkrIKy3u78kMIONTU vecEkCGeCDU2EgG8w/oG6P1IQaa4u32FCD2197igmloW4rWQfmuA9c68CyKGo67NpbHgwB PU4x4paFpgPPD8wHVtukPnL2PGWirRleTWtp28Uptjclw7RksWt5fjvqDeikO3THLvP3Rk f4EWPkdfEbOZEyS3U+ZcDvy07btpDlD0KW1cIOzdd1jqv2mG4ITDr8YqN+Hc5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364845; a=rsa-sha256; cv=none; b=JLKyEL4PjKTFKxvLW0uUTx6flOds2TyNy1J/oYxxRMcXAdIkxMNVKf8tB5M08/p3kFrCdK 9ercVifjYk0lZkce+4CBwpL6vlBI2njJpDd8KZtBfti9rrqfUmRzce0B4J6bzUr0IkNaoh SOeevO40+C0vuxKphh/CyIwvjejERBFDpx6sO8EZu0Gcb2Ab1iZQsaT7oQ6h7eB7cGTz1s LxJtKPWbrJQ8Idlg68xW5ZhCV5FsfLyxQ6naOuP3LttcY3kLimPHOaXenq/5AwaRh//wnI vwWkuDSP0vp0+znkuAmTfPuMZSvaU6OzUEoZaQMPplIpNzAh/wTECGTzRljO2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364845; 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=+zbHBsd2/fVftsu6m+A/6c3nube3vJv3wjNBaLL0byA=; b=jhR3lNVP28CYzdQl5oUwju8iAoAj4RVBNm1MHmpsUMLGHVmR1ZWRaGpM6aQHbTirJFoA2v miE6ShymUC8K86Z+jHSqU49l7524nPBSwCnUoa/UgOr5i4vnY3aFjnSY06M2qgOTchUm11 oauaRMXB7522ALCTvRL085AU8x0qqvPaEpt2Hr60RkXh1L4MNQLFTQKjtSLQfiUL0xf2IV 7COdqbJcEzcKeCPd7T6F5cQywHhVI/M31nxJb4CeZjN5CMdJNzT/ZlFRpZW6NDBU/G5+DS 8QcTgcbZHHBkoH2aQ7Z9bl3dhXSDEN/wSGfppzYXc/Wbx0sQAW72BXfBV14fWA== 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 4VSVfj2H8GzvGf; Mon, 29 Apr 2024 04:27:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4RPcE045008; Mon, 29 Apr 2024 04:27:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RPMW045005; Mon, 29 Apr 2024 04:27:25 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:25 GMT Message-Id: <202404290427.43T4RPMW045005@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: abab59f662b3 - main - usbconfig: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: abab59f662b380f5ad46de03f9818f8c1f5ca0c4 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=abab59f662b380f5ad46de03f9818f8c1f5ca0c4 commit abab59f662b380f5ad46de03f9818f8c1f5ca0c4 Author: Elyes Haouas AuthorDate: 2023-11-07 17:14:17 +0000 Commit: Warner Losh CommitDate: 2024-04-29 03:30:55 +0000 usbconfig: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- usr.sbin/usbconfig/usbconfig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/usbconfig/usbconfig.c b/usr.sbin/usbconfig/usbconfig.c index 7d257fea52cd..e28f8de9f75c 100644 --- a/usr.sbin/usbconfig/usbconfig.c +++ b/usr.sbin/usbconfig/usbconfig.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include @@ -210,7 +210,7 @@ get_token(const char *str, uint8_t narg) { uint8_t n; - for (n = 0; n != (sizeof(token) / sizeof(token[0])); n++) { + for (n = 0; n != nitems(token); n++) { if (strcasecmp(str, token[n].name) == 0) { if (token[n].narg > narg) { /* too few arguments */