Blame SOURCES/0007-core-fix-build-warning-on-newer-versions-of-gcc.patch

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