aboutsummaryrefslogtreecommitdiff
path: root/hw/display
diff options
context:
space:
mode:
authorBALATON Zoltan <balaton@eik.bme.hu>2023-04-05 17:57:19 +0200
committerDaniel Henrique Barboza <danielhb413@gmail.com>2023-05-05 12:34:22 -0300
commit1b336bb63e6fa6e3bc343b19725e09a55adc17b1 (patch)
tree0a2d178dd2ceac12cfd591599e2c471c02a115d6 /hw/display
parenta9fe9e191b4305b88c356a1ed9ac3baf89eb18aa (diff)
downloadqemu-1b336bb63e6fa6e3bc343b19725e09a55adc17b1.zip
qemu-1b336bb63e6fa6e3bc343b19725e09a55adc17b1.tar.gz
qemu-1b336bb63e6fa6e3bc343b19725e09a55adc17b1.tar.bz2
hw/display/sm501: Remove unneeded increment from loop
As Coverity points out (CID 1508621) the calculation to increment i in the fill fallback loop is ineffective as it is overwritten in next statement. This was left there by mistake from a previous version but is not needed in the current approach so remove the superfluous increment statement. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230405161234.6EF0A74633D@zero.eik.bme.hu> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Diffstat (limited to 'hw/display')
-rw-r--r--hw/display/sm501.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index dbabbc4..0eecd00 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -901,7 +901,7 @@ static void sm501_2d_operation(SM501State *s)
/* fallback when pixman failed or we don't want to call it */
uint8_t *d = s->local_mem + dst_base;
unsigned int x, y, i;
- for (y = 0; y < height; y++, i += dst_pitch * bypp) {
+ for (y = 0; y < height; y++) {
i = (dst_x + (dst_y + y) * dst_pitch) * bypp;
for (x = 0; x < width; x++, i += bypp) {
stn_he_p(&d[i], bypp, color);