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

@@ -250,9 +250,9 @@ ems_readb(uint32_t addr, void *priv)
uint8_t ret = 0xff;
/* Grab the data. */
ret = *(uint8_t *) (dev->ems[((addr & 0xffff) >> 14)].addr + (addr & 0x3fff));
ret = *(uint8_t *) (dev->ems[(addr & 0xffff) >> 14].addr + (addr & 0x3fff));
return (ret);
return ret;
}
/* Read one word from paged RAM. */
@@ -263,9 +263,9 @@ ems_readw(uint32_t addr, void *priv)
uint16_t ret = 0xffff;
/* Grab the data. */
ret = *(uint16_t *) (dev->ems[((addr & 0xffff) >> 14)].addr + (addr & 0x3fff));
ret = *(uint16_t *) (dev->ems[(addr & 0xffff) >> 14].addr + (addr & 0x3fff));
return (ret);
return ret;
}
/* Write one byte to paged RAM. */
@@ -275,7 +275,7 @@ ems_writeb(uint32_t addr, uint8_t val, void *priv)
neat_t *dev = (neat_t *) priv;
/* Write the data. */
*(uint8_t *) (dev->ems[((addr & 0xffff) >> 14)].addr + (addr & 0x3fff)) = val;
*(uint8_t *) (dev->ems[(addr & 0xffff) >> 14].addr + (addr & 0x3fff)) = val;
}
/* Write one word to paged RAM. */
@@ -285,7 +285,7 @@ ems_writew(uint32_t addr, uint16_t val, void *priv)
neat_t *dev = (neat_t *) priv;
/* Write the data. */
*(uint16_t *) (dev->ems[((addr & 0xffff) >> 14)].addr + (addr & 0x3fff)) = val;
*(uint16_t *) (dev->ems[(addr & 0xffff) >> 14].addr + (addr & 0x3fff)) = val;
}
/* Re-calculate the active-page physical address. */
@@ -365,7 +365,7 @@ ems_read(uint16_t port, void *priv)
neat_log("NEAT: ems_read(%04x) = %02x\n", port, ret);
#endif
return (ret);
return ret;
}
/* Initialize the EMS module. */
@@ -435,9 +435,10 @@ ems_init(neat_t *dev, int en)
static void
neat_write(uint16_t port, uint8_t val, void *priv)
{
neat_t *dev = (neat_t *) priv;
uint8_t xval, *reg;
int i;
neat_t *dev = (neat_t *) priv;
uint8_t xval;
uint8_t *reg;
int i;
#if NEAT_DEBUG > 2
neat_log("NEAT: write(%04x, %02x)\n", port, val);
@@ -647,7 +648,7 @@ neat_read(uint16_t port, void *priv)
neat_log("NEAT: read(%04x) = %02x\n", port, ret);
#endif
return (ret);
return ret;
}
static void