qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/display/sm501: Remove unneeded increment from loop


From: Daniel Henrique Barboza
Subject: Re: [PATCH] hw/display/sm501: Remove unneeded increment from loop
Date: Thu, 13 Apr 2023 18:26:20 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1



On 4/5/23 12:57, BALATON Zoltan wrote:
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>
---

Queued in gitlab.com/danielhb/qemu/tree/ppc-next. I'll send it out as soon
as 8.1 dev window opens up.

Thanks,

Daniel

  hw/display/sm501.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index dbabbc4339..0eecd00701 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);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]