From patchwork Fri Jul 12 13:39:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1131371 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45lYw530Wdz9sLt for ; Fri, 12 Jul 2019 23:40:37 +1000 (AEST) Received: from localhost ([::1]:49514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlvmt-0006x8-57 for incoming@patchwork.ozlabs.org; Fri, 12 Jul 2019 09:40:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57594) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlvmU-0005lT-OX for qemu-devel@nongnu.org; Fri, 12 Jul 2019 09:40:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hlvmT-0006lJ-R5 for qemu-devel@nongnu.org; Fri, 12 Jul 2019 09:40:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46972) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hlvmR-0006jA-MQ; Fri, 12 Jul 2019 09:40:07 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 051EFC057F2F; Fri, 12 Jul 2019 13:40:07 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-150.brq.redhat.com [10.40.204.150]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 87E7019C58; Fri, 12 Jul 2019 13:39:58 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Fri, 12 Jul 2019 15:39:26 +0200 Message-Id: <20190712133928.21394-6-philmd@redhat.com> In-Reply-To: <20190712133928.21394-1-philmd@redhat.com> References: <20190712133928.21394-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 12 Jul 2019 13:40:07 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH-for-4.1? 5/7] vl: Use qemu_strtoi() instead of strtol() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Thomas Huth , qemu-arm@nongnu.org, Gerd Hoffmann , Paolo Bonzini , Miroslav Rezanina , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Since we'll move this code around, fix this checkpatch warning first: ERROR: consider using qemu_strtol in preference to strtol Signed-off-by: Philippe Mathieu-Daudé --- vl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vl.c b/vl.c index 96de4f74b9..c7f4d01c99 100644 --- a/vl.c +++ b/vl.c @@ -978,8 +978,7 @@ static struct bt_device_s *bt_device_add(const char *opt) pstrcpy(devname, MIN(sizeof(devname), len), opt); if (endp) { - vlan_id = strtol(endp + 6, &endp, 0); - if (*endp) { + if (qemu_strtoi(endp + 6, (const char **)&endp, 0, &vlan_id) < 0) { error_report("unrecognised bluetooth vlan Id"); return 0; } @@ -1019,8 +1018,7 @@ static int bt_parse(const char *opt) if (!*endp || *endp == ',') { if (*endp) { if (strstart(endp, ",vlan=", &p)) { - vlan = strtol(p, (char **) &endp, 0); - if (*endp) { + if (qemu_strtoi(p, &endp, 0, &vlan) < 0) { error_report("bad scatternet '%s'", p); return 1; }