From nobody Wed May 1 18:49:59 2024 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 1499963674915321.7365509102766; Thu, 13 Jul 2017 09:34:34 -0700 (PDT) Received: from localhost ([::1]:32934 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh4P-00045r-KN for importer@patchew.org; Thu, 13 Jul 2017 12:34:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42030) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh2U-0002Bb-Oj for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:32:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh2T-0003tB-0W for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:32:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60120) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh2S-0003sv-Oj; Thu, 13 Jul 2017 12:32:28 -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 9FBB8C0272CE; Thu, 13 Jul 2017 16:32:27 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 483087EA5D; Thu, 13 Jul 2017 16:32:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9FBB8C0272CE 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9FBB8C0272CE From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:31:51 +0200 Message-Id: <20170713163219.9024-2-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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.31]); Thu, 13 Jul 2017 16:32: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] [PATCH v2 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499963693965821.0938476062286; Thu, 13 Jul 2017 09:34:53 -0700 (PDT) Received: from localhost ([::1]:32936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh4j-0004dv-ID for importer@patchew.org; Thu, 13 Jul 2017 12:34:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh2f-0002MQ-H1 for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:32:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh2b-0003wm-JR for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:32:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53718) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh2b-0003wW-D8; Thu, 13 Jul 2017 12:32:37 -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 54908BF9D2; Thu, 13 Jul 2017 16:32:36 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C69D7FB65; Thu, 13 Jul 2017 16:32:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 54908BF9D2 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 54908BF9D2 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:31:52 +0200 Message-Id: <20170713163219.9024-3-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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.26]); Thu, 13 Jul 2017 16:32:36 +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] [PATCH v2 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 26136f5d29..9710f11be8 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499963695828314.3558017740087; Thu, 13 Jul 2017 09:34:55 -0700 (PDT) Received: from localhost ([::1]:32937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh4k-0004fN-Jb for importer@patchew.org; Thu, 13 Jul 2017 12:34:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh2i-0002QZ-Qo for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:32:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh2h-00041k-ST for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:32:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40658) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh2f-0003zQ-L5; Thu, 13 Jul 2017 12:32:41 -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 942AB6575F; Thu, 13 Jul 2017 16:32:40 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id DAA6F7F8CB; Thu, 13 Jul 2017 16:32:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 942AB6575F 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 942AB6575F From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:31:53 +0200 Message-Id: <20170713163219.9024-4-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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.38]); Thu, 13 Jul 2017 16:32: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] [PATCH v2 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 01278f3fc9..ad70706b99 100644 --- a/block/vhdx-log.c +++ b/block/vhdx-log.c @@ -884,7 +884,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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 14999640458540.7969159114801414; Thu, 13 Jul 2017 09:40:45 -0700 (PDT) Received: from localhost ([::1]:32984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhAQ-00025E-Qp for importer@patchew.org; Thu, 13 Jul 2017 12:40:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh2r-0002WJ-D2 for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:32:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh2q-00047g-Gy for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:32:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62094) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh2q-00047D-BA; Thu, 13 Jul 2017 12:32:52 -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 427ED80C1A; Thu, 13 Jul 2017 16:32:51 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 05C3F7EA34; Thu, 13 Jul 2017 16:32:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 427ED80C1A 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 427ED80C1A From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:31:54 +0200 Message-Id: <20170713163219.9024-5-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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, 13 Jul 2017 16:32:51 +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] [PATCH v2 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 149996388721286.06199345606058; Thu, 13 Jul 2017 09:38:07 -0700 (PDT) Received: from localhost ([::1]:32965 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh7r-0007Qa-SY for importer@patchew.org; Thu, 13 Jul 2017 12:38:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh2t-0002Yl-HE for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:32:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh2s-00048S-LG for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:32:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41688) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh2s-000488-Ev; Thu, 13 Jul 2017 12:32:54 -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 6AED67CE10; Thu, 13 Jul 2017 16:32:53 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id CCFA37EA4F; Thu, 13 Jul 2017 16:32:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6AED67CE10 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6AED67CE10 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:31:55 +0200 Message-Id: <20170713163219.9024-6-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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.28]); Thu, 13 Jul 2017 16:32:53 +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] [PATCH v2 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499963913120940.836792960421; Thu, 13 Jul 2017 09:38:33 -0700 (PDT) Received: from localhost ([::1]:32966 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh8G-0007km-QS for importer@patchew.org; Thu, 13 Jul 2017 12:38:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh39-0002mY-Q9 for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:33:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh35-0004Fe-Rt for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:33:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37190) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh35-0004FJ-LN; Thu, 13 Jul 2017 12:33:07 -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 7E9DAC08C326; Thu, 13 Jul 2017 16:33:06 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF12577EE7; Thu, 13 Jul 2017 16:32:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7E9DAC08C326 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7E9DAC08C326 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:31:56 +0200 Message-Id: <20170713163219.9024-7-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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, 13 Jul 2017 16:33: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] [PATCH v2 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499964197928121.57711616261167; Thu, 13 Jul 2017 09:43:17 -0700 (PDT) Received: from localhost ([::1]:32995 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhCt-0004Bv-Jp for importer@patchew.org; Thu, 13 Jul 2017 12:43:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh3M-00031E-8K for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:33:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh3L-0004Pj-CJ for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:33:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44136) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh3G-0004L1-2z; Thu, 13 Jul 2017 12:33:18 -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 0CDA67CE16; Thu, 13 Jul 2017 16:33:17 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id F036B7FB63; Thu, 13 Jul 2017 16:33:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0CDA67CE16 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0CDA67CE16 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:31:57 +0200 Message-Id: <20170713163219.9024-8-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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, 13 Jul 2017 16:33:17 +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] [PATCH v2 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499964343374663.1456012464437; Thu, 13 Jul 2017 09:45:43 -0700 (PDT) Received: from localhost ([::1]:33011 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhFB-0006cm-54 for importer@patchew.org; Thu, 13 Jul 2017 12:45:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh3W-0003JB-JP for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:33:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh3V-0004bA-IC for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:33:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59786) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh3S-0004YU-2j; Thu, 13 Jul 2017 12:33:30 -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 04F907D0D4; Thu, 13 Jul 2017 16:33:29 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2D5B37EA5C; Thu, 13 Jul 2017 16:33:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 04F907D0D4 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 04F907D0D4 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:31:58 +0200 Message-Id: <20170713163219.9024-9-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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, 13 Jul 2017 16:33: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] [PATCH v2 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499963886281553.8569844621825; Thu, 13 Jul 2017 09:38:06 -0700 (PDT) Received: from localhost ([::1]:32964 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh7n-0007MD-1w for importer@patchew.org; Thu, 13 Jul 2017 12:37:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh3Z-0003QN-7L for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:33:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh3Y-0004cu-93 for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:33:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58664) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh3V-0004b0-W6; Thu, 13 Jul 2017 12:33:34 -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 E34E07F406; Thu, 13 Jul 2017 16:33:32 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F5057EE6C; Thu, 13 Jul 2017 16:33:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E34E07F406 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E34E07F406 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:31:59 +0200 Message-Id: <20170713163219.9024-10-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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.25]); Thu, 13 Jul 2017 16:33: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] [PATCH v2 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 9a6f8173a5..c88dc72491 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -760,7 +760,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; @@ -813,7 +813,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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499963920395950.1649218796945; Thu, 13 Jul 2017 09:38:40 -0700 (PDT) Received: from localhost ([::1]:32967 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh8P-0007qA-6c for importer@patchew.org; Thu, 13 Jul 2017 12:38:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh3g-0003fk-GL for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:33:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh3f-0004gO-Hq for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:33:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38644) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh3c-0004eq-V4; Thu, 13 Jul 2017 12:33:41 -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 CA128C0733F5; Thu, 13 Jul 2017 16:33:39 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7ED7D7F8C9; Thu, 13 Jul 2017 16:33:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CA128C0733F5 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CA128C0733F5 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:00 +0200 Message-Id: <20170713163219.9024-11-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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, 13 Jul 2017 16:33: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] [PATCH v2 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 4fd28e1e87..c08c4fb525 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -437,7 +437,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)); @@ -2520,7 +2520,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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499964071547286.56957395150414; Thu, 13 Jul 2017 09:41:11 -0700 (PDT) Received: from localhost ([::1]:32986 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhAq-0002PP-5r for importer@patchew.org; Thu, 13 Jul 2017 12:41:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh3o-0003q7-G6 for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:33:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh3k-0004iD-Hs for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:33:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33008) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh3k-0004hl-CB; Thu, 13 Jul 2017 12:33:48 -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 5600BA0221; Thu, 13 Jul 2017 16:33:47 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 625647F8D8; Thu, 13 Jul 2017 16:33:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5600BA0221 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5600BA0221 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:01 +0200 Message-Id: <20170713163219.9024-12-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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.26]); Thu, 13 Jul 2017 16:33: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] [PATCH v2 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 9710f11be8..dcf7f8ae93 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499964120159509.1876536286869; Thu, 13 Jul 2017 09:42:00 -0700 (PDT) Received: from localhost ([::1]:32990 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhBd-00035W-1V for importer@patchew.org; Thu, 13 Jul 2017 12:41:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh3y-000466-TA for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:34:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh3u-0004uT-Vl for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:34:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40950) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh3u-0004uM-P9; Thu, 13 Jul 2017 12:33:58 -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 ACF61C013C2E; Thu, 13 Jul 2017 16:33:57 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8CE07EE6E; Thu, 13 Jul 2017 16:33:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com ACF61C013C2E 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com ACF61C013C2E From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:02 +0200 Message-Id: <20170713163219.9024-13-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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.31]); Thu, 13 Jul 2017 16:33:57 +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] [PATCH v2 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499964266312739.0413945709322; Thu, 13 Jul 2017 09:44:26 -0700 (PDT) Received: from localhost ([::1]:32998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhDz-0005R9-0z for importer@patchew.org; Thu, 13 Jul 2017 12:44:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh42-0004BI-6n for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:34:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh41-00051Z-8b for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:34:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42266) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh41-00051F-2p; Thu, 13 Jul 2017 12:34:05 -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 0F5BD5116B; Thu, 13 Jul 2017 16:34:04 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 383E27F46F; Thu, 13 Jul 2017 16:33:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0F5BD5116B Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0F5BD5116B From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:03 +0200 Message-Id: <20170713163219.9024-14-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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.39]); Thu, 13 Jul 2017 16:34:04 +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] [PATCH v2 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 80508b83f4..286295272c 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499964580979775.7864819601892; Thu, 13 Jul 2017 09:49:40 -0700 (PDT) Received: from localhost ([::1]:33028 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhJ4-0002Ms-Hl for importer@patchew.org; Thu, 13 Jul 2017 12:49:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh4B-0004VA-Bs for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:34:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh4A-0005JQ-Dx for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:34:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50950) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh4A-0005IA-8p; Thu, 13 Jul 2017 12:34:14 -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 3A1F8B66E; Thu, 13 Jul 2017 16:34:13 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F67379C7F; Thu, 13 Jul 2017 16:34:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3A1F8B66E 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3A1F8B66E From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:04 +0200 Message-Id: <20170713163219.9024-15-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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, 13 Jul 2017 16:34: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] [PATCH v2 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 0506d2c1b0..669f36f8bb 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499964225533867.7358058978932; Thu, 13 Jul 2017 09:43:45 -0700 (PDT) Received: from localhost ([::1]:32996 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhDL-0004au-BG for importer@patchew.org; Thu, 13 Jul 2017 12:43:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh4K-0004hF-1q for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:34:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh4G-0005R6-30 for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:34:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39370) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh4F-0005PX-SS; Thu, 13 Jul 2017 12:34:19 -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 CF26BBD018; Thu, 13 Jul 2017 16:34:18 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id B49917E592; Thu, 13 Jul 2017 16:34:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CF26BBD018 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CF26BBD018 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:05 +0200 Message-Id: <20170713163219.9024-16-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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, 13 Jul 2017 16:34: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] [PATCH v2 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 fa3e3ac251..bcbf307b45 100644 --- a/monitor.c +++ b/monitor.c @@ -1348,7 +1348,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': @@ -1356,7 +1356,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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499964433889263.0242329425872; Thu, 13 Jul 2017 09:47:13 -0700 (PDT) Received: from localhost ([::1]:33018 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhGh-0008I6-Ht for importer@patchew.org; Thu, 13 Jul 2017 12:47:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43074) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh4L-0004m8-Fi for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:34:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh4K-0005UJ-GJ for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:34:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45840) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh4K-0005U0-9y; Thu, 13 Jul 2017 12:34:24 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3FDABC08C324; Thu, 13 Jul 2017 16:34:23 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17C7817C40; Thu, 13 Jul 2017 16:34:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3FDABC08C324 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3FDABC08C324 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:06 +0200 Message-Id: <20170713163219.9024-17-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 13 Jul 2017 16:34: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] [PATCH v2 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499964594416714.1466943477664; Thu, 13 Jul 2017 09:49:54 -0700 (PDT) Received: from localhost ([::1]:33029 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhJH-0002a8-Vh for importer@patchew.org; Thu, 13 Jul 2017 12:49:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh4P-0004se-NU for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:34:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh4O-0005Wm-NJ for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:34:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39138) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh4O-0005WW-H5; Thu, 13 Jul 2017 12:34:28 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 68336C03349A; Thu, 13 Jul 2017 16:34:27 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0DFD17C40; Thu, 13 Jul 2017 16:34:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 68336C03349A 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 68336C03349A From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:07 +0200 Message-Id: <20170713163219.9024-18-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 13 Jul 2017 16:34: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] [PATCH v2 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, Amit Shah , qemu-trivial@nongnu.org, "Michael S. Tsirkin" , =?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: Amit Shah Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499964755606906.3367885716925; Thu, 13 Jul 2017 09:52:35 -0700 (PDT) Received: from localhost ([::1]:33053 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhLt-0004vH-Dl for importer@patchew.org; Thu, 13 Jul 2017 12:52:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh4a-000501-OJ for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:34:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh4Z-0005eD-SV for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:34:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48030) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh4Z-0005dY-MU; Thu, 13 Jul 2017 12:34:39 -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 A1230624C9; Thu, 13 Jul 2017 16:34:38 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id B780F7E476; Thu, 13 Jul 2017 16:34:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A1230624C9 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A1230624C9 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:08 +0200 Message-Id: <20170713163219.9024-19-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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.39]); Thu, 13 Jul 2017 16:34:38 +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] [PATCH v2 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 a2c1033dbe..3745b56c8e 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499964368627831.3900068537508; Thu, 13 Jul 2017 09:46:08 -0700 (PDT) Received: from localhost ([::1]:33015 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhFe-000764-8R for importer@patchew.org; Thu, 13 Jul 2017 12:46:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh4j-00056o-JH for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:34:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh4i-0005hV-Mg for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:34:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56860) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh4i-0005hG-GI; Thu, 13 Jul 2017 12:34:48 -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 6DB7E4E04A; Thu, 13 Jul 2017 16:34:47 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD1DF79C7F; Thu, 13 Jul 2017 16:34:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6DB7E4E04A 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6DB7E4E04A From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:09 +0200 Message-Id: <20170713163219.9024-20-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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, 13 Jul 2017 16: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] [PATCH v2 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499964550798837.5550996631154; Thu, 13 Jul 2017 09:49:10 -0700 (PDT) Received: from localhost ([::1]:33027 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhIb-0001kw-IX for importer@patchew.org; Thu, 13 Jul 2017 12:49:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh4s-0005EK-GM for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:34:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh4o-0005jC-Iq for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:34:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54560) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh4o-0005iz-CL; Thu, 13 Jul 2017 12:34:54 -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 5593E8046A; Thu, 13 Jul 2017 16:34:53 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id C90E27046D; Thu, 13 Jul 2017 16:34:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5593E8046A 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5593E8046A From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:10 +0200 Message-Id: <20170713163219.9024-21-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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.28]); Thu, 13 Jul 2017 16:34:53 +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] [PATCH v2 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499964741437992.0050682512142; Thu, 13 Jul 2017 09:52:21 -0700 (PDT) Received: from localhost ([::1]:33052 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhLf-0004mI-A8 for importer@patchew.org; Thu, 13 Jul 2017 12:52:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh4t-0005EO-PT for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:35:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh4s-0005ki-JM for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:34:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57086) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh4s-0005kL-DP; Thu, 13 Jul 2017 12:34:58 -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 496B919D385; Thu, 13 Jul 2017 16:34:57 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC9BC79C7C; Thu, 13 Jul 2017 16:34:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 496B919D385 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 496B919D385 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:11 +0200 Message-Id: <20170713163219.9024-22-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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.29]); Thu, 13 Jul 2017 16:34:57 +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] [PATCH v2 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499964867703677.5762040213526; Thu, 13 Jul 2017 09:54:27 -0700 (PDT) Received: from localhost ([::1]:33062 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhNi-0006MP-Hd for importer@patchew.org; Thu, 13 Jul 2017 12:54:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh4y-0005JA-5I for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:35:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh4x-0005nd-4J for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:35:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55248) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh4w-0005ms-UY; Thu, 13 Jul 2017 12:35:03 -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 9FA898553E; Thu, 13 Jul 2017 16:35:01 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id A411577EE1; Thu, 13 Jul 2017 16:34:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9FA898553E 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9FA898553E From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:12 +0200 Message-Id: <20170713163219.9024-23-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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.28]); Thu, 13 Jul 2017 16:35:02 +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] [PATCH v2 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 c0cd64d927..76f9ccde25 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -2882,7 +2882,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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499964179825838.0671831263973; Thu, 13 Jul 2017 09:42:59 -0700 (PDT) Received: from localhost ([::1]:32993 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhCb-0003vi-GE for importer@patchew.org; Thu, 13 Jul 2017 12:42:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh53-0005PL-8K for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:35:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh52-0005se-7s for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:35:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42778) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh51-0005qz-VK; Thu, 13 Jul 2017 12:35:08 -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 E7CCDC05681A; Thu, 13 Jul 2017 16:35:06 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2EF0C7A22E; Thu, 13 Jul 2017 16:35:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E7CCDC05681A 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E7CCDC05681A From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:13 +0200 Message-Id: <20170713163219.9024-24-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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.32]); Thu, 13 Jul 2017 16:35: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] [PATCH v2 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499964993763760.0295080044943; Thu, 13 Jul 2017 09:56:33 -0700 (PDT) Received: from localhost ([::1]:33077 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhPk-00080r-De for importer@patchew.org; Thu, 13 Jul 2017 12:56:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh57-0005V7-S7 for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:35:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh56-00060A-Uv for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:35:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38924) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh56-0005wh-Ot; Thu, 13 Jul 2017 12:35:12 -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 8FDA13D97C; Thu, 13 Jul 2017 16:35:11 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B38B60609; Thu, 13 Jul 2017 16:35:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8FDA13D97C 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8FDA13D97C From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:14 +0200 Message-Id: <20170713163219.9024-25-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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.30]); Thu, 13 Jul 2017 16:35:11 +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] [PATCH v2 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499964911419777.7349212916318; Thu, 13 Jul 2017 09:55:11 -0700 (PDT) Received: from localhost ([::1]:33064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhOQ-0006vi-5g for importer@patchew.org; Thu, 13 Jul 2017 12:55:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh5B-0005ak-TF for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:35:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh58-00066J-UR for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:35:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39856) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh58-00064Y-ON; Thu, 13 Jul 2017 12:35:14 -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 A23167EBDD; Thu, 13 Jul 2017 16:35:13 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 04F5567CF9; Thu, 13 Jul 2017 16:35:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A23167EBDD 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A23167EBDD From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:15 +0200 Message-Id: <20170713163219.9024-26-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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.27]); Thu, 13 Jul 2017 16: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] [PATCH v2 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499965210178512.5509865070998; Thu, 13 Jul 2017 10:00:10 -0700 (PDT) Received: from localhost ([::1]:33091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhTF-0002c7-0r for importer@patchew.org; Thu, 13 Jul 2017 13:00:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh5C-0005bI-CE for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:35:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh5B-0006Au-Ek for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:35:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50446) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh5B-00069s-65; Thu, 13 Jul 2017 12: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 DED15C08C32C; Thu, 13 Jul 2017 16:35:15 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F54267CF5; Thu, 13 Jul 2017 16:35:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DED15C08C32C 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com DED15C08C32C From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:16 +0200 Message-Id: <20170713163219.9024-27-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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, 13 Jul 2017 16: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] [PATCH v2 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499964738402515.6875767633737; Thu, 13 Jul 2017 09:52:18 -0700 (PDT) Received: from localhost ([::1]:33051 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhLc-0004kC-Hn for importer@patchew.org; Thu, 13 Jul 2017 12:52:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh5H-0005hW-KF for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:35:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh5G-0006JR-T3 for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:35:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58556) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh5G-0006HZ-NB; Thu, 13 Jul 2017 12:35:22 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A0D7565728; Thu, 13 Jul 2017 16:35:21 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8461861280; Thu, 13 Jul 2017 16:35:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A0D7565728 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A0D7565728 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:17 +0200 Message-Id: <20170713163219.9024-28-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 13 Jul 2017 16:35:21 +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] [PATCH v2 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 1499964447209458.3179400353981; Thu, 13 Jul 2017 09:47:27 -0700 (PDT) Received: from localhost ([::1]:33021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhGs-0008S8-Rd for importer@patchew.org; Thu, 13 Jul 2017 12:47:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh5L-0005lK-Ln for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:35:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh5K-0006Mf-VB for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:35:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7312) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh5K-0006M9-OO; Thu, 13 Jul 2017 12:35:26 -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 A1D077F7A9; Thu, 13 Jul 2017 16:35:25 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BDCC60466; Thu, 13 Jul 2017 16:35:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A1D077F7A9 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A1D077F7A9 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:18 +0200 Message-Id: <20170713163219.9024-29-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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.28]); Thu, 13 Jul 2017 16:35: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] [PATCH v2 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.13.1.395.gf7b71de06 From nobody Wed May 1 18:49:59 2024 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 14999646080486.8779910974267295; Thu, 13 Jul 2017 09:50:08 -0700 (PDT) Received: from localhost ([::1]:33030 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVhJW-0002kS-Tv for importer@patchew.org; Thu, 13 Jul 2017 12:50:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVh5O-0005mk-5r for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:35:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVh5N-0006Ns-7c for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:35:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44706) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVh5N-0006NO-0v; Thu, 13 Jul 2017 12:35:29 -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 D3DFF8A003; Thu, 13 Jul 2017 16:35:27 +0000 (UTC) Received: from localhost (ovpn-112-18.ams2.redhat.com [10.36.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2AF7E70475; Thu, 13 Jul 2017 16:35:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D3DFF8A003 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=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D3DFF8A003 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 18:32:19 +0200 Message-Id: <20170713163219.9024-30-marcandre.lureau@redhat.com> In-Reply-To: <20170713163219.9024-1-marcandre.lureau@redhat.com> References: <20170713163219.9024-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, 13 Jul 2017 16:35:28 +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] [PATCH v2 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.13.1.395.gf7b71de06