From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504175806979718.2030355919187; Thu, 31 Aug 2017 03:36:46 -0700 (PDT) Received: from localhost ([::1]:54860 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMq4-0002j8-Ok for importer@patchew.org; Thu, 31 Aug 2017 06:36:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMo6-00015O-PQ for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:34:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMo5-0005CV-LV for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:34:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56388) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMo5-0005Bw-Cz; Thu, 31 Aug 2017 06:34:41 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 46001356D4; Thu, 31 Aug 2017 10:34:40 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id C89799D5E7; Thu, 31 Aug 2017 10:34:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 46001356D4 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:04 +0200 Message-Id: <20170831103432.6007-2-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 31 Aug 2017 10:34:40 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 01/29] i386: use ROUND_UP macro X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Eduardo Habkost , qemu-trivial@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check (with the option OnlyAlignUp) to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Juan Quintela Acked-by: Eduardo Habkost Reviewed-by: Richard Henderson --- target/i386/arch_dump.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/target/i386/arch_dump.c b/target/i386/arch_dump.c index fe0aa36932..1d51bb5206 100644 --- a/target/i386/arch_dump.c +++ b/target/i386/arch_dump.c @@ -84,9 +84,9 @@ static int x86_64_write_elf64_note(WriteCoreDumpFunction = f, note->n_descsz =3D cpu_to_le32(descsz); note->n_type =3D cpu_to_le32(NT_PRSTATUS); buf =3D (char *)note; - buf +=3D ((sizeof(Elf64_Nhdr) + 3) / 4) * 4; + buf +=3D ROUND_UP(sizeof(Elf64_Nhdr), 4); memcpy(buf, name, name_size); - buf +=3D ((name_size + 3) / 4) * 4; + buf +=3D ROUND_UP(name_size, 4); memcpy(buf + 32, &id, 4); /* pr_pid */ buf +=3D descsz - sizeof(x86_64_user_regs_struct)-sizeof(target_ulong); memcpy(buf, ®s, sizeof(x86_64_user_regs_struct)); @@ -163,9 +163,9 @@ static int x86_write_elf64_note(WriteCoreDumpFunction f= , CPUX86State *env, note->n_descsz =3D cpu_to_le32(descsz); note->n_type =3D cpu_to_le32(NT_PRSTATUS); buf =3D (char *)note; - buf +=3D ((sizeof(Elf64_Nhdr) + 3) / 4) * 4; + buf +=3D ROUND_UP(sizeof(Elf64_Nhdr), 4); memcpy(buf, name, name_size); - buf +=3D ((name_size + 3) / 4) * 4; + buf +=3D ROUND_UP(name_size, 4); memcpy(buf, &prstatus, sizeof(prstatus)); =20 ret =3D f(note, note_size, opaque); @@ -218,9 +218,9 @@ int x86_cpu_write_elf32_note(WriteCoreDumpFunction f, C= PUState *cs, note->n_descsz =3D cpu_to_le32(descsz); note->n_type =3D cpu_to_le32(NT_PRSTATUS); buf =3D (char *)note; - buf +=3D ((sizeof(Elf32_Nhdr) + 3) / 4) * 4; + buf +=3D ROUND_UP(sizeof(Elf32_Nhdr), 4); memcpy(buf, name, name_size); - buf +=3D ((name_size + 3) / 4) * 4; + buf +=3D ROUND_UP(name_size, 4); memcpy(buf, &prstatus, sizeof(prstatus)); =20 ret =3D f(note, note_size, opaque); @@ -353,9 +353,9 @@ static inline int cpu_write_qemu_note(WriteCoreDumpFunc= tion f, note64->n_type =3D 0; } buf =3D note; - buf +=3D ((note_head_size + 3) / 4) * 4; + buf +=3D ROUND_UP(note_head_size, 4); memcpy(buf, name, name_size); - buf +=3D ((name_size + 3) / 4) * 4; + buf +=3D ROUND_UP(name_size, 4); memcpy(buf, &state, sizeof(state)); =20 ret =3D f(note, note_size, opaque); --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504175972241884.6561983400005; Thu, 31 Aug 2017 03:39:32 -0700 (PDT) Received: from localhost ([::1]:54873 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMsk-00051j-5R for importer@patchew.org; Thu, 31 Aug 2017 06:39:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMoB-00017z-FO for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:34:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMoA-0005FL-Lr for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:34:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52126) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMoA-0005F3-Fa; Thu, 31 Aug 2017 06:34:46 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 773D87E437; Thu, 31 Aug 2017 10:34:45 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B7C0841C7; Thu, 31 Aug 2017 10:34:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 773D87E437 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:05 +0200 Message-Id: <20170831103432.6007-3-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 31 Aug 2017 10:34:45 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 02/29] vnc: use QEMU_ALIGN_DOWN X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Richard Henderson --- ui/vnc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index 651cbb8606..2c1c0cb5ed 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -2624,8 +2624,8 @@ static int vnc_refresh_lossy_rect(VncDisplay *vd, int= x, int y) int stx =3D x / VNC_STAT_RECT; int has_dirty =3D 0; =20 - y =3D y / VNC_STAT_RECT * VNC_STAT_RECT; - x =3D x / VNC_STAT_RECT * VNC_STAT_RECT; + y =3D QEMU_ALIGN_DOWN(y, VNC_STAT_RECT); + x =3D QEMU_ALIGN_DOWN(x, VNC_STAT_RECT); =20 QTAILQ_FOREACH(vs, &vd->clients, next) { int j; @@ -2714,8 +2714,8 @@ double vnc_update_freq(VncState *vs, int x, int y, in= t w, int h) double total =3D 0; int num =3D 0; =20 - x =3D (x / VNC_STAT_RECT) * VNC_STAT_RECT; - y =3D (y / VNC_STAT_RECT) * VNC_STAT_RECT; + x =3D QEMU_ALIGN_DOWN(x, VNC_STAT_RECT); + y =3D QEMU_ALIGN_DOWN(y, VNC_STAT_RECT); =20 for (j =3D y; j <=3D y + h; j +=3D VNC_STAT_RECT) { for (i =3D x; i <=3D x + w; i +=3D VNC_STAT_RECT) { --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504176072014423.57859902630844; Thu, 31 Aug 2017 03:41:12 -0700 (PDT) Received: from localhost ([::1]:54885 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMuM-0006lB-0H for importer@patchew.org; Thu, 31 Aug 2017 06:41:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMoG-0001JJ-Vk for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:34:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMoF-0005Hv-Tg for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:34:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60708) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMoC-0005G3-Cn; Thu, 31 Aug 2017 06:34:48 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5BC5120275; Thu, 31 Aug 2017 10:34:47 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id F344A92BAA; Thu, 31 Aug 2017 10:34:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5BC5120275 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:06 +0200 Message-Id: <20170831103432.6007-4-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 31 Aug 2017 10:34:47 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 03/29] vhdx: use QEMU_ALIGN_DOWN X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , peter.maydell@linaro.org, "open list:VHDX" , qemu-trivial@nongnu.org, Jeff Cody , Max Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Eric Blake Reviewed-by: Richard Henderson --- block/vhdx-log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/vhdx-log.c b/block/vhdx-log.c index 14b724ef7b..0ac4863b25 100644 --- a/block/vhdx-log.c +++ b/block/vhdx-log.c @@ -902,7 +902,7 @@ static int vhdx_log_write(BlockDriverState *bs, BDRVVHD= XState *s, } =20 sector_offset =3D offset % VHDX_LOG_SECTOR_SIZE; - file_offset =3D (offset / VHDX_LOG_SECTOR_SIZE) * VHDX_LOG_SECTOR_SIZE; + file_offset =3D QEMU_ALIGN_DOWN(offset, VHDX_LOG_SECTOR_SIZE); =20 aligned_length =3D length; =20 --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15041760210963.9679596422178065; Thu, 31 Aug 2017 03:40:21 -0700 (PDT) Received: from localhost ([::1]:54878 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMtW-0005ks-UK for importer@patchew.org; Thu, 31 Aug 2017 06:40:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMoI-0001OB-Sv for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:34:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMoH-0005IZ-SQ for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:34:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51438) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMoH-0005II-N2; Thu, 31 Aug 2017 06:34:53 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CB4C2C058EBE; Thu, 31 Aug 2017 10:34:52 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7ED2360A98; Thu, 31 Aug 2017 10:34:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CB4C2C058EBE Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:07 +0200 Message-Id: <20170831103432.6007-5-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 31 Aug 2017 10:34:52 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 04/29] vhost: use QEMU_ALIGN_DOWN X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Michael S. Tsirkin Reviewed-by: Richard Henderson --- hw/virtio/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 6eddb099b0..0049a2c0b3 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -70,7 +70,7 @@ static void vhost_dev_sync_region(struct vhost_dev *dev, uint64_t end =3D MIN(mlast, rlast); vhost_log_chunk_t *from =3D log + start / VHOST_LOG_CHUNK; vhost_log_chunk_t *to =3D log + end / VHOST_LOG_CHUNK + 1; - uint64_t addr =3D (start / VHOST_LOG_CHUNK) * VHOST_LOG_CHUNK; + uint64_t addr =3D QEMU_ALIGN_DOWN(start, VHOST_LOG_CHUNK); =20 if (end < start) { return; --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504175825884859.4661012306514; Thu, 31 Aug 2017 03:37:05 -0700 (PDT) Received: from localhost ([::1]:54862 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMqN-00033k-M6 for importer@patchew.org; Thu, 31 Aug 2017 06:37:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMoO-0001d9-Hr for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMoN-0005L7-JK for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51612) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMoN-0005Kp-DO; Thu, 31 Aug 2017 06:34:59 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 61043C0587F2; Thu, 31 Aug 2017 10:34:58 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id D17406060D; Thu, 31 Aug 2017 10:34:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 61043C0587F2 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:08 +0200 Message-Id: <20170831103432.6007-6-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 31 Aug 2017 10:34:58 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 05/29] i8254: use QEMU_ALIGN_DOWN X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, "Michael S. Tsirkin" , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/timer/i8254_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c index 976d5200f1..ee064aa819 100644 --- a/hw/timer/i8254_common.c +++ b/hw/timer/i8254_common.c @@ -93,7 +93,7 @@ int64_t pit_get_next_transition_time(PITChannelState *s, = int64_t current_time) } break; case 2: - base =3D (d / s->count) * s->count; + base =3D QEMU_ALIGN_DOWN(d, s->count); if ((d - base) =3D=3D 0 && d !=3D 0) { next_time =3D base + s->count; } else { @@ -101,7 +101,7 @@ int64_t pit_get_next_transition_time(PITChannelState *s= , int64_t current_time) } break; case 3: - base =3D (d / s->count) * s->count; + base =3D QEMU_ALIGN_DOWN(d, s->count); period2 =3D ((s->count + 1) >> 1); if ((d - base) < period2) { next_time =3D base + period2; --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504176132033449.48827725478407; Thu, 31 Aug 2017 03:42:12 -0700 (PDT) Received: from localhost ([::1]:54894 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMvJ-0007Zm-4z for importer@patchew.org; Thu, 31 Aug 2017 06:42:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMob-0001s3-My for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMoV-0005So-VX for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40606) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMoV-0005RC-PZ; Thu, 31 Aug 2017 06:35:07 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C190A883CF; Thu, 31 Aug 2017 10:35:06 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 26ACD9D5C4; Thu, 31 Aug 2017 10:35:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C190A883CF Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:09 +0200 Message-Id: <20170831103432.6007-7-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 31 Aug 2017 10:35:06 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 06/29] pcspk: use QEMU_ALIGN_DOWN X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Richard Henderson --- hw/audio/pcspk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index f643b122bb..0206f7399b 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -69,7 +69,7 @@ static inline void generate_samples(PCSpkState *s) const uint32_t n =3D ((uint64_t)PIT_FREQ << 32) / m; =20 /* multiple of wavelength for gapless looping */ - s->samples =3D (PCSPK_BUF_LEN * PIT_FREQ / m * m / (PIT_FREQ >> 1)= + 1) >> 1; + s->samples =3D (QEMU_ALIGN_DOWN(PCSPK_BUF_LEN * PIT_FREQ, m) / (PI= T_FREQ >> 1) + 1) >> 1; for (i =3D 0; i < s->samples; ++i) s->sample_buf[i] =3D (64 & (n * i >> 25)) - 32; } else { --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504176013615481.99374962713864; Thu, 31 Aug 2017 03:40:13 -0700 (PDT) Received: from localhost ([::1]:54877 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMtP-0005cy-Hg for importer@patchew.org; Thu, 31 Aug 2017 06:40:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMoi-0001yv-1e for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMoe-0005Xs-Ty for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40780) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMoc-0005W5-Bf; Thu, 31 Aug 2017 06:35:14 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4C715883AE; Thu, 31 Aug 2017 10:35:13 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFAAA77DCE; Thu, 31 Aug 2017 10:35:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4C715883AE Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:10 +0200 Message-Id: <20170831103432.6007-8-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 31 Aug 2017 10:35:13 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 07/29] dmg: use DIV_ROUND_UP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , peter.maydell@linaro.org, "open list:dmg" , qemu-trivial@nongnu.org, Max Reitz , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson --- block/dmg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/dmg.c b/block/dmg.c index 900ae5a678..6c0711f563 100644 --- a/block/dmg.c +++ b/block/dmg.c @@ -111,7 +111,7 @@ static void update_max_chunk_size(BDRVDMGState *s, uint= 32_t chunk, uncompressed_sectors =3D s->sectorcounts[chunk]; break; case 1: /* copy */ - uncompressed_sectors =3D (s->lengths[chunk] + 511) / 512; + uncompressed_sectors =3D DIV_ROUND_UP(s->lengths[chunk], 512); break; case 2: /* zero */ /* as the all-zeroes block may be large, it is treated specially: = the --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504176325067102.842779114226; Thu, 31 Aug 2017 03:45:25 -0700 (PDT) Received: from localhost ([::1]:54914 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMyQ-0001rq-Qr for importer@patchew.org; Thu, 31 Aug 2017 06:45:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMoo-00020j-19 for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMon-0005bl-7y for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58784) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMof-0005Xy-Of; Thu, 31 Aug 2017 06:35:17 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B4FE74A6E4; Thu, 31 Aug 2017 10:35:16 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74AEC9C135; Thu, 31 Aug 2017 10:35:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B4FE74A6E4 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:11 +0200 Message-Id: <20170831103432.6007-9-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 31 Aug 2017 10:35:16 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 08/29] qcow2: use DIV_ROUND_UP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , peter.maydell@linaro.org, "open list:qcow2" , qemu-trivial@nongnu.org, Max Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Eric Blake Reviewed-by: Richard Henderson --- block/qcow2-cluster.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index f06c08f64c..30db942dde 100644 --- a/block/qcow2-cluster.c +++ b/block/qcow2-cluster.c @@ -61,7 +61,7 @@ int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t mi= n_size, new_l1_size =3D 1; } while (min_size > new_l1_size) { - new_l1_size =3D (new_l1_size * 3 + 1) / 2; + new_l1_size =3D DIV_ROUND_UP(new_l1_size * 3, 2); } } =20 --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504176492228596.4337913999996; Thu, 31 Aug 2017 03:48:12 -0700 (PDT) Received: from localhost ([::1]:54930 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnN18-0004LC-50 for importer@patchew.org; Thu, 31 Aug 2017 06:48:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMoo-00020z-8l for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMon-0005bw-AR for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38482) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMoh-0005Yr-QA; Thu, 31 Aug 2017 06:35:19 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D71DD85542; Thu, 31 Aug 2017 10:35:18 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B4E59ABBC; Thu, 31 Aug 2017 10:35:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D71DD85542 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:12 +0200 Message-Id: <20170831103432.6007-10-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 31 Aug 2017 10:35:19 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 09/29] vpc: use DIV_ROUND_UP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , peter.maydell@linaro.org, "open list:vpc" , qemu-trivial@nongnu.org, Max Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Eric Blake Reviewed-by: Richard Henderson --- block/vpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/vpc.c b/block/vpc.c index 82911ebead..1576d7b595 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -783,7 +783,7 @@ static int calculate_geometry(int64_t total_sectors, ui= nt16_t* cyls, } else { *secs_per_cyl =3D 17; cyls_times_heads =3D total_sectors / *secs_per_cyl; - *heads =3D (cyls_times_heads + 1023) / 1024; + *heads =3D DIV_ROUND_UP(cyls_times_heads, 1024); =20 if (*heads < 4) { *heads =3D 4; @@ -836,7 +836,7 @@ static int create_dynamic_disk(BlockBackend *blk, uint8= _t *buf, offset =3D 3 * 512; =20 memset(buf, 0xFF, 512); - for (i =3D 0; i < (num_bat_entries * 4 + 511) / 512; i++) { + for (i =3D 0; i < DIV_ROUND_UP(num_bat_entries * 4, 512); i++) { ret =3D blk_pwrite(blk, offset, buf, 512, 0); if (ret < 0) { goto fail; --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504176289885968.0856074345035; Thu, 31 Aug 2017 03:44:49 -0700 (PDT) Received: from localhost ([::1]:54909 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMxq-0001Hl-U1 for importer@patchew.org; Thu, 31 Aug 2017 06:44:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMor-00024E-7q for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMoo-0005cp-Dx for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41062) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMom-0005az-4z; Thu, 31 Aug 2017 06:35:24 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4210E883AC; Thu, 31 Aug 2017 10:35:23 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id ADA4F92B93; Thu, 31 Aug 2017 10:35:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4210E883AC Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:13 +0200 Message-Id: <20170831103432.6007-11-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 31 Aug 2017 10:35:23 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 10/29] vvfat: use DIV_ROUND_UP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , peter.maydell@linaro.org, "open list:vvfat" , qemu-trivial@nongnu.org, Max Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Eric Blake Reviewed-by: Richard Henderson --- block/vvfat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/vvfat.c b/block/vvfat.c index a9e207f7f0..c54fa94651 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -449,7 +449,7 @@ static direntry_t *create_long_filename(BDRVVVFATState = *s, const char *filename) return NULL; } =20 - number_of_entries =3D (length * 2 + 25) / 26; + number_of_entries =3D DIV_ROUND_UP(length * 2, 26); =20 for(i=3D0;idirectory)); @@ -2554,7 +2554,7 @@ static int commit_one_file(BDRVVVFATState* s, (size > offset && c >=3D2 && !fat_eof(s, c))); =20 ret =3D vvfat_read(s->bs, cluster2sector(s, c), - (uint8_t*)cluster, (rest_size + 0x1ff) / 0x200); + (uint8_t*)cluster, DIV_ROUND_UP(rest_size, 0x200)); =20 if (ret < 0) { qemu_close(fd); --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504176455472738.6122998620464; Thu, 31 Aug 2017 03:47:35 -0700 (PDT) Received: from localhost ([::1]:54926 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnN0X-0003rp-5S for importer@patchew.org; Thu, 31 Aug 2017 06:47:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMor-00024G-8S for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMoq-0005de-Aj for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41134) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMoq-0005dP-4M; Thu, 31 Aug 2017 06:35:28 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 31199883BF; Thu, 31 Aug 2017 10:35:27 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id A42B3841C8; Thu, 31 Aug 2017 10:35:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 31199883BF Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:14 +0200 Message-Id: <20170831103432.6007-12-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 31 Aug 2017 10:35:27 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 11/29] vnc: use DIV_ROUND_UP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Richard Henderson --- ui/vnc-enc-tight.c | 2 +- ui/vnc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c index 89ab12c0d8..f38aceb4da 100644 --- a/ui/vnc-enc-tight.c +++ b/ui/vnc-enc-tight.c @@ -979,7 +979,7 @@ static int send_mono_rect(VncState *vs, int x, int y, } #endif =20 - bytes =3D ((w + 7) / 8) * h; + bytes =3D (DIV_ROUND_UP(w, 8)) * h; =20 vnc_write_u8(vs, (stream | VNC_TIGHT_EXPLICIT_FILTER) << 4); vnc_write_u8(vs, VNC_TIGHT_FILTER_PALETTE); diff --git a/ui/vnc.c b/ui/vnc.c index 2c1c0cb5ed..fd43f9b983 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -2781,7 +2781,7 @@ static int vnc_refresh_server_surface(VncDisplay *vd) PIXMAN_FORMAT_BPP(pixman_image_get_format(vd->guest.fb)); guest_row0 =3D (uint8_t *)pixman_image_get_data(vd->guest.fb); guest_stride =3D pixman_image_get_stride(vd->guest.fb); - guest_ll =3D pixman_image_get_width(vd->guest.fb) * ((guest_bpp + = 7) / 8); + guest_ll =3D pixman_image_get_width(vd->guest.fb) * (DIV_ROUND_UP(= guest_bpp, 8)); } line_bytes =3D MIN(server_stride, guest_ll); =20 --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504176201447688.3215338912393; Thu, 31 Aug 2017 03:43:21 -0700 (PDT) Received: from localhost ([::1]:54901 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMwR-0008VY-6i for importer@patchew.org; Thu, 31 Aug 2017 06:43:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMox-0002Cu-7u for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMow-0005kA-BF for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41328) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMow-0005jN-3w; Thu, 31 Aug 2017 06:35:34 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 36819883D2; Thu, 31 Aug 2017 10:35:33 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD0149ABBC; Thu, 31 Aug 2017 10:35:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 36819883D2 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:15 +0200 Message-Id: <20170831103432.6007-13-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 31 Aug 2017 10:35:33 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 12/29] ui: use DIV_ROUND_UP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- ui/cursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/cursor.c b/ui/cursor.c index 5155b392e8..2e2fe13fa6 100644 --- a/ui/cursor.c +++ b/ui/cursor.c @@ -118,7 +118,7 @@ void cursor_put(QEMUCursor *c) =20 int cursor_get_mono_bpl(QEMUCursor *c) { - return (c->width + 7) / 8; + return DIV_ROUND_UP(c->width, 8); } =20 void cursor_set_mono(QEMUCursor *c, --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504179926609205.06841593739944; Thu, 31 Aug 2017 04:45:26 -0700 (PDT) Received: from localhost ([::1]:54948 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnN4v-0006hQ-6A for importer@patchew.org; Thu, 31 Aug 2017 06:52:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMp1-0002H6-Jg for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMp0-0005qQ-Lr for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57840) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMp0-0005oz-DC; Thu, 31 Aug 2017 06:35:38 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 65D76285A8; Thu, 31 Aug 2017 10:35:37 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id A73008B2A9; Thu, 31 Aug 2017 10:35:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 65D76285A8 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:16 +0200 Message-Id: <20170831103432.6007-14-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 31 Aug 2017 10:35:37 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 13/29] vga: use DIV_ROUND_UP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Richard Henderson --- hw/display/vga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/vga.c b/hw/display/vga.c index 63421f9ee8..3433102ef3 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -1621,7 +1621,7 @@ static void vga_draw_graphic(VGACommonState *s, int f= ull_update) s->line_compare, sr(s, VGA_SEQ_CLOCK_MODE)); #endif addr1 =3D (s->start_addr * 4); - bwidth =3D (width * bits + 7) / 8; + bwidth =3D DIV_ROUND_UP(width * bits, 8); y_start =3D -1; d =3D surface_data(surface); linesize =3D surface_stride(surface); --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504176227141356.23459154646264; Thu, 31 Aug 2017 03:43:47 -0700 (PDT) Received: from localhost ([::1]:54904 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMwp-0000Ps-Kd for importer@patchew.org; Thu, 31 Aug 2017 06:43:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMpA-0002O7-7S for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMp7-0005xe-3e for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33508) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMp6-0005wX-KQ; Thu, 31 Aug 2017 06:35:45 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B0A2E37EE9; Thu, 31 Aug 2017 10:35:43 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0223B92B93; Thu, 31 Aug 2017 10:35:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B0A2E37EE9 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:17 +0200 Message-Id: <20170831103432.6007-15-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 31 Aug 2017 10:35:43 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 14/29] virtio-gpu: use DIV_ROUND_UP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/display/virtio-gpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 6aae147324..f0761cf18b 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -408,7 +408,7 @@ static void virtio_gpu_transfer_to_host_2d(VirtIOGPU *g, } =20 format =3D pixman_image_get_format(res->image); - bpp =3D (PIXMAN_FORMAT_BPP(format) + 7) / 8; + bpp =3D DIV_ROUND_UP(PIXMAN_FORMAT_BPP(format), 8); stride =3D pixman_image_get_stride(res->image); =20 if (t2d.offset || t2d.r.x || t2d.r.y || @@ -570,7 +570,7 @@ static void virtio_gpu_set_scanout(VirtIOGPU *g, scanout =3D &g->scanout[ss.scanout_id]; =20 format =3D pixman_image_get_format(res->image); - bpp =3D (PIXMAN_FORMAT_BPP(format) + 7) / 8; + bpp =3D DIV_ROUND_UP(PIXMAN_FORMAT_BPP(format), 8); offset =3D (ss.r.x * bpp) + ss.r.y * pixman_image_get_stride(res->imag= e); if (!scanout->ds || surface_data(scanout->ds) !=3D ((uint8_t *)pixman_image_get_data(res->image) + offset) || --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504176404091895.9657306647922; Thu, 31 Aug 2017 03:46:44 -0700 (PDT) Received: from localhost ([::1]:54923 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMzh-0003Ak-Lt for importer@patchew.org; Thu, 31 Aug 2017 06:46:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMpA-0002OB-8E for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMp8-00060T-Vk for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41572) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMp8-000608-Iq; Thu, 31 Aug 2017 06:35:46 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A3776883AC; Thu, 31 Aug 2017 10:35:45 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 46AB89D5E7; Thu, 31 Aug 2017 10:35:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A3776883AC Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:18 +0200 Message-Id: <20170831103432.6007-16-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 31 Aug 2017 10:35:45 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 15/29] monitor: use DIV_ROUND_UP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, Markus Armbruster , "Dr. David Alan Gilbert" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Dr. David Alan Gilbert Reviewed-by: Richard Henderson --- monitor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index e0f880107f..135ec2de8f 100644 --- a/monitor.c +++ b/monitor.c @@ -1349,7 +1349,7 @@ static void memory_dump(Monitor *mon, int count, int = format, int wsize, =20 switch(format) { case 'o': - max_digits =3D (wsize * 8 + 2) / 3; + max_digits =3D DIV_ROUND_UP(wsize * 8, 3); break; default: case 'x': @@ -1357,7 +1357,7 @@ static void memory_dump(Monitor *mon, int count, int = format, int wsize, break; case 'u': case 'd': - max_digits =3D (wsize * 8 * 10 + 32) / 33; + max_digits =3D DIV_ROUND_UP(wsize * 8 * 10, 33); break; case 'c': wsize =3D 1; --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150418032117255.587131668308984; Thu, 31 Aug 2017 04:52:01 -0700 (PDT) Received: from localhost ([::1]:54968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnN8S-0007c4-5h for importer@patchew.org; Thu, 31 Aug 2017 06:55:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMpE-0002TC-Vu for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMpD-000693-Rj for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33680) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMpD-00066p-Az; Thu, 31 Aug 2017 06:35:51 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6CB26129A; Thu, 31 Aug 2017 10:35:50 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id BAFD593513; Thu, 31 Aug 2017 10:35:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6CB26129A Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:19 +0200 Message-Id: <20170831103432.6007-17-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 31 Aug 2017 10:35:50 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 16/29] console: use DIV_ROUND_UP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/ui/console.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ui/console.h b/include/ui/console.h index 7262bef6d3..8024878bae 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -328,7 +328,7 @@ static inline int surface_bits_per_pixel(DisplaySurface= *s) static inline int surface_bytes_per_pixel(DisplaySurface *s) { int bits =3D PIXMAN_FORMAT_BPP(s->format); - return (bits + 7) / 8; + return DIV_ROUND_UP(bits, 8); } =20 static inline pixman_format_code_t surface_format(DisplaySurface *s) --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504176690657966.4139222176626; Thu, 31 Aug 2017 03:51:30 -0700 (PDT) Received: from localhost ([::1]:54935 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnN2R-0005Iq-7J for importer@patchew.org; Thu, 31 Aug 2017 06:49:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMpJ-0002Y6-T7 for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMpI-0006Dx-TV for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:35:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45731) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMpI-0006Dj-FM; Thu, 31 Aug 2017 06:35:56 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8788D883D2; Thu, 31 Aug 2017 10:35:55 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id E846E92BAB; Thu, 31 Aug 2017 10:35:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8788D883D2 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:20 +0200 Message-Id: <20170831103432.6007-18-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 31 Aug 2017 10:35:55 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 17/29] virtio-serial: use DIV_ROUND_UP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Amit Shah , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Amit Shah --- hw/char/virtio-serial-bus.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c index f5bc173844..17a1bb008a 100644 --- a/hw/char/virtio-serial-bus.c +++ b/hw/char/virtio-serial-bus.c @@ -663,7 +663,7 @@ static void virtio_serial_save_device(VirtIODevice *vde= v, QEMUFile *f) =20 /* The ports map */ max_nr_ports =3D s->serial.max_virtserial_ports; - for (i =3D 0; i < (max_nr_ports + 31) / 32; i++) { + for (i =3D 0; i < DIV_ROUND_UP(max_nr_ports, 32); i++) { qemu_put_be32s(f, &s->ports_map[i]); } =20 @@ -798,7 +798,7 @@ static int virtio_serial_load_device(VirtIODevice *vdev= , QEMUFile *f, qemu_get_be32s(f, &tmp); =20 max_nr_ports =3D s->serial.max_virtserial_ports; - for (i =3D 0; i < (max_nr_ports + 31) / 32; i++) { + for (i =3D 0; i < DIV_ROUND_UP(max_nr_ports, 32); i++) { qemu_get_be32s(f, &ports_map); =20 if (ports_map !=3D s->ports_map[i]) { @@ -863,7 +863,7 @@ static uint32_t find_free_port_id(VirtIOSerial *vser) unsigned int i, max_nr_ports; =20 max_nr_ports =3D vser->serial.max_virtserial_ports; - for (i =3D 0; i < (max_nr_ports + 31) / 32; i++) { + for (i =3D 0; i < DIV_ROUND_UP(max_nr_ports, 32); i++) { uint32_t map, zeroes; =20 map =3D vser->ports_map[i]; @@ -1075,7 +1075,7 @@ static void virtio_serial_device_realize(DeviceState = *dev, Error **errp) vser->ovqs[i] =3D virtio_add_queue(vdev, 128, handle_output); } =20 - vser->ports_map =3D g_malloc0(((vser->serial.max_virtserial_ports + 31= ) / 32) + vser->ports_map =3D g_malloc0((DIV_ROUND_UP(vser->serial.max_virtseria= l_ports, 32)) * sizeof(vser->ports_map[0])); /* * Reserve location 0 for a console port for backward compat --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504176692708998.8562642074344; Thu, 31 Aug 2017 03:51:32 -0700 (PDT) Received: from localhost ([::1]:54946 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnN3j-0006Dd-W9 for importer@patchew.org; Thu, 31 Aug 2017 06:50:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMpS-0002dD-JM for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMpO-0006HE-Lw for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39606) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMpO-0006Gy-GJ; Thu, 31 Aug 2017 06:36:02 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8E1D585542; Thu, 31 Aug 2017 10:36:01 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id F26C19C11B; Thu, 31 Aug 2017 10:35:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8E1D585542 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:21 +0200 Message-Id: <20170831103432.6007-19-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 31 Aug 2017 10:36:01 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 18/29] piix: use DIV_ROUND_UP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/pci-host/piix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index 072a04e318..894e131c00 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -140,7 +140,7 @@ static void i440fx_update_memory_mappings(PCII440FXStat= e *d) memory_region_transaction_begin(); for (i =3D 0; i < 13; i++) { pam_update(&d->pam_regions[i], i, - pd->config[I440FX_PAM + ((i + 1) / 2)]); + pd->config[I440FX_PAM + (DIV_ROUND_UP(i, 2))]); } memory_region_set_enabled(&d->smram_region, !(pd->config[I440FX_SMRAM] & SMRAM_D_OPEN)); --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504176475564736.2494227914789; Thu, 31 Aug 2017 03:47:55 -0700 (PDT) Received: from localhost ([::1]:54927 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnN0r-000462-EB for importer@patchew.org; Thu, 31 Aug 2017 06:47:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMpa-0002lL-JY for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMpU-0006K1-Uy for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54254) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMpU-0006JY-OR; Thu, 31 Aug 2017 06:36:08 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B73B27E43E; Thu, 31 Aug 2017 10:36:07 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21A56708E1; Thu, 31 Aug 2017 10:36:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B73B27E43E Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:22 +0200 Message-Id: <20170831103432.6007-20-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 31 Aug 2017 10:36:07 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 19/29] q35: use DIV_ROUND_UP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Richard Henderson --- hw/pci-host/q35.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index 0e472f2ed4..1ff648e80c 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -315,7 +315,7 @@ static void mch_update_pam(MCHPCIState *mch) memory_region_transaction_begin(); for (i =3D 0; i < 13; i++) { pam_update(&mch->pam_regions[i], i, - pd->config[MCH_HOST_BRIDGE_PAM0 + ((i + 1) / 2)]); + pd->config[MCH_HOST_BRIDGE_PAM0 + (DIV_ROUND_UP(i, 2))]= ); } memory_region_transaction_commit(); } --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504178090050430.86414415019703; Thu, 31 Aug 2017 04:14:50 -0700 (PDT) Received: from localhost ([::1]:54959 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnN7Z-0007Ye-FH for importer@patchew.org; Thu, 31 Aug 2017 06:54:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMpY-0002iu-5L for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMpX-0006Ku-8H for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58572) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMpX-0006KZ-1j; Thu, 31 Aug 2017 06:36:11 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1ACF4C047B6F; Thu, 31 Aug 2017 10:36:10 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 730AC9ABBC; Thu, 31 Aug 2017 10:36:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1ACF4C047B6F Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:23 +0200 Message-Id: <20170831103432.6007-21-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 31 Aug 2017 10:36:10 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 20/29] usb-hub: use DIV_ROUND_UP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Richard Henderson --- hw/usb/dev-hub.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c index e82a6a6c44..752e30c305 100644 --- a/hw/usb/dev-hub.c +++ b/hw/usb/dev-hub.c @@ -109,7 +109,7 @@ static const USBDescIface desc_iface_hub =3D { { .bEndpointAddress =3D USB_DIR_IN | 0x01, .bmAttributes =3D USB_ENDPOINT_XFER_INT, - .wMaxPacketSize =3D 1 + (NUM_PORTS + 7) / 8, + .wMaxPacketSize =3D 1 + DIV_ROUND_UP(NUM_PORTS, 8), .bInterval =3D 0xff, }, } @@ -442,14 +442,14 @@ static void usb_hub_handle_control(USBDevice *dev, US= BPacket *p, data[2] =3D NUM_PORTS; =20 /* fill DeviceRemovable bits */ - limit =3D ((NUM_PORTS + 1 + 7) / 8) + 7; + limit =3D DIV_ROUND_UP(NUM_PORTS + 1, 8) + 7; for (n =3D 7; n < limit; n++) { data[n] =3D 0x00; var_hub_size++; } =20 /* fill PortPwrCtrlMask bits */ - limit =3D limit + ((NUM_PORTS + 7) / 8); + limit =3D limit + DIV_ROUND_UP(NUM_PORTS, 8); for (;n < limit; n++) { data[n] =3D 0xff; var_hub_size++; @@ -477,7 +477,7 @@ static void usb_hub_handle_data(USBDevice *dev, USBPack= et *p) unsigned int status; uint8_t buf[4]; int i, n; - n =3D (NUM_PORTS + 1 + 7) / 8; + n =3D DIV_ROUND_UP(NUM_PORTS + 1, 8); if (p->iov.size =3D=3D 1) { /* FreeBSD workaround */ n =3D 1; } else if (n > p->iov.size) { --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504180114346885.7890418246539; Thu, 31 Aug 2017 04:48:34 -0700 (PDT) Received: from localhost ([::1]:54949 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnN5s-0007Uy-UD for importer@patchew.org; Thu, 31 Aug 2017 06:53:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMpc-0002mn-3V for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMpb-0006Ms-9U for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58668) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMpb-0006MW-3Q; Thu, 31 Aug 2017 06:36:15 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2D5AFC047B61; Thu, 31 Aug 2017 10:36:14 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id C256060A98; Thu, 31 Aug 2017 10:36:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2D5AFC047B61 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:24 +0200 Message-Id: <20170831103432.6007-22-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 31 Aug 2017 10:36:14 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 21/29] msix: use DIV_ROUND_UP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, "Michael S. Tsirkin" , Marcel Apfelbaum , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/pci/msix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/pci/msix.c b/hw/pci/msix.c index 5078d3dd19..c944c02135 100644 --- a/hw/pci/msix.c +++ b/hw/pci/msix.c @@ -438,7 +438,7 @@ void msix_save(PCIDevice *dev, QEMUFile *f) } =20 qemu_put_buffer(f, dev->msix_table, n * PCI_MSIX_ENTRY_SIZE); - qemu_put_buffer(f, dev->msix_pba, (n + 7) / 8); + qemu_put_buffer(f, dev->msix_pba, DIV_ROUND_UP(n, 8)); } =20 /* Should be called after restoring the config space. */ @@ -453,7 +453,7 @@ void msix_load(PCIDevice *dev, QEMUFile *f) =20 msix_clear_all_vectors(dev); qemu_get_buffer(f, dev->msix_table, n * PCI_MSIX_ENTRY_SIZE); - qemu_get_buffer(f, dev->msix_pba, (n + 7) / 8); + qemu_get_buffer(f, dev->msix_pba, DIV_ROUND_UP(n, 8)); msix_update_function_masked(dev); =20 for (vector =3D 0; vector < n; vector++) { --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504177127504377.2574960234923; Thu, 31 Aug 2017 03:58:47 -0700 (PDT) Received: from localhost ([::1]:54983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnNBN-0000bR-Bx for importer@patchew.org; Thu, 31 Aug 2017 06:58:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMpg-0002rr-K7 for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMpf-0006Tg-JB for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54092) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMpf-0006SG-D4; Thu, 31 Aug 2017 06:36:19 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4C6E8C0587C6; Thu, 31 Aug 2017 10:36:18 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A74F77DCE; Thu, 31 Aug 2017 10:36:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4C6E8C0587C6 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:25 +0200 Message-Id: <20170831103432.6007-23-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 31 Aug 2017 10:36:18 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 22/29] ppc: use DIV_ROUND_UP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-trivial@nongnu.org, Alexander Graf , "open list:PowerPC" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: David Gibson Reviewed-by: Richard Henderson --- target/ppc/mem_helper.c | 2 +- target/ppc/translate.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/mem_helper.c b/target/ppc/mem_helper.c index e6383c6bfa..a34e604db3 100644 --- a/target/ppc/mem_helper.c +++ b/target/ppc/mem_helper.c @@ -111,7 +111,7 @@ void helper_lswx(CPUPPCState *env, target_ulong addr, u= int32_t reg, uint32_t ra, uint32_t rb) { if (likely(xer_bc !=3D 0)) { - int num_used_regs =3D (xer_bc + 3) / 4; + int num_used_regs =3D DIV_ROUND_UP(xer_bc, 4); if (unlikely((ra !=3D 0 && lsw_reg_in_range(reg, num_used_regs, ra= )) || lsw_reg_in_range(reg, num_used_regs, rb))) { raise_exception_err_ra(env, POWERPC_EXCP_PROGRAM, diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 01233e8b6d..606b605ba0 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -2880,7 +2880,7 @@ static void gen_lswi(DisasContext *ctx) } if (nb =3D=3D 0) nb =3D 32; - nr =3D (nb + 3) / 4; + nr =3D DIV_ROUND_UP(nb, 4); if (unlikely(lsw_reg_in_range(start, nr, ra))) { gen_inval_exception(ctx, POWERPC_EXCP_INVAL_LSWX); return; --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504177043909441.7659985995771; Thu, 31 Aug 2017 03:57:23 -0700 (PDT) Received: from localhost ([::1]:54978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnNA1-0007tc-OV for importer@patchew.org; Thu, 31 Aug 2017 06:57:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMpr-0002zy-6h for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMpp-0006YQ-0u for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40022) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMpo-0006XB-Ov; Thu, 31 Aug 2017 06:36:28 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 716A98047E; Thu, 31 Aug 2017 10:36:23 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0D5D60A98; Thu, 31 Aug 2017 10:36:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 716A98047E Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:26 +0200 Message-Id: <20170831103432.6007-24-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 31 Aug 2017 10:36:23 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 23/29] i386/dump: use DIV_ROUND_UP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Eduardo Habkost , qemu-trivial@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Eduardo Habkost Reviewed-by: Richard Henderson --- target/i386/arch_dump.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/target/i386/arch_dump.c b/target/i386/arch_dump.c index 1d51bb5206..e081f677fa 100644 --- a/target/i386/arch_dump.c +++ b/target/i386/arch_dump.c @@ -77,8 +77,8 @@ static int x86_64_write_elf64_note(WriteCoreDumpFunction = f, regs.gs =3D env->segs[R_GS].selector; =20 descsz =3D sizeof(x86_64_elf_prstatus); - note_size =3D ((sizeof(Elf64_Nhdr) + 3) / 4 + (name_size + 3) / 4 + - (descsz + 3) / 4) * 4; + note_size =3D (DIV_ROUND_UP(sizeof(Elf64_Nhdr), 4) + DIV_ROUND_UP(name= _size, 4) + + DIV_ROUND_UP(descsz, 4)) * 4; note =3D g_malloc0(note_size); note->n_namesz =3D cpu_to_le32(name_size); note->n_descsz =3D cpu_to_le32(descsz); @@ -156,8 +156,8 @@ static int x86_write_elf64_note(WriteCoreDumpFunction f= , CPUX86State *env, =20 x86_fill_elf_prstatus(&prstatus, env, id); descsz =3D sizeof(x86_elf_prstatus); - note_size =3D ((sizeof(Elf64_Nhdr) + 3) / 4 + (name_size + 3) / 4 + - (descsz + 3) / 4) * 4; + note_size =3D (DIV_ROUND_UP(sizeof(Elf64_Nhdr), 4) + DIV_ROUND_UP(name= _size, 4) + + DIV_ROUND_UP(descsz, 4)) * 4; note =3D g_malloc0(note_size); note->n_namesz =3D cpu_to_le32(name_size); note->n_descsz =3D cpu_to_le32(descsz); @@ -211,8 +211,8 @@ int x86_cpu_write_elf32_note(WriteCoreDumpFunction f, C= PUState *cs, =20 x86_fill_elf_prstatus(&prstatus, &cpu->env, cpuid); descsz =3D sizeof(x86_elf_prstatus); - note_size =3D ((sizeof(Elf32_Nhdr) + 3) / 4 + (name_size + 3) / 4 + - (descsz + 3) / 4) * 4; + note_size =3D (DIV_ROUND_UP(sizeof(Elf32_Nhdr), 4) + DIV_ROUND_UP(name= _size, 4) + + DIV_ROUND_UP(descsz, 4)) * 4; note =3D g_malloc0(note_size); note->n_namesz =3D cpu_to_le32(name_size); note->n_descsz =3D cpu_to_le32(descsz); @@ -338,8 +338,8 @@ static inline int cpu_write_qemu_note(WriteCoreDumpFunc= tion f, } else { note_head_size =3D sizeof(Elf64_Nhdr); } - note_size =3D ((note_head_size + 3) / 4 + (name_size + 3) / 4 + - (descsz + 3) / 4) * 4; + note_size =3D (DIV_ROUND_UP(note_head_size, 4) + DIV_ROUND_UP(name_siz= e, 4) + + DIV_ROUND_UP(descsz, 4)) * 4; note =3D g_malloc0(note_size); if (type =3D=3D 0) { note32 =3D note; @@ -443,10 +443,10 @@ ssize_t cpu_get_note_size(int class, int machine, int= nr_cpus) #endif qemu_desc_size =3D sizeof(QEMUCPUState); =20 - elf_note_size =3D ((note_head_size + 3) / 4 + (name_size + 3) / 4 + - (elf_desc_size + 3) / 4) * 4; - qemu_note_size =3D ((note_head_size + 3) / 4 + (name_size + 3) / 4 + - (qemu_desc_size + 3) / 4) * 4; + elf_note_size =3D (DIV_ROUND_UP(note_head_size, 4) + DIV_ROUND_UP(name= _size, 4) + + DIV_ROUND_UP(elf_desc_size, 4)) * 4; + qemu_note_size =3D (DIV_ROUND_UP(note_head_size, 4) + DIV_ROUND_UP(nam= e_size, 4) + + DIV_ROUND_UP(qemu_desc_size, 4)) * 4; =20 return (elf_note_size + qemu_note_size) * nr_cpus; } --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150417877922377.21704084773592; Thu, 31 Aug 2017 04:26:19 -0700 (PDT) Received: from localhost ([::1]:54957 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnN7G-0007YN-FT for importer@patchew.org; Thu, 31 Aug 2017 06:54:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMpt-00033f-OE for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMpq-0006ZG-MX for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59046) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMpq-0006Xi-H6; Thu, 31 Aug 2017 06:36:30 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3BDFAC047B68; Thu, 31 Aug 2017 10:36:25 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id D4EAD841C7; Thu, 31 Aug 2017 10:36:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3BDFAC047B68 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:27 +0200 Message-Id: <20170831103432.6007-25-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 31 Aug 2017 10:36:25 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 24/29] kvm: use DIV_ROUND_UP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Richard Henderson --- linux-headers/asm-x86/kvm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h index c2824d02ba..1930b95bcb 100644 --- a/linux-headers/asm-x86/kvm.h +++ b/linux-headers/asm-x86/kvm.h @@ -153,7 +153,7 @@ struct kvm_sregs { __u64 cr0, cr2, cr3, cr4, cr8; __u64 efer; __u64 apic_base; - __u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 63) / 64]; + __u64 interrupt_bitmap[DIV_ROUND_UP(KVM_NR_INTERRUPTS, 64)]; }; =20 /* for KVM_GET_FPU and KVM_SET_FPU */ --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504176691397690.2612779763866; Thu, 31 Aug 2017 03:51:31 -0700 (PDT) Received: from localhost ([::1]:54945 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnN3j-0006Cd-E1 for importer@patchew.org; Thu, 31 Aug 2017 06:50:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMpt-00033h-OR for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMpr-0006Zb-8W for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59250) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMpr-0006Ya-2j; Thu, 31 Aug 2017 06:36:31 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 129B6356D4; Thu, 31 Aug 2017 10:36:29 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE77C92B93; Thu, 31 Aug 2017 10:36:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 129B6356D4 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:28 +0200 Message-Id: <20170831103432.6007-26-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 31 Aug 2017 10:36:29 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 25/29] decnumber: use DIV_ROUND_UP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Richard Henderson --- libdecnumber/decNumber.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdecnumber/decNumber.c b/libdecnumber/decNumber.c index c9e7807f87..8c197023f4 100644 --- a/libdecnumber/decNumber.c +++ b/libdecnumber/decNumber.c @@ -4775,7 +4775,7 @@ static decNumber * decDivideOp(decNumber *res, half=3D*up & 0x01; *up/=3D2; /* [shift] */ if (!half) continue; - *(up-1)+=3D(DECDPUNMAX+1)/2; + *(up-1)+=3DDIV_ROUND_UP(DECDPUNMAX, 2); } /* [accunits still describes the original remainder length] */ =20 --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504177197232448.7314307186748; Thu, 31 Aug 2017 03:59:57 -0700 (PDT) Received: from localhost ([::1]:54986 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnNCV-0001Zy-6R for importer@patchew.org; Thu, 31 Aug 2017 06:59:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMpv-00035W-Dd for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMpu-0006e8-Fh for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55062) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMpu-0006d2-7V; Thu, 31 Aug 2017 06:36:34 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3E3BF80F79; Thu, 31 Aug 2017 10:36:33 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD5B177DCE; Thu, 31 Aug 2017 10:36:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3E3BF80F79 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:29 +0200 Message-Id: <20170831103432.6007-27-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 31 Aug 2017 10:36:33 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 26/29] i386: introduce ELF_NOTE_SIZE macro X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Eduardo Habkost , qemu-trivial@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Factour out a common pattern to compute the ELF note size. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Eduardo Habkost Reviewed-by: Richard Henderson --- target/i386/arch_dump.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/target/i386/arch_dump.c b/target/i386/arch_dump.c index e081f677fa..e682904052 100644 --- a/target/i386/arch_dump.c +++ b/target/i386/arch_dump.c @@ -18,6 +18,11 @@ #include "elf.h" #include "sysemu/memory_mapping.h" =20 +#define ELF_NOTE_SIZE(hdr_size, name_size, desc_size) \ + ((DIV_ROUND_UP((hdr_size), 4) \ + + DIV_ROUND_UP((name_size), 4) \ + + DIV_ROUND_UP((desc_size), 4)) * 4) + #ifdef TARGET_X86_64 typedef struct { target_ulong r15, r14, r13, r12, rbp, rbx, r11, r10; @@ -77,8 +82,7 @@ static int x86_64_write_elf64_note(WriteCoreDumpFunction = f, regs.gs =3D env->segs[R_GS].selector; =20 descsz =3D sizeof(x86_64_elf_prstatus); - note_size =3D (DIV_ROUND_UP(sizeof(Elf64_Nhdr), 4) + DIV_ROUND_UP(name= _size, 4) + - DIV_ROUND_UP(descsz, 4)) * 4; + note_size =3D ELF_NOTE_SIZE(sizeof(Elf64_Nhdr), name_size, descsz); note =3D g_malloc0(note_size); note->n_namesz =3D cpu_to_le32(name_size); note->n_descsz =3D cpu_to_le32(descsz); @@ -156,8 +160,7 @@ static int x86_write_elf64_note(WriteCoreDumpFunction f= , CPUX86State *env, =20 x86_fill_elf_prstatus(&prstatus, env, id); descsz =3D sizeof(x86_elf_prstatus); - note_size =3D (DIV_ROUND_UP(sizeof(Elf64_Nhdr), 4) + DIV_ROUND_UP(name= _size, 4) + - DIV_ROUND_UP(descsz, 4)) * 4; + note_size =3D ELF_NOTE_SIZE(sizeof(Elf64_Nhdr), name_size, descsz); note =3D g_malloc0(note_size); note->n_namesz =3D cpu_to_le32(name_size); note->n_descsz =3D cpu_to_le32(descsz); @@ -211,8 +214,7 @@ int x86_cpu_write_elf32_note(WriteCoreDumpFunction f, C= PUState *cs, =20 x86_fill_elf_prstatus(&prstatus, &cpu->env, cpuid); descsz =3D sizeof(x86_elf_prstatus); - note_size =3D (DIV_ROUND_UP(sizeof(Elf32_Nhdr), 4) + DIV_ROUND_UP(name= _size, 4) + - DIV_ROUND_UP(descsz, 4)) * 4; + note_size =3D ELF_NOTE_SIZE(sizeof(Elf32_Nhdr), name_size, descsz); note =3D g_malloc0(note_size); note->n_namesz =3D cpu_to_le32(name_size); note->n_descsz =3D cpu_to_le32(descsz); @@ -443,10 +445,8 @@ ssize_t cpu_get_note_size(int class, int machine, int = nr_cpus) #endif qemu_desc_size =3D sizeof(QEMUCPUState); =20 - elf_note_size =3D (DIV_ROUND_UP(note_head_size, 4) + DIV_ROUND_UP(name= _size, 4) + - DIV_ROUND_UP(elf_desc_size, 4)) * 4; - qemu_note_size =3D (DIV_ROUND_UP(note_head_size, 4) + DIV_ROUND_UP(nam= e_size, 4) + - DIV_ROUND_UP(qemu_desc_size, 4)) * 4; + elf_note_size =3D ELF_NOTE_SIZE(note_head_size, name_size, elf_desc_si= ze); + qemu_note_size =3D ELF_NOTE_SIZE(note_head_size, name_size, qemu_desc_= size); =20 return (elf_note_size + qemu_note_size) * nr_cpus; } --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504177491932467.3451540541895; Thu, 31 Aug 2017 04:04:51 -0700 (PDT) Received: from localhost ([::1]:55016 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnNHG-0005hQ-1H for importer@patchew.org; Thu, 31 Aug 2017 07:04:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMq6-0003E1-Fk for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMq1-0006iT-1l for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42990) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMq0-0006i8-S9; Thu, 31 Aug 2017 06:36:40 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CE5E2883BF; Thu, 31 Aug 2017 10:36:39 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id CCC2A92D27; Thu, 31 Aug 2017 10:36:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CE5E2883BF Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:30 +0200 Message-Id: <20170831103432.6007-28-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 31 Aug 2017 10:36:40 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 27/29] i386: replace g_malloc()+memcpy() with g_memdup() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Eduardo Habkost , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I found these pattern via grepping the source tree. I don't have a coccinelle script for it! Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Eduardo Habkost Reviewed-by: Richard Henderson --- hw/i386/multiboot.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c index f13e23139b..6001f4caa2 100644 --- a/hw/i386/multiboot.c +++ b/hw/i386/multiboot.c @@ -352,8 +352,7 @@ int load_multiboot(FWCfgState *fw_cfg, mb_debug(" mb_mods_count =3D %d\n", mbs.mb_mods_count); =20 /* save bootinfo off the stack */ - mb_bootinfo_data =3D g_malloc(sizeof(bootinfo)); - memcpy(mb_bootinfo_data, bootinfo, sizeof(bootinfo)); + mb_bootinfo_data =3D g_memdup(bootinfo, sizeof(bootinfo)); =20 /* Pass variables to option rom */ fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_ENTRY, mh_entry_addr); --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504177346847357.05324578564534; Thu, 31 Aug 2017 04:02:26 -0700 (PDT) Received: from localhost ([::1]:55005 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnNEu-0003kT-CL for importer@patchew.org; Thu, 31 Aug 2017 07:02:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMq4-0003Bo-3Y for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMq3-0006kA-7h for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38627) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMq3-0006iq-2E; Thu, 31 Aug 2017 06:36:43 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0C42D7E437; Thu, 31 Aug 2017 10:36:42 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8406D92BAA; Thu, 31 Aug 2017 10:36:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0C42D7E437 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:31 +0200 Message-Id: <20170831103432.6007-29-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 31 Aug 2017 10:36:42 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 28/29] test-iov: replace g_malloc()+memcpy() with g_memdup() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I found these pattern via grepping the source tree. I don't have a coccinelle script for it! Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- tests/test-iov.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test-iov.c b/tests/test-iov.c index a22d71fd2c..fa3d75aee1 100644 --- a/tests/test-iov.c +++ b/tests/test-iov.c @@ -167,8 +167,7 @@ static void test_io(void) } iov_from_buf(iov, niov, 0, buf, sz); =20 - siov =3D g_malloc(sizeof(*iov) * niov); - memcpy(siov, iov, sizeof(*iov) * niov); + siov =3D g_memdup(iov, sizeof(*iov) * niov); =20 if (socketpair(PF_UNIX, SOCK_STREAM, 0, sv) < 0) { perror("socketpair"); --=20 2.14.1.146.gd35faa819 From nobody Wed Nov 5 05:42:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504177381028717.3647587916353; Thu, 31 Aug 2017 04:03:01 -0700 (PDT) Received: from localhost ([::1]:55007 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnNFT-0004Bl-10 for importer@patchew.org; Thu, 31 Aug 2017 07:02:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnMq5-0003Db-W6 for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnMq5-0006kp-4z for qemu-devel@nongnu.org; Thu, 31 Aug 2017 06:36:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59600) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnMq4-0006kc-V3; Thu, 31 Aug 2017 06:36:45 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0F044285A8; Thu, 31 Aug 2017 10:36:44 +0000 (UTC) Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id A6BDD8B2A9; Thu, 31 Aug 2017 10:36:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0F044285A8 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 31 Aug 2017 12:34:32 +0200 Message-Id: <20170831103432.6007-30-marcandre.lureau@redhat.com> In-Reply-To: <20170831103432.6007-1-marcandre.lureau@redhat.com> References: <20170831103432.6007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 31 Aug 2017 10:36:44 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 29/29] eepro100: replace g_malloc()+memcpy() with g_memdup() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, Jason Wang , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" I found these pattern via grepping the source tree. I don't have a coccinelle script for it! Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Stefan Weil Reviewed-by: Jason Wang Reviewed-by: Richard Henderson --- hw/net/eepro100.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index 5a4774aab4..a7b9f77519 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -1904,8 +1904,7 @@ static void e100_nic_realize(PCIDevice *pci_dev, Erro= r **errp) =20 qemu_register_reset(nic_reset, s); =20 - s->vmstate =3D g_malloc(sizeof(vmstate_eepro100)); - memcpy(s->vmstate, &vmstate_eepro100, sizeof(vmstate_eepro100)); + s->vmstate =3D g_memdup(&vmstate_eepro100, sizeof(vmstate_eepro100)); s->vmstate->name =3D qemu_get_queue(s->nic)->model; vmstate_register(&pci_dev->qdev, -1, s->vmstate, s); } --=20 2.14.1.146.gd35faa819