|
|
d5e699 |
From fec6ad30dcb5917f03a53676f4f3ac68126e2fde Mon Sep 17 00:00:00 2001
|
|
|
d5e699 |
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
|
d5e699 |
Date: Fri, 10 Jan 2020 20:04:52 +0100
|
|
|
d5e699 |
Subject: [PATCH 07/10] core: fix build warning on newer versions of gcc
|
|
|
d5e699 |
|
|
|
d5e699 |
When building libusb on a "newer" version of gcc (9.2), a lot of
|
|
|
d5e699 |
warnings are thrown about zero-length messages as being part of a format
|
|
|
d5e699 |
string.
|
|
|
d5e699 |
|
|
|
d5e699 |
An example of this is:
|
|
|
d5e699 |
|
|
|
d5e699 |
descriptor.c:546:11: warning: zero-length gnu_printf format string [-Wformat-zero-length]
|
|
|
d5e699 |
546 | usbi_dbg("");
|
|
|
d5e699 |
| ^~
|
|
|
d5e699 |
|
|
|
d5e699 |
Fix this up by replacing all calls of:
|
|
|
d5e699 |
usbi_dbg("");
|
|
|
d5e699 |
with
|
|
|
d5e699 |
usbi_dbg(" ");
|
|
|
d5e699 |
as obviously we still want to keep the implicit tracing message in the
|
|
|
d5e699 |
log.
|
|
|
d5e699 |
|
|
|
d5e699 |
Closes #674
|
|
|
d5e699 |
|
|
|
d5e699 |
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
|
d5e699 |
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
|
|
d5e699 |
(cherry picked from commit 0bf84e4d516c4488e5fcf4b10e3a7263c13019e1)
|
|
|
d5e699 |
---
|
|
|
d5e699 |
libusb/core.c | 10 +++++-----
|
|
|
d5e699 |
libusb/descriptor.c | 2 +-
|
|
|
d5e699 |
libusb/io.c | 4 ++--
|
|
|
d5e699 |
libusb/version_nano.h | 2 +-
|
|
|
d5e699 |
4 files changed, 9 insertions(+), 9 deletions(-)
|
|
|
d5e699 |
|
|
|
d5e699 |
diff --git a/libusb/core.c b/libusb/core.c
|
|
|
d5e699 |
index 6d025fa..0048dad 100644
|
|
|
d5e699 |
--- a/libusb/core.c
|
|
|
d5e699 |
+++ b/libusb/core.c
|
|
|
d5e699 |
@@ -813,7 +813,7 @@ ssize_t API_EXPORTED libusb_get_device_list(libusb_context *ctx,
|
|
|
d5e699 |
int r = 0;
|
|
|
d5e699 |
ssize_t i, len;
|
|
|
d5e699 |
USBI_GET_CONTEXT(ctx);
|
|
|
d5e699 |
- usbi_dbg("");
|
|
|
d5e699 |
+ usbi_dbg(" ");
|
|
|
d5e699 |
|
|
|
d5e699 |
if (!discdevs)
|
|
|
d5e699 |
return LIBUSB_ERROR_NO_MEM;
|
|
|
d5e699 |
@@ -1493,7 +1493,7 @@ void API_EXPORTED libusb_close(libusb_device_handle *dev_handle)
|
|
|
d5e699 |
|
|
|
d5e699 |
if (!dev_handle)
|
|
|
d5e699 |
return;
|
|
|
d5e699 |
- usbi_dbg("");
|
|
|
d5e699 |
+ usbi_dbg(" ");
|
|
|
d5e699 |
|
|
|
d5e699 |
ctx = HANDLE_CTX(dev_handle);
|
|
|
d5e699 |
handling_events = usbi_handling_events(ctx);
|
|
|
d5e699 |
@@ -1576,7 +1576,7 @@ int API_EXPORTED libusb_get_configuration(libusb_device_handle *dev_handle,
|
|
|
d5e699 |
{
|
|
|
d5e699 |
int r = LIBUSB_ERROR_NOT_SUPPORTED;
|
|
|
d5e699 |
|
|
|
d5e699 |
- usbi_dbg("");
|
|
|
d5e699 |
+ usbi_dbg(" ");
|
|
|
d5e699 |
if (usbi_backend.get_configuration)
|
|
|
d5e699 |
r = usbi_backend.get_configuration(dev_handle, config);
|
|
|
d5e699 |
|
|
|
d5e699 |
@@ -1844,7 +1844,7 @@ int API_EXPORTED libusb_clear_halt(libusb_device_handle *dev_handle,
|
|
|
d5e699 |
*/
|
|
|
d5e699 |
int API_EXPORTED libusb_reset_device(libusb_device_handle *dev_handle)
|
|
|
d5e699 |
{
|
|
|
d5e699 |
- usbi_dbg("");
|
|
|
d5e699 |
+ usbi_dbg(" ");
|
|
|
d5e699 |
if (!dev_handle->dev->attached)
|
|
|
d5e699 |
return LIBUSB_ERROR_NO_DEVICE;
|
|
|
d5e699 |
|
|
|
d5e699 |
@@ -2368,7 +2368,7 @@ void API_EXPORTED libusb_exit(struct libusb_context *ctx)
|
|
|
d5e699 |
struct timeval tv = { 0, 0 };
|
|
|
d5e699 |
int destroying_default_context = 0;
|
|
|
d5e699 |
|
|
|
d5e699 |
- usbi_dbg("");
|
|
|
d5e699 |
+ usbi_dbg(" ");
|
|
|
d5e699 |
USBI_GET_CONTEXT(ctx);
|
|
|
d5e699 |
|
|
|
d5e699 |
/* if working with default context, only actually do the deinitialization
|
|
|
d5e699 |
diff --git a/libusb/descriptor.c b/libusb/descriptor.c
|
|
|
d5e699 |
index 53905e6..53d1f6f 100644
|
|
|
d5e699 |
--- a/libusb/descriptor.c
|
|
|
d5e699 |
+++ b/libusb/descriptor.c
|
|
|
d5e699 |
@@ -543,7 +543,7 @@ int usbi_device_cache_descriptor(libusb_device *dev)
|
|
|
d5e699 |
int API_EXPORTED libusb_get_device_descriptor(libusb_device *dev,
|
|
|
d5e699 |
struct libusb_device_descriptor *desc)
|
|
|
d5e699 |
{
|
|
|
d5e699 |
- usbi_dbg("");
|
|
|
d5e699 |
+ usbi_dbg(" ");
|
|
|
d5e699 |
memcpy((unsigned char *) desc, (unsigned char *) &dev->device_descriptor,
|
|
|
d5e699 |
sizeof (dev->device_descriptor));
|
|
|
d5e699 |
return 0;
|
|
|
d5e699 |
diff --git a/libusb/io.c b/libusb/io.c
|
|
|
d5e699 |
index 978b09a..77a048f 100644
|
|
|
d5e699 |
--- a/libusb/io.c
|
|
|
d5e699 |
+++ b/libusb/io.c
|
|
|
d5e699 |
@@ -1330,7 +1330,7 @@ static int disarm_timerfd(struct libusb_context *ctx)
|
|
|
d5e699 |
const struct itimerspec disarm_timer = { { 0, 0 }, { 0, 0 } };
|
|
|
d5e699 |
int r;
|
|
|
d5e699 |
|
|
|
d5e699 |
- usbi_dbg("");
|
|
|
d5e699 |
+ usbi_dbg(" ");
|
|
|
d5e699 |
r = timerfd_settime(ctx->timerfd, 0, &disarm_timer, NULL);
|
|
|
d5e699 |
if (r < 0)
|
|
|
d5e699 |
return LIBUSB_ERROR_OTHER;
|
|
|
d5e699 |
@@ -1912,7 +1912,7 @@ void API_EXPORTED libusb_interrupt_event_handler(libusb_context *ctx)
|
|
|
d5e699 |
int pending_events;
|
|
|
d5e699 |
USBI_GET_CONTEXT(ctx);
|
|
|
d5e699 |
|
|
|
d5e699 |
- usbi_dbg("");
|
|
|
d5e699 |
+ usbi_dbg(" ");
|
|
|
d5e699 |
usbi_mutex_lock(&ctx->event_data_lock);
|
|
|
d5e699 |
|
|
|
d5e699 |
pending_events = usbi_pending_events(ctx);
|
|
|
d5e699 |
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
|
|
|
d5e699 |
index 4150474..8e487b0 100644
|
|
|
d5e699 |
--- a/libusb/version_nano.h
|
|
|
d5e699 |
+++ b/libusb/version_nano.h
|
|
|
d5e699 |
@@ -1 +1 @@
|
|
|
d5e699 |
-#define LIBUSB_NANO 11415
|
|
|
d5e699 |
+#define LIBUSB_NANO 11421
|
|
|
d5e699 |
--
|
|
|
d5e699 |
2.26.1
|
|
|
d5e699 |
|