[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH-for-4.1? 5/7] vl: Use qemu_strtoi() instead of strto
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH-for-4.1? 5/7] vl: Use qemu_strtoi() instead of strtol() |
Date: |
Fri, 12 Jul 2019 15:39:26 +0200 |
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é <address@hidden>
---
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;
}
--
2.20.1
- Re: [Qemu-devel] [PATCH-for-4.1? 1/7] hw/arm: Nokia N-series tablet requires Bluetooth, (continued)
- [Qemu-devel] [PATCH-for-4.1 2/7] hw/usb: Bluetooth HCI USB depends on USB & BLUETOOTH, Philippe Mathieu-Daudé, 2019/07/12
- Re: [Qemu-devel] [PATCH-for-4.1 2/7] hw/usb: Bluetooth HCI USB depends on USB & BLUETOOTH, Paolo Bonzini, 2019/07/12
- Re: [Qemu-devel] [PATCH-for-4.1 2/7] hw/usb: Bluetooth HCI USB depends on USB & BLUETOOTH, Philippe Mathieu-Daudé, 2019/07/12
- Re: [Qemu-devel] [PATCH-for-4.1 2/7] hw/usb: Bluetooth HCI USB depends on USB & BLUETOOTH, Paolo Bonzini, 2019/07/12
- Re: [Qemu-devel] [PATCH-for-4.1 2/7] hw/usb: Bluetooth HCI USB depends on USB & BLUETOOTH, Philippe Mathieu-Daudé, 2019/07/12
- Re: [Qemu-devel] [PATCH-for-4.1 2/7] hw/usb: Bluetooth HCI USB depends on USB & BLUETOOTH, Paolo Bonzini, 2019/07/12
- Re: [Qemu-devel] [PATCH-for-4.1 2/7] hw/usb: Bluetooth HCI USB depends on USB & BLUETOOTH, Philippe Mathieu-Daudé, 2019/07/14
[Qemu-devel] [PATCH-for-4.1? 3/7] MAINTAINERS: Add an entry for the Bluetooth devices, Philippe Mathieu-Daudé, 2019/07/12
[Qemu-devel] [PATCH-for-4.1? 4/7] vl: Fix 'braces' coding style issues, Philippe Mathieu-Daudé, 2019/07/12
[Qemu-devel] [PATCH-for-4.1? 5/7] vl: Use qemu_strtoi() instead of strtol(),
Philippe Mathieu-Daudé <=
[Qemu-devel] [PATCH-for-4.1? 6/7] vl: Extract bt_parse() into its own file, Philippe Mathieu-Daudé, 2019/07/12
[Qemu-devel] [PATCH-for-4.1? 7/7] hw/bt: Allow building with CONFIG_BLUETOOTH disabled, Philippe Mathieu-Daudé, 2019/07/12
Re: [Qemu-devel] [PATCH-for-4.1? 0/7] vl: Allow building with CONFIG_BLUETOOTH disabled, Richard Henderson, 2019/07/14
Re: [Qemu-devel] [PATCH-for-4.1? 0/7] vl: Allow building with CONFIG_BLUETOOTH disabled, Thomas Huth, 2019/07/15