From nobody Mon Apr 29 04:27:16 2024 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 4VSVfX6Zm0z5JBgS; Mon, 29 Apr 2024 04:27:16 +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 4VSVfX4FRbz416j; Mon, 29 Apr 2024 04:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364836; 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=5YW42YWWig4rUEcciHUSi9cD9i3W56Icb+zZMYU56l4=; b=mPGMdju0WmzLUE6tOo3fM32gzbHPWLmXObv1JqsmUB8VvuqFlSz8my/+icgVhaeT2y+CWc 0s4gOemSf/jkwRLOmbNIW3EJPLuIiiMcaEJt8d1aR3013msm1vHUTk/b/Y+TdR4KSadL+w N1BD1dsjGtG7DzZrKMypWlt0fe5jphOF81j/MZqLf3IvjOVy9LFL0XM93TIkLUdQrQyS6/ Li1imLDLaqN7CrVuwozwtJsRWjj621bmVPgcLymND/iUA++sRZdUjc9XUBkbge/wmj+L90 bc/g/3gellvKcZNk/Tjv1qtEqhDsAaNNZsf18dW17R2U0MEUPpcuF6oLlFLmqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364836; a=rsa-sha256; cv=none; b=FLYuTxDTc/x22pEwHTcvcYiwykMKnx0pVJQJci0nsHGPRrh+26bCHw1vn7alDhEDUiAVkT +Poxtam/2bGqZtdjlF/6WFzE+yO/c7oKRrklkfrnDoIL3q3J6JV4Iq8R65ptEkJBQs6H5h 4ss2rhxcgVD8NolachzAkNlIFF5A/4anwOKWTrK6BYVDU2/Q9TQShGn77I/Qzl0B4RcDji QWhDYHDPAgLvJ1Lcjs1PAsr0k0RazAVVG0c8MsfLygh1GK2+3NUS6id8mnoSXqTwfHPx+o YECK2k6Ku+svNBpIS/wAkpUBEzJLC7tsOU97R5cXmpEC3nIXr7pYoObMduliRg== 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=1714364836; 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=5YW42YWWig4rUEcciHUSi9cD9i3W56Icb+zZMYU56l4=; b=MJ0LXNkoFoifOHNzt6MrumCfIlm0W2bFPhr072/FmInLPhZetPNpneFEThE3KeDS6zuoz6 Fhi6OLx+tyLVVgQ9Qe/4BK4gdDpHbI4NE23pcrmYE6px+z5qNKs8TXcOHWbgBodYLaqRda CnPJDMwHga2KTM9GnXAhIAhjxZ28yqj635QPLuRoJj7YN64K0WRfakIv+nkBIRsqsR/jWB raVK6VRPnsAlZDfiI1IZkrBp+3sUtZBkdc4EXOteEcrKcSoSCM9ACFqqKKWIJ1Z9fgHLZI 1Q8EiaiLS2nJ39pRdJtnmqVTBQlZNTPHuKVva2U788d07ZsM7h1kwHQa8BVRDQ== 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 4VSVfX35FSzv30; Mon, 29 Apr 2024 04:27:16 +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 43T4RGFr044628; Mon, 29 Apr 2024 04:27:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RGWj044625; Mon, 29 Apr 2024 04:27:16 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:16 GMT Message-Id: <202404290427.43T4RGWj044625@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: 2f8ea2f605ac - main - ctladm: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2f8ea2f605acbeadb3c2fe9d336fcf558f2d4fa6 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2f8ea2f605acbeadb3c2fe9d336fcf558f2d4fa6 commit 2f8ea2f605acbeadb3c2fe9d336fcf558f2d4fa6 Author: Elyes Haouas AuthorDate: 2023-11-07 17:11:10 +0000 Commit: Warner Losh CommitDate: 2024-04-29 03:24:47 +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 --- 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 9d2f14de28ed..81b8d3196357 100644 --- a/usr.sbin/ctladm/ctladm.c +++ b/usr.sbin/ctladm/ctladm.c @@ -2809,7 +2809,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) @@ -3240,7 +3240,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) @@ -3504,7 +3504,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)