Yet more sonarlint fixes
This commit is contained in:
@@ -176,7 +176,8 @@ static uint8_t ide_qua_pnp_rom[] = {
|
||||
};
|
||||
|
||||
ide_t *ide_drives[IDE_NUM];
|
||||
int ide_ter_enabled = 0, ide_qua_enabled = 0;
|
||||
int ide_ter_enabled = 0;
|
||||
int ide_qua_enabled = 0;
|
||||
|
||||
static void ide_atapi_callback(ide_t *ide);
|
||||
static void ide_callback(void *priv);
|
||||
@@ -389,9 +390,9 @@ ide_irq_update(ide_t *ide)
|
||||
void
|
||||
ide_padstr(char *str, const char *src, int len)
|
||||
{
|
||||
int i, v;
|
||||
int v;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (*src != '\0')
|
||||
v = *src++;
|
||||
else
|
||||
@@ -412,9 +413,7 @@ ide_padstr(char *str, const char *src, int len)
|
||||
void
|
||||
ide_padstr8(uint8_t *buf, int buf_size, const char *src)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < buf_size; i++) {
|
||||
for (int i = 0; i < buf_size; i++) {
|
||||
if (*src != '\0')
|
||||
buf[i] = *src++;
|
||||
else
|
||||
@@ -488,7 +487,9 @@ ide_hd_identify(ide_t *ide)
|
||||
{
|
||||
char device_identify[9] = { '8', '6', 'B', '_', 'H', 'D', '0', '0', 0 };
|
||||
|
||||
uint32_t d_hpc, d_spt, d_tracks;
|
||||
uint32_t d_hpc;
|
||||
uint32_t d_spt;
|
||||
uint32_t d_tracks;
|
||||
uint64_t full_size = (((uint64_t) hdd[ide->hdd_num].tracks) * hdd[ide->hdd_num].hpc * hdd[ide->hdd_num].spt);
|
||||
|
||||
device_identify[6] = (ide->hdd_num / 10) + 0x30;
|
||||
@@ -577,7 +578,12 @@ ide_hd_identify(ide_t *ide)
|
||||
static void
|
||||
ide_identify(ide_t *ide)
|
||||
{
|
||||
int d, i, max_pio, max_sdma, max_mdma, max_udma;
|
||||
int d;
|
||||
int i;
|
||||
int max_pio;
|
||||
int max_sdma;
|
||||
int max_mdma;
|
||||
int max_udma;
|
||||
ide_t *ide_other = ide_drives[ide->channel ^ 1];
|
||||
|
||||
ide_log("IDE IDENTIFY or IDENTIFY PACKET DEVICE on board %i (channel %i)\n", ide->board, ide->channel);
|
||||
@@ -674,7 +680,8 @@ ide_identify(ide_t *ide)
|
||||
static off64_t
|
||||
ide_get_sector(ide_t *ide)
|
||||
{
|
||||
uint32_t heads, sectors;
|
||||
uint32_t heads;
|
||||
uint32_t sectors;
|
||||
|
||||
if (ide->lba)
|
||||
return (off64_t) ide->lba_addr;
|
||||
@@ -749,8 +756,11 @@ ide_set_signature(ide_t *ide)
|
||||
static int
|
||||
ide_set_features(ide_t *ide)
|
||||
{
|
||||
uint8_t features, features_data;
|
||||
int mode, submode, max;
|
||||
uint8_t features;
|
||||
uint8_t features_data;
|
||||
int mode;
|
||||
int submode;
|
||||
int max;
|
||||
|
||||
features = ide->cylprecomp;
|
||||
features_data = ide->secount;
|
||||
@@ -836,7 +846,8 @@ ide_set_features(ide_t *ide)
|
||||
void
|
||||
ide_set_sector(ide_t *ide, int64_t sector_num)
|
||||
{
|
||||
unsigned int cyl, r;
|
||||
unsigned int cyl;
|
||||
unsigned int r;
|
||||
if (ide->lba) {
|
||||
ide->head = (sector_num >> 24);
|
||||
ide->cylinder = (sector_num >> 8);
|
||||
@@ -942,7 +953,8 @@ ide_atapi_command_bus(ide_t *ide)
|
||||
static void
|
||||
ide_atapi_callback(ide_t *ide)
|
||||
{
|
||||
int out, ret = 0;
|
||||
int out;
|
||||
int ret = 0;
|
||||
|
||||
switch (ide->sc->packet_status) {
|
||||
case PHASE_IDLE:
|
||||
@@ -1326,7 +1338,8 @@ ide_write_devctl(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
ide_board_t *dev = (ide_board_t *) priv;
|
||||
|
||||
ide_t *ide, *ide_other;
|
||||
ide_t *ide;
|
||||
ide_t *ide_other;
|
||||
int ch;
|
||||
uint8_t old;
|
||||
|
||||
@@ -1428,7 +1441,8 @@ ide_writeb(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
ide_board_t *dev = (ide_board_t *) priv;
|
||||
|
||||
ide_t *ide, *ide_other;
|
||||
ide_t *ide;
|
||||
ide_t *ide_other;
|
||||
int ch;
|
||||
|
||||
ch = dev->cur_dev;
|
||||
@@ -1913,7 +1927,8 @@ ide_readb(uint16_t addr, void *priv)
|
||||
{
|
||||
ide_board_t *dev = (ide_board_t *) priv;
|
||||
|
||||
int ch, absent = 0;
|
||||
int ch;
|
||||
int absent = 0;
|
||||
ide_t *ide;
|
||||
|
||||
ch = dev->cur_dev;
|
||||
@@ -2170,7 +2185,8 @@ atapi_error_no_ready(ide_t *ide)
|
||||
static void
|
||||
ide_callback(void *priv)
|
||||
{
|
||||
int snum, ret = 0;
|
||||
int snum;
|
||||
int ret = 0;
|
||||
|
||||
ide_t *ide = (ide_t *) priv;
|
||||
|
||||
@@ -2580,8 +2596,10 @@ id_not_found:
|
||||
uint8_t
|
||||
ide_read_ali_75(void)
|
||||
{
|
||||
ide_t *ide0, *ide1;
|
||||
int ch0, ch1;
|
||||
ide_t *ide0;
|
||||
ide_t *ide1;
|
||||
int ch0;
|
||||
int ch1;
|
||||
uint8_t ret = 0x00;
|
||||
|
||||
ch0 = ide_boards[0]->cur_dev;
|
||||
@@ -2604,8 +2622,10 @@ ide_read_ali_75(void)
|
||||
uint8_t
|
||||
ide_read_ali_76(void)
|
||||
{
|
||||
ide_t *ide0, *ide1;
|
||||
int ch0, ch1;
|
||||
ide_t *ide0;
|
||||
ide_t *ide1;
|
||||
int ch0;
|
||||
int ch1;
|
||||
uint8_t ret = 0x00;
|
||||
|
||||
ch0 = ide_boards[0]->cur_dev;
|
||||
@@ -2743,7 +2763,7 @@ static void
|
||||
ide_board_close(int board)
|
||||
{
|
||||
ide_t *dev;
|
||||
int c, d;
|
||||
int c;
|
||||
|
||||
ide_log("ide_board_close(%i)\n", board);
|
||||
|
||||
@@ -2757,7 +2777,7 @@ ide_board_close(int board)
|
||||
ide_clear_bus_master(board);
|
||||
|
||||
/* Close hard disk image files (if previously open) */
|
||||
for (d = 0; d < 2; d++) {
|
||||
for (uint8_t d = 0; d < 2; d++) {
|
||||
c = (board << 1) + d;
|
||||
|
||||
ide_boards[board]->ide[d] = NULL;
|
||||
@@ -2797,9 +2817,13 @@ static void
|
||||
ide_board_setup(int board)
|
||||
{
|
||||
ide_t *dev;
|
||||
int c, d;
|
||||
int ch, is_ide, valid_ch;
|
||||
int min_ch, max_ch;
|
||||
int c;
|
||||
int d;
|
||||
int ch;
|
||||
int is_ide;
|
||||
int valid_ch;
|
||||
int min_ch;
|
||||
int max_ch;
|
||||
|
||||
min_ch = (board << 1);
|
||||
max_ch = min_ch + 1;
|
||||
@@ -3015,7 +3039,7 @@ ide_init(const device_t *info)
|
||||
break;
|
||||
}
|
||||
|
||||
return (ide_drives);
|
||||
return ide_drives;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3047,7 +3071,8 @@ ide_drive_reset(int d)
|
||||
static void
|
||||
ide_board_reset(int board)
|
||||
{
|
||||
int d, min, max;
|
||||
int min;
|
||||
int max;
|
||||
|
||||
ide_log("Resetting IDE board %i...\n", board);
|
||||
|
||||
@@ -3056,7 +3081,7 @@ ide_board_reset(int board)
|
||||
min = (board << 1);
|
||||
max = min + 2;
|
||||
|
||||
for (d = min; d < max; d++)
|
||||
for (int d = min; d < max; d++)
|
||||
ide_drive_reset(d);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user