From nobody Tue Aug 27 18:07:19 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 4Wtb9N2cBzz52ZLT; Tue, 27 Aug 2024 18:07:20 +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 4Wtb9M6yyDz4ZkC; Tue, 27 Aug 2024 18:07:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782040; 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=xJupswGXPDZMyUo7skMGIvwfYqMz1go5rY7LtMHuWvA=; b=oLEc0wZ6wkRc+w2P1+aKVTMcdxVx7yY0JlqNO1zVUPcceQTF0IcRb2Ftacq3O9Wn2O3Q3Y SA9OkkdiRV44uxYWzG90iSUXyFq3odCObegYmpD/LSiN+vUjwFL/zpG6L6zoms8fE60P2I +IGMQ0HLHlknDcLqwjzRUDzMqCYC/Ql3n4IdoOvgFEGxOmOE742fWnBGadcHm1YKpqaRVQ pwUlArYxZM79UjUj/k5gAja3ObI2WRySAdiUUUXhB5Z09FZlhhu30tdbcx4BTH97Z06dNL piensGnzin/Ll66TBQ0qFpHP40KYwcZouDWpAvbNv5czx/40/e8cvk5A34BdsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782040; a=rsa-sha256; cv=none; b=DNRTzVxUz40+xtSlEh46Ddxdg4ajQe06Lv5EpBgmzz2KEaOziGPJUSFH4fZeY6rtEvBCCH 8pEuOyELm/5OOqBwQDa/5DZCo3msBdCKkjIUgSJOMTjsOebodoKszT8tlxw7mMe3k3lcim JQ8A+BkPgcQzJr5dAeFbBU99eKXKsTJuM0ibh8DR1qfkZx1mAjPDTt0Zb433vo+5Jm8Tm8 DDb1hx/Sg7RYqa6QQ0pc+teMqNlHlqCX0zkGGp9Ns4VjvdPhALJ5vY9DZbWbXVvAFlIJM8 0zzfSfAAiozSLushlGqPYCwmK8ln5wZ5PAoNqtMc/2sxZIPVU6PdtgvL+3ukxw== 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=1724782040; 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=xJupswGXPDZMyUo7skMGIvwfYqMz1go5rY7LtMHuWvA=; b=xoRCYHH30TueAr2owV5PNYrZfNzd8k1WLcsR49rsZZsWWNnxf8n8wBObIUUUlI36whcVdc ah8vyza67UCZElCP/bbphzaxIbdLI8KCNNbnxWK254q9t0gkNzdZN0Um+PKj9ucxNKwgCn qb5FZBoD4514SeUSZlufsAesvtAXVA4TrYcWjNl46JcC+eJXooEO+Vu+26QL0iGHE6F+J/ Glwm/KwpBrrPfZ4Jze7KxIJKqhaG83BSIJ37VpItfUpAt3ZpRpncXUMDfl/TiSKSYob6sq FCNrB2ZL1Aw+h7KKHE9EO/2MYfP8X/jgabwCakwIy35tQGGo0mFsJ4cAdEsmqA== 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 4Wtb9M6YSgz115y; Tue, 27 Aug 2024 18:07:19 +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 47RI7Jj4094268; Tue, 27 Aug 2024 18:07:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7JG3094265; Tue, 27 Aug 2024 18:07:19 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:19 GMT Message-Id: <202408271807.47RI7JG3094265@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 9f01ac2f7d6b - stable/14 - ctladm: 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9f01ac2f7d6b7dbe2301183b25181eb8b4284cf4 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9f01ac2f7d6b7dbe2301183b25181eb8b4284cf4 commit 9f01ac2f7d6b7dbe2301183b25181eb8b4284cf4 Author: Elyes Haouas AuthorDate: 2023-11-07 17:11:10 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 ctladm: 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 (cherry picked from commit 2f8ea2f605acbeadb3c2fe9d336fcf558f2d4fa6) --- usr.sbin/ctladm/ctladm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c index 228af7bae8c6..f06e70322708 100644 --- a/usr.sbin/ctladm/ctladm.c +++ b/usr.sbin/ctladm/ctladm.c @@ -2810,7 +2810,7 @@ cctl_islist_start_element(void *user_data, const char *name, const char **attr) if ((u_int)islist->level >= (sizeof(islist->cur_sb) / sizeof(islist->cur_sb[0]))) errx(1, "%s: too many nesting levels, %zd max", __func__, - sizeof(islist->cur_sb) / sizeof(islist->cur_sb[0])); + nitems(islist->cur_sb)); islist->cur_sb[islist->level] = sbuf_new_auto(); if (islist->cur_sb[islist->level] == NULL) @@ -3241,7 +3241,7 @@ cctl_start_element(void *user_data, const char *name, const char **attr) if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0]))) errx(1, "%s: too many nesting levels, %zd max", __func__, - sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0])); + nitems(devlist->cur_sb)); devlist->cur_sb[devlist->level] = sbuf_new_auto(); if (devlist->cur_sb[devlist->level] == NULL) @@ -3505,7 +3505,7 @@ cctl_start_pelement(void *user_data, const char *name, const char **attr) if ((u_int)portlist->level >= (sizeof(portlist->cur_sb) / sizeof(portlist->cur_sb[0]))) errx(1, "%s: too many nesting levels, %zd max", __func__, - sizeof(portlist->cur_sb) / sizeof(portlist->cur_sb[0])); + nitems(portlist->cur_sb)); portlist->cur_sb[portlist->level] = sbuf_new_auto(); if (portlist->cur_sb[portlist->level] == NULL)