summaryrefslogtreecommitdiff
path: root/driver_garmin.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-04-20 13:36:14 -0400
committerEric S. Raymond <esr@thyrsus.com>2010-04-20 13:36:14 -0400
commitb7db5552281151cc623f5e03f3c4f3687025ec38 (patch)
tree461979495e2a3eb536ddf0c12a7b84ec96ce1bf2 /driver_garmin.c
parentd3551eec32b6a4858d00582f61b00803ef340b00 (diff)
downloadgpsd-b7db5552281151cc623f5e03f3c4f3687025ec38.tar.gz
Splint and cppcheck cleanup. All regression tests pass.
Diffstat (limited to 'driver_garmin.c')
-rw-r--r--driver_garmin.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/driver_garmin.c b/driver_garmin.c
index 3988952d..afe931d8 100644
--- a/driver_garmin.c
+++ b/driver_garmin.c
@@ -813,6 +813,7 @@ static void Build_Send_SER_Packet(struct gps_device_t *session,
*
* libudev: http://www.kernel.org/pub/linux/utils/kernel/hotplug/libudev/
*/
+/*@-compdef -usedef@*/
static bool is_usb_device(const char *path UNUSED, int vendor, int product)
{
// discover devices
@@ -822,13 +823,15 @@ static bool is_usb_device(const char *path UNUSED, int vendor, int product)
bool found = false;
gpsd_report(LOG_SHOUT, "attempting USB device enumeration.\n");
- libusb_init(NULL);
+ /*@i2@*/libusb_init(NULL);
+ /*@-nullpass@*/
if ((cnt = libusb_get_device_list(NULL, &list)) < 0) {
gpsd_report(LOG_ERROR, "USB device list call failed.\n");
- libusb_exit(NULL);
+ /*@i1@*/libusb_exit(NULL);
return false;
}
+ /*@+nullpass@*/
for (i = 0; i < cnt; i++) {
struct libusb_device_descriptor desc;
@@ -858,9 +861,10 @@ static bool is_usb_device(const char *path UNUSED, int vendor, int product)
gpsd_report(LOG_SHOUT, "vendor/product match with %04x:%04x %sfound\n",
vendor, product, found ? "" : "not ");
libusb_free_device_list(list, 1);
- libusb_exit(NULL);
+ /*@i1@*/libusb_exit(NULL);
return found;
}
+/*@-compdef -usedef@*/
#endif /* HAVE_LIBUSB || S_SPLINT_S */
/*