From 856d6897489eef69f43d705c819cd9a034b3aee4 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sun, 13 Oct 2013 22:06:04 +0200 Subject: [PATCH] cppcheck: remove more unused elements in libusb 0.1 compat --- libnfc/buses/libusb-compat-core.c | 18 ++---------------- libnfc/buses/usbbus.c | 5 ----- libnfc/buses/usbbus.h | 2 -- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/libnfc/buses/libusb-compat-core.c b/libnfc/buses/libusb-compat-core.c index 333815b..7591b72 100644 --- a/libnfc/buses/libusb-compat-core.c +++ b/libnfc/buses/libusb-compat-core.c @@ -97,10 +97,10 @@ static void _usb_finalize(void) void usb_init(void) { - int r; usbi_dbg(""); if (!ctx) { + int r; r = libusb_init(&ctx); if (r < 0) { usbi_err("initialization failed!"); @@ -115,15 +115,6 @@ void usb_init(void) } } -void usb_set_debug(int level) -{ - usb_debug = level; - - /* usb_set_debug can be called before usb_init */ - if (ctx) - libusb_set_debug(ctx, 3); -} - char *usb_strerror(void) { return strerror(errno); @@ -528,7 +519,6 @@ int usb_find_devices(void) struct usb_bus *bus; libusb_device **dev_list; int dev_list_len; - int r; int changes = 0; /* libusb-1.0 initialization might have failed, but we can't indicate @@ -542,6 +532,7 @@ int usb_find_devices(void) return compat_err(dev_list_len); for (bus = usb_busses; bus; bus = bus->next) { + int r; struct usb_device *new_devices = NULL; struct usb_device *dev; @@ -643,11 +634,6 @@ int usb_close(usb_dev_handle *dev) return 0; } -struct usb_device *usb_device(usb_dev_handle *dev) -{ - return dev->device; -} - int usb_set_configuration(usb_dev_handle *dev, int configuration) { usbi_dbg("configuration %d", configuration); diff --git a/libnfc/buses/usbbus.c b/libnfc/buses/usbbus.c index 86d32e4..baf8f32 100644 --- a/libnfc/buses/usbbus.c +++ b/libnfc/buses/usbbus.c @@ -139,11 +139,6 @@ int usbbus_reset(usbbus_dev_handle *dev) return usb_reset((usb_dev_handle *)dev); } -struct usbbus_device *usbbus_device(usbbus_dev_handle *dev) -{ - return (struct usbbus_device *) usb_device((usb_dev_handle *)dev); -} - struct usbbus_bus *usbbus_get_busses(void) { return (struct usbbus_bus *) usb_get_busses(); diff --git a/libnfc/buses/usbbus.h b/libnfc/buses/usbbus.h index 589568c..54b252b 100644 --- a/libnfc/buses/usbbus.h +++ b/libnfc/buses/usbbus.h @@ -134,7 +134,6 @@ struct usbbus_device_descriptor { } __attribute__((packed)); -struct usbbus_device; struct usbbus_bus; struct usbbus_device { @@ -177,7 +176,6 @@ int usbbus_claim_interface(usbbus_dev_handle *dev, int interface); int usbbus_release_interface(usbbus_dev_handle *dev, int interface); int usbbus_set_altinterface(usbbus_dev_handle *dev, int alternate); int usbbus_reset(usbbus_dev_handle *dev); -struct usbbus_device *usbbus_device(usbbus_dev_handle *dev); struct usbbus_bus *usbbus_get_busses(void); #endif // __NFC_BUS_USB_H__