Some code smell fixes from sonarlint

This commit is contained in:
Jasmine Iwanek
2023-05-11 03:02:36 -04:00
parent d314255362
commit 6c1e4a8e2c
137 changed files with 3354 additions and 2900 deletions

View File

@@ -509,9 +509,7 @@ keyboard_at_set_scancode_set(void)
static void
add_data_vals(atkbc_dev_t *dev, uint8_t *val, uint8_t len)
{
int i;
for (i = 0; i < len; i++)
for (uint8_t i = 0; i < len; i++)
kbc_at_dev_queue_add(dev, val[i], 1);
}
@@ -520,7 +518,8 @@ add_data_kbd(uint16_t val)
{
atkbc_dev_t *dev = SavedKbd;
uint8_t fake_shift[4];
uint8_t num_lock = 0, shift_states = 0;
uint8_t num_lock = 0;
uint8_t shift_states = 0;
keyboard_get_states(NULL, &num_lock, NULL);
shift_states = keyboard_get_shift() & STATE_SHIFT_MASK;
@@ -722,7 +721,7 @@ static void
keyboard_at_write(void *priv)
{
atkbc_dev_t *dev = (atkbc_dev_t *) priv;
uint8_t i, val;
uint8_t val;
if (dev->port == NULL)
return;
@@ -826,7 +825,7 @@ keyboard_at_write(void *priv)
/* TODO: After keyboard type selection is implemented, make this
return the correct keyboard ID for the selected type. */
kbc_at_dev_queue_add(dev, 0xfa, 0);
for (i = 0; i < 4; i++) {
for (uint8_t i = 0; i < 4; i++) {
if (id_bytes[dev->type][i] == 0)
break;
@@ -973,7 +972,7 @@ keyboard_at_init(const device_t *info)
inv_cmd_response = (dev->type & FLAG_PS2) ? 0xfe : 0xfa;
/* Return our private data to the I/O layer. */
return (dev);
return dev;
}
static void