From nobody Sun Feb 8 09:12:33 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1680711276184910.9367863370554; Wed, 5 Apr 2023 09:14:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pk5le-0007ga-4I; Wed, 05 Apr 2023 12:13:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pk5la-0007gF-Dd; Wed, 05 Apr 2023 12:13:46 -0400 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pk5lW-0006VG-RG; Wed, 05 Apr 2023 12:13:44 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id E5577746369; Wed, 5 Apr 2023 18:12:34 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 6EF0A74633D; Wed, 5 Apr 2023 18:12:34 +0200 (CEST) From: BALATON Zoltan Date: Wed, 5 Apr 2023 17:57:19 +0200 Subject: [PATCH] hw/display/sm501: Remove unneeded increment from loop MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: Peter Maydell Message-Id: <20230405161234.6EF0A74633D@zero.eik.bme.hu> X-Spam-Probability: 8% Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1680711279205100001 Content-Type: text/plain; charset="utf-8" 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 Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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 =3D s->local_mem + dst_base; unsigned int x, y, i; - for (y =3D 0; y < height; y++, i +=3D dst_pitch * bypp) { + for (y =3D 0; y < height; y++) { i =3D (dst_x + (dst_y + y) * dst_pitch) * bypp; for (x =3D 0; x < width; x++, i +=3D bypp) { stn_he_p(&d[i], bypp, color); --=20 2.30.8