From patchwork Tue Feb 28 06:44:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 94603 Delivered-To: patch@linaro.org Received: by 10.140.20.113 with SMTP id 104csp1197836qgi; Mon, 27 Feb 2017 23:06:12 -0800 (PST) X-Received: by 10.200.1.142 with SMTP id x14mr1038460qtf.170.1488265572065; Mon, 27 Feb 2017 23:06:12 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id p17si830182qtb.158.2017.02.27.23.06.11 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 27 Feb 2017 23:06:12 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:59066 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cibrN-00079p-Ra for patch@linaro.org; Tue, 28 Feb 2017 02:06:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47526) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cibpX-0006EU-Px for qemu-devel@nongnu.org; Tue, 28 Feb 2017 02:04:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cibpU-0000Or-OC for qemu-devel@nongnu.org; Tue, 28 Feb 2017 02:04:15 -0500 Received: from isrv.corpit.ru ([86.62.121.231]:43761) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cibpU-0000Od-HA; Tue, 28 Feb 2017 02:04:12 -0500 Received: from tsrv.tls.msk.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 33B584358C; Tue, 28 Feb 2017 10:04:12 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.tls.msk.ru (Postfix) with SMTP id 829653D5; Tue, 28 Feb 2017 09:45:01 +0300 (MSK) Received: (nullmailer pid 19619 invoked by uid 1000); Tue, 28 Feb 2017 06:44:59 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Tue, 28 Feb 2017 09:44:45 +0300 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 02/14] softfloat: Use correct type in float64_to_uint64_round_to_zero() 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 , Michael Tokarev Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell In float64_to_uint64_round_to_zero() a typo meant that we were taking the uint64_t return value from float64_to_uint64() and putting it into an int64_t variable before returning it as uint64_t again. Use uint64_t instead of pointlessly casting it back and forth to int64_t. Signed-off-by: Peter Maydell Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Michael Tokarev --- fpu/softfloat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.1.4 diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 485a006..7af14e2 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -7492,7 +7492,7 @@ uint64_t float64_to_uint64_round_to_zero(float64 a, float_status *status) { signed char current_rounding_mode = status->float_rounding_mode; set_float_rounding_mode(float_round_to_zero, status); - int64_t v = float64_to_uint64(a, status); + uint64_t v = float64_to_uint64(a, status); set_float_rounding_mode(current_rounding_mode, status); return v; } From patchwork Tue Feb 28 06:44:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 94602 Delivered-To: patch@linaro.org Received: by 10.140.20.113 with SMTP id 104csp1194924qgi; Mon, 27 Feb 2017 22:56:37 -0800 (PST) X-Received: by 10.55.191.69 with SMTP id p66mr863755qkf.84.1488264997298; Mon, 27 Feb 2017 22:56:37 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f19si818076qki.109.2017.02.27.22.56.36 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 27 Feb 2017 22:56:37 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:59007 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cibi7-0008NL-18 for patch@linaro.org; Tue, 28 Feb 2017 01:56:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cibfq-00079b-T7 for qemu-devel@nongnu.org; Tue, 28 Feb 2017 01:54:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cibfn-0005sr-Qk for qemu-devel@nongnu.org; Tue, 28 Feb 2017 01:54:14 -0500 Received: from isrv.corpit.ru ([86.62.121.231]:37841) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cibfn-0005sV-IW; Tue, 28 Feb 2017 01:54:11 -0500 Received: from tsrv.tls.msk.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 8219A43567; Tue, 28 Feb 2017 09:54:10 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.tls.msk.ru (Postfix) with SMTP id D1D563DE; Tue, 28 Feb 2017 09:45:01 +0300 (MSK) Received: (nullmailer pid 19625 invoked by uid 1000); Tue, 28 Feb 2017 06:44:59 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Tue, 28 Feb 2017 09:44:48 +0300 Message-Id: <25ac5bbec43973e9b97a454e55fd307ef9db1320.1488264243.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 05/14] CODING_STYLE: Mention preferred comment form 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 , Michael Tokarev Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Our defacto coding style strongly prefers /* */ style comments over the single-line // style, and checkpatch enforces this, but we don't actually document this. Mention it in CODING_STYLE. Suggested-by: Thomas Huth Signed-off-by: Peter Maydell Reviewed-by: Markus Armbruster Reviewed-by: Fam Zheng Reviewed-by: Laurent Vivier Reviewed-by: Stefan Hajnoczi Signed-off-by: Michael Tokarev --- CODING_STYLE | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.1.4 diff --git a/CODING_STYLE b/CODING_STYLE index f53180b..2fa0c0b 100644 --- a/CODING_STYLE +++ b/CODING_STYLE @@ -116,3 +116,10 @@ if (a == 1) { Rationale: Yoda conditions (as in 'if (1 == a)') are awkward to read. Besides, good compilers already warn users when '==' is mis-typed as '=', even when the constant is on the right. + +7. Comment style + +We use traditional C-style /* */ comments and avoid // comments. + +Rationale: The // form is valid in C99, so this is purely a matter of +consistency of style. The checkpatch script will warn you about this. From patchwork Tue Feb 28 06:44:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 94604 Delivered-To: patch@linaro.org Received: by 10.140.20.113 with SMTP id 104csp1198721qgi; Mon, 27 Feb 2017 23:09:04 -0800 (PST) X-Received: by 10.200.54.178 with SMTP id a47mr1026177qtc.132.1488265744098; Mon, 27 Feb 2017 23:09:04 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r58si846430qtb.43.2017.02.27.23.09.03 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 27 Feb 2017 23:09:04 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:59082 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cibu9-0001CQ-TB for patch@linaro.org; Tue, 28 Feb 2017 02:09:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47525) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cibpX-0006ES-Pf for qemu-devel@nongnu.org; Tue, 28 Feb 2017 02:04:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cibpU-0000Ow-Nw for qemu-devel@nongnu.org; Tue, 28 Feb 2017 02:04:15 -0500 Received: from isrv.corpit.ru ([86.62.121.231]:40398) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cibpU-0000Oa-Gx; Tue, 28 Feb 2017 02:04:12 -0500 Received: from tsrv.tls.msk.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id ADF0C43578; Tue, 28 Feb 2017 10:04:11 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.tls.msk.ru (Postfix) with SMTP id 2C9003D3; Tue, 28 Feb 2017 09:45:01 +0300 (MSK) Received: (nullmailer pid 19639 invoked by uid 1000); Tue, 28 Feb 2017 06:44:59 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Tue, 28 Feb 2017 09:44:55 +0300 Message-Id: <3d74ee7dcae57b93a64737b954d76cf96236a367.1488264243.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 12/14] lm32: milkymist-tmu2: fix a third integer overflow 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 , Michael Tokarev Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Don't truncate the multiplication and do a 64 bit one instead because the result is stored in a 64 bit variable. This fixes a similar coverity warning to commits 237a8650d640 and 4382fa655498, in a similar way, and is the final third of the fix for coverity CID 1167561 (hopefully!). Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Acked-by: Michael Walle Signed-off-by: Michael Tokarev --- hw/display/milkymist-tmu2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.1.4 diff --git a/hw/display/milkymist-tmu2.c b/hw/display/milkymist-tmu2.c index 7528665..59120dd 100644 --- a/hw/display/milkymist-tmu2.c +++ b/hw/display/milkymist-tmu2.c @@ -293,7 +293,7 @@ static void tmu2_start(MilkymistTMU2State *s) cpu_physical_memory_unmap(mesh, mesh_len, 0, mesh_len); /* Write back the OpenGL framebuffer to the QEMU framebuffer */ - fb_len = 2 * s->regs[R_DSTHRES] * s->regs[R_DSTVRES]; + fb_len = 2ULL * s->regs[R_DSTHRES] * s->regs[R_DSTVRES]; fb = cpu_physical_memory_map(s->regs[R_DSTFBUF], &fb_len, 1); if (fb == NULL) { glDeleteTextures(1, &texture);