From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5h4f-0004iJ-O7 for qemu-devel@nongnu.org; Mon, 09 Apr 2018 20:23:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5h4e-0002ih-P5 for qemu-devel@nongnu.org; Mon, 09 Apr 2018 20:23:49 -0400 Received: from mail-pf0-x22c.google.com ([2607:f8b0:400e:c00::22c]:34141) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f5h4e-0002iJ-Hf for qemu-devel@nongnu.org; Mon, 09 Apr 2018 20:23:48 -0400 Received: by mail-pf0-x22c.google.com with SMTP id q9so6775024pff.1 for ; Mon, 09 Apr 2018 17:23:48 -0700 (PDT) References: <20180406013628.25900-1-jcmvbkbc@gmail.com> From: Richard Henderson Message-ID: Date: Tue, 10 Apr 2018 10:23:40 +1000 MIME-Version: 1.0 In-Reply-To: <20180406013628.25900-1-jcmvbkbc@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4] linux-user: fix preadv/pwritev offsets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Filippov , qemu-devel@nongnu.org Cc: Peter Maydell , Riku Voipio , Laurent Vivier On 04/06/2018 11:36 AM, Max Filippov wrote: > +static void target_to_host_low_high(abi_ulong tlow, > + abi_ulong thigh, > + unsigned long *hlow, > + unsigned long *hhigh) > +{ > + unsigned long long off = tlow | > + ((unsigned long long)thigh << TARGET_LONG_BITS / 2) << > + TARGET_LONG_BITS / 2; Use uint64_t instead of unsigned long long. > + > + *hlow = (unsigned long)off; > + *hhigh = (unsigned long)((off >> HOST_LONG_BITS / 2) >> > + HOST_LONG_BITS / 2); The casts here are unnecessary and are implied by the assignment. Otherwise, Reviewed-by: Richard Henderson r~