From nobody Tue Aug 27 18:07:18 2024 X-Original-To: dev-commits-src-branches@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 4Wtb9M1H3Hz52YqK; Tue, 27 Aug 2024 18:07:19 +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 4Wtb9L5zFBz4Zps; Tue, 27 Aug 2024 18:07:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724782038; 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=9uArt6MNtGWi3Qkoazz384YSt+VoDFiq6IQxkbQ5AH0=; b=lAXg9NXFy9eR73dN2OIaUFzJr9CvwSF7m7m6kJ3qeO/xqG6DTpNObioVMMYatW3TdwDd8k stVWtNqSm1C35/3pSL331i+z7W/HuNVsjHkLnKfG+b4D8WXC9clCuSadB2qduKAf3cc4UW 2YBAvikDCozduYtn2u42+bX7CLWSMY4xSZpDrevtjVANU7r+3uU2FU6BCQt7crztqWgpwn nXXf/oZQ2m4D0aFyvgSJwAMx4uEjS4Ne3CpdTMkdsjPNUtDjU+16VdnMuq8/gSpexOfTiH i5SU//hfjwaK6cbCNkUX3eJxmaBSuDJmwvplaQ6D5Ahz4ydVpuoKLhbKqXk8qw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724782038; a=rsa-sha256; cv=none; b=q2hYIqA4TrM6tZSwkYxkv1XlXECaF6dQtK8T4VBwd8sMpoRMZPvADvBPSzbWJi25b13GMT gHjTP7aoJqIWW5CdlDWCbQpcPhVmj5ltP8n9DeQVuf2GCttfiR3l5C6x2wbTO7/q+Vm4OB NL0WgApmcK2MT9t7Q/stL+6MN7bHVvqw7I61P5EfBW2o/DHQ/nGqXJeRdkdE3z3tKh9Dbg yiT7esmAJWpvFfgph71/HDB1PsWaOfT0CCS7z1we4NpRlwV6BnDCAgdZSsGAgfywRdi6/x WKjIejW4LraYbh65JjiMrqSInrKueKDukdUIFLyM/4x65IvA2JhzWFFChBNQeg== 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=1724782038; 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=9uArt6MNtGWi3Qkoazz384YSt+VoDFiq6IQxkbQ5AH0=; b=X415El7jcAtx6Z4iZq4zAgAXGw999Aux9txGBZZCpZRaAUg8tj6cQKjd1lRWEFjPVbEV2r 68W811LlqDSyJZ3seP7fKpaQ5DFqrmxM2i5/XWFEDaShd5pmSgAxEoKnjjYgs+SjfPTa8R 6hgjeirHshQxVLE33U2rXe571lxXz2jCe+cgOF4JmmhOXyp4q2E2WASCcxZX76fKQ2YvsS 9EyVqxHJY5lIedV6byK/tQxowsiNFZstL/LhLvN3tLZ5roLnlV6KVmBZXE+mPb7ghK79ki QMxp/jsh/gvG3Yu9piDx0r+maOhQ9yoMYCzWbk745r7p5XxPXs8zEAcKKB6ETg== 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 4Wtb9L5Wz6z111Y; Tue, 27 Aug 2024 18:07:18 +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 47RI7Id0094199; Tue, 27 Aug 2024 18:07:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RI7IUK094194; Tue, 27 Aug 2024 18:07:18 GMT (envelope-from git) Date: Tue, 27 Aug 2024 18:07:18 GMT Message-Id: <202408271807.47RI7IUK094194@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: b2a3826e9d59 - stable/14 - ctld: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: b2a3826e9d59d5662126986f43b942307b9f52f5 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b2a3826e9d59d5662126986f43b942307b9f52f5 commit b2a3826e9d59d5662126986f43b942307b9f52f5 Author: Elyes Haouas AuthorDate: 2023-11-07 17:11:34 +0000 Commit: John Baldwin CommitDate: 2024-08-27 16:35:34 +0000 ctld: 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 8f65dcd6276bf139a2fe87c1bbeffcc1fed015e4) --- usr.sbin/ctld/kernel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/ctld/kernel.c b/usr.sbin/ctld/kernel.c index cbb8e2c25f5d..ec46a9b765a8 100644 --- a/usr.sbin/ctld/kernel.c +++ b/usr.sbin/ctld/kernel.c @@ -169,7 +169,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]))) log_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) @@ -291,7 +291,7 @@ cctl_start_pelement(void *user_data, const char *name, const char **attr) if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0]))) log_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)