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>
This commit is contained in:
Elyes Haouas 2023-11-07 18:11:56 +01:00 committed by Warner Losh
parent 8f65dcd627
commit 338d9c35d5
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}