From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgW6T-0005Bq-SU for qemu-devel@nongnu.org; Mon, 28 Sep 2015 06:56:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgW6O-00079B-SY for qemu-devel@nongnu.org; Mon, 28 Sep 2015 06:56:17 -0400 References: <1443170278-9318-1-git-send-email-shraddha.6596@gmail.com> <1443170278-9318-3-git-send-email-shraddha.6596@gmail.com> <5606C4A1.60509@redhat.com> From: Paolo Bonzini Message-ID: <56091CC4.4020108@redhat.com> Date: Mon, 28 Sep 2015 12:56:04 +0200 MIME-Version: 1.0 In-Reply-To: <5606C4A1.60509@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] Target-ppc: Remove unnecessary variable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Shraddha Barke , kvm@vger.kernel.org, qemu-trivial@nongnu.org, Michael Tokarev Cc: qemu-devel On 26/09/2015 18:15, Eric Blake wrote: > On 09/25/2015 02:37 AM, Shraddha Barke wrote: >> Compress lines and remove the variable. >> > >> +++ b/target-ppc/kvm.c >> @@ -1782,8 +1782,7 @@ uint32_t kvmppc_get_tbfreq(void) >> >> ns++; >> >> - retval = atoi(ns); >> - return retval; >> + return atoi(ns); > > atoi() is lousy; it cannot properly detect user input errors. This > should probably be converted to use the appropriate qemu_strtol variant > instead. But it's more or less okay here, it's parsing /proc/cpuinfo. Paolo