Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Apr 2024 04:27:18 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 338d9c35d55d - main - kbdcontrol: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Message-ID:  <202404290427.43T4RI8i044723@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=338d9c35d55dd69c02d2d7d887ee658eaa667bac

commit 338d9c35d55dd69c02d2d7d887ee658eaa667bac
Author:     Elyes Haouas <ehaouas@noos.fr>
AuthorDate: 2023-11-07 17:11:56 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-04-29 03:24:47 +0000

    kbdcontrol: 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 <ehaouas@noos.fr>
---
 usr.sbin/kbdcontrol/kbdcontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c
index e55165fd0888..4e27febe2164 100644
--- a/usr.sbin/kbdcontrol/kbdcontrol.c
+++ b/usr.sbin/kbdcontrol/kbdcontrol.c
@@ -1117,7 +1117,7 @@ get_kbd_type_name(int type)
 	};
 	unsigned int i;
 
-	for (i = 0; i < sizeof(name_table)/sizeof(name_table[0]); ++i) {
+	for (i = 0; i < nitems(name_table); ++i) {
 		if (type == name_table[i].type)
 			return name_table[i].name;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202404290427.43T4RI8i044723>