From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHrWl-0001Yn-Mn for qemu-devel@nongnu.org; Sat, 09 Jan 2016 06:17:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHrWi-00068P-Gt for qemu-devel@nongnu.org; Sat, 09 Jan 2016 06:17:47 -0500 Received: from [59.151.112.132] (port=20624 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHrWi-00068G-4B for qemu-devel@nongnu.org; Sat, 09 Jan 2016 06:17:44 -0500 References: <1452242274-8345-1-git-send-email-caoj.fnst@cn.fujitsu.com> <1452242274-8345-3-git-send-email-caoj.fnst@cn.fujitsu.com> <56903D34.2020204@redhat.com> From: Cao jin Message-ID: <5690ECFF.1060004@cn.fujitsu.com> Date: Sat, 9 Jan 2016 19:20:31 +0800 MIME-Version: 1.0 In-Reply-To: <56903D34.2020204@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 2/5] Add Error **errp for xen_host_pci_device_get() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: Markus Armbruster , stefano.stabellini@eu.citrix.com On 01/09/2016 06:50 AM, Eric Blake wrote: > On 01/08/2016 01:37 AM, Cao jin wrote: > > >> buf[rc] = 0; >> rc = qemu_strtoul(buf, &endptr, base, &value); > > Do you still need a local 'value' variable, or can you just reuse pvalue > here? > I guess so, or else it won`t compile, because, *pvalue* is int*, *value* is unsigned long*, and qemu_strtoul() require a unsigned long* for the last param. And I guess that is why author use a local 'value'. I just want to make the patch small for the reviewer, so I reuse most of original code. but yes, maybe it can be: rc = qemu_strtoul(buf, &endptr, base, (unsigned long *)pvalue); -- Yours Sincerely, Cao jin