From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaPHw-00011W-A6 for qemu-devel@nongnu.org; Mon, 29 Feb 2016 09:59:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaPHt-0002nh-1r for qemu-devel@nongnu.org; Mon, 29 Feb 2016 09:59:08 -0500 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:34723) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaPHs-0002nI-Nj for qemu-devel@nongnu.org; Mon, 29 Feb 2016 09:59:04 -0500 Received: by mail-wm0-x229.google.com with SMTP id p65so72368483wmp.1 for ; Mon, 29 Feb 2016 06:59:04 -0800 (PST) Sender: Paolo Bonzini References: <1456749628-2776-1-git-send-email-martin.galvan@tallertechnologies.com> From: Paolo Bonzini Message-ID: <56D45CB4.1080600@redhat.com> Date: Mon, 29 Feb 2016 15:59:00 +0100 MIME-Version: 1.0 In-Reply-To: <1456749628-2776-1-git-send-email-martin.galvan@tallertechnologies.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PING][PATCH] Use unsigned types for the 'len' argument of all memory read/write functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Martin Galvan , qemu-devel@nongnu.org, peter.maydell@linaro.org, aurelio.remonda@tallertechnologies.com, daniel.gutson@tallertechnologies.com On 29/02/2016 13:40, Martin Galvan wrote: > When looking at address_space_read_continue I noticed the 'len' variable was > a signed int, while it clearly should be a hwaddr or some other unsigned type. > I started looking around and saw that this error had spread all over the code. > > I replaced the signed int by their unsigned counterparts as much as possible. > If this patch goes in, I may keep working on some other type errors I saw. > > Signed-off-by: Martin Galvan Hi Martin, despite the apparent simplicity, this patch is very hard to review. I suggest splitting it in several parts so that the various submaintainers can look at it. I can take a look at cpus.c, exec.c, kvm-all.c and include/exec/, for example. Please use size_t instead of hwaddr to refer to the size of a buffer in host memory, for example address_space_rw's buf argument. Thanks, Paolo