From 0da06c2818b11ea7b2c513aa2b7e2e785b77dbdb Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 24 Nov 2025 17:31:34 -0600 Subject: [PATCH] bsps/i386/pc386/console/keyboard.c: Address type-limits warnings These changes were made to address GCC -Wtype-limits warnings. In this case, the array index was an unsigned char and the array being indexed had 256 entries. There was no way for the index to be an invalid index. --- bsps/i386/pc386/console/keyboard.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bsps/i386/pc386/console/keyboard.c b/bsps/i386/pc386/console/keyboard.c index c831688885..7eed56c802 100644 --- a/bsps/i386/pc386/console/keyboard.c +++ b/bsps/i386/pc386/console/keyboard.c @@ -577,11 +577,11 @@ static void do_fn(unsigned char value, char up_flag) if (up_flag) return; - if (value < SIZE(func_table)) { - if (func_table[value]) - puts_queue(func_table[value]); - } else - printk( "do_fn called with value=%d\n", value); + /* + * No need to range check value because the array has 256 entries. + */ + if (func_table[value]) + puts_queue(func_table[value]); } static void do_pad(unsigned char value, char up_flag)