linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: lee.jones@linaro.org
Cc: linux-kernel@vger.kernel.org,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Daniel Drubin <daniel.drubin@intel.com>,
	linux-input@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH 25/25] HID: ishtp-hid-client: Fix 'suggest-attribute=format' compiler warning
Date: Fri, 26 Mar 2021 14:34:58 +0000	[thread overview]
Message-ID: <20210326143458.508959-27-lee.jones@linaro.org> (raw)
In-Reply-To: <20210326143458.508959-1-lee.jones@linaro.org>

Fixes the following W=1 kernel build warning(s):

 drivers/hid/intel-ish-hid/ishtp/bus.c: In function ‘ishtp_trace_callback’:
 drivers/hid/intel-ish-hid/ishtp/bus.c:876:29: warning: return type might be a candidate for a format attribute [-Wsuggest-attribute=format]
 876 | return cl_device->ishtp_dev->print_log;
 | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Daniel Drubin <daniel.drubin@intel.com>
Cc: linux-input@vger.kernel.org
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 drivers/hid/intel-ish-hid/ishtp-hid-client.c | 4 ++--
 drivers/hid/intel-ish-hid/ishtp-hid.h        | 4 ++--
 drivers/hid/intel-ish-hid/ishtp/bus.c        | 4 ++--
 drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h  | 4 ++--
 include/linux/intel-ish-client-if.h          | 8 +++++++-
 5 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/drivers/hid/intel-ish-hid/ishtp-hid-client.c b/drivers/hid/intel-ish-hid/ishtp-hid-client.c
index 042a7091802dd..6b1fa971b33e2 100644
--- a/drivers/hid/intel-ish-hid/ishtp-hid-client.c
+++ b/drivers/hid/intel-ish-hid/ishtp-hid-client.c
@@ -784,7 +784,7 @@ static void hid_ishtp_cl_reset_handler(struct work_struct *work)
 	}
 }
 
-void (*hid_print_trace)(void *unused, const char *format, ...);
+ishtp_print_log ishtp_hid_print_trace;
 
 /**
  * hid_ishtp_cl_probe() - ISHTP client driver probe
@@ -823,7 +823,7 @@ static int hid_ishtp_cl_probe(struct ishtp_cl_device *cl_device)
 
 	INIT_WORK(&client_data->work, hid_ishtp_cl_reset_handler);
 
-	hid_print_trace = ishtp_trace_callback(cl_device);
+	ishtp_hid_print_trace = ishtp_trace_callback(cl_device);
 
 	rv = hid_ishtp_cl_init(hid_ishtp_cl, 0);
 	if (rv) {
diff --git a/drivers/hid/intel-ish-hid/ishtp-hid.h b/drivers/hid/intel-ish-hid/ishtp-hid.h
index e2423f7d2b547..f88443a7d935e 100644
--- a/drivers/hid/intel-ish-hid/ishtp-hid.h
+++ b/drivers/hid/intel-ish-hid/ishtp-hid.h
@@ -16,9 +16,9 @@
 #define	IS_RESPONSE	0x80
 
 /* Used to dump to Linux trace buffer, if enabled */
-extern void (*hid_print_trace)(void *unused, const char *format, ...);
+extern ishtp_print_log ishtp_hid_print_trace;
 #define hid_ishtp_trace(client, ...) \
-		(hid_print_trace)(NULL, __VA_ARGS__)
+	(ishtp_hid_print_trace)(NULL, __VA_ARGS__)
 
 /* ISH HID message structure */
 struct hostif_msg_hdr {
diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c
index c1c7d5356208d..f0802b047ed8d 100644
--- a/drivers/hid/intel-ish-hid/ishtp/bus.c
+++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
@@ -869,9 +869,9 @@ EXPORT_SYMBOL(ishtp_get_pci_device);
  *
  * This interface is used to return trace callback function pointer.
  *
- * Return: void *.
+ * Return: *ishtp_print_log()
  */
-void *ishtp_trace_callback(struct ishtp_cl_device *cl_device)
+ishtp_print_log ishtp_trace_callback(struct ishtp_cl_device *cl_device)
 {
 	return cl_device->ishtp_dev->print_log;
 }
diff --git a/drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h b/drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h
index 1cc6364aa957f..f579b16e6d7a9 100644
--- a/drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h
+++ b/drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h
@@ -10,6 +10,7 @@
 
 #include <linux/types.h>
 #include <linux/spinlock.h>
+#include <linux/intel-ish-client-if.h>
 #include "bus.h"
 #include "hbm.h"
 
@@ -202,8 +203,7 @@ struct ishtp_device {
 	uint64_t ishtp_host_dma_rx_buf_phys;
 
 	/* Dump to trace buffers if enabled*/
-	__printf(2, 3) void (*print_log)(struct ishtp_device *dev,
-					 const char *format, ...);
+	ishtp_print_log print_log;
 
 	/* Debug stats */
 	unsigned int	ipc_rx_cnt;
diff --git a/include/linux/intel-ish-client-if.h b/include/linux/intel-ish-client-if.h
index 94669e21dc8b3..25e2b4e805023 100644
--- a/include/linux/intel-ish-client-if.h
+++ b/include/linux/intel-ish-client-if.h
@@ -8,11 +8,17 @@
 #ifndef _INTEL_ISH_CLIENT_IF_H_
 #define _INTEL_ISH_CLIENT_IF_H_
 
+#include <linux/device.h>
+#include <linux/uuid.h>
+
 struct ishtp_cl_device;
 struct ishtp_device;
 struct ishtp_cl;
 struct ishtp_fw_client;
 
+typedef __printf(2, 3) void (*ishtp_print_log)(struct ishtp_device *dev,
+					       const char *format, ...);
+
 /* Client state */
 enum cl_state {
 	ISHTP_CL_INITIALIZING = 0,
@@ -76,7 +82,7 @@ int ishtp_register_event_cb(struct ishtp_cl_device *device,
 /* Get the device * from ishtp device instance */
 struct device *ishtp_device(struct ishtp_cl_device *cl_device);
 /* Trace interface for clients */
-void *ishtp_trace_callback(struct ishtp_cl_device *cl_device);
+ishtp_print_log ishtp_trace_callback(struct ishtp_cl_device *cl_device);
 /* Get device pointer of PCI device for DMA acces */
 struct device *ishtp_get_pci_device(struct ishtp_cl_device *cl_device);
 
-- 
2.27.0


  parent reply	other threads:[~2021-03-26 14:37 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26 14:34 [RESEND 00/25] Rid W=1 warnings from HID Lee Jones
2021-03-26 14:34 ` Lee Jones
2021-03-26 14:34 ` [PATCH 01/25] HID: intel-ish-hid: Remove unused variable 'err' Lee Jones
2021-03-26 14:34 ` [PATCH 02/25] HID: ishtp-hid-client: Move variable to where it's actually used Lee Jones
2021-03-26 14:34 ` [PATCH 03/25] HID: intel-ish-hid: pci-ish: Remove unused variable 'ret' Lee Jones
2021-03-26 14:34 ` [PATCH 04/25] HID: intel-ish: Supply some missing param descriptions Lee Jones
2021-03-26 14:34 ` [PATCH 05/25] HID: intel-ish: Fix a naming disparity and a formatting error Lee Jones
2021-03-26 14:34 ` [PATCH 06/25] HID: usbhid: Repair a formatting issue in a struct description Lee Jones
2021-04-07 16:56   ` Benjamin Tissoires
2021-04-08  7:05     ` Lee Jones
2021-03-26 14:34 ` [PATCH 07/25] HID: intel-ish-hid: Fix a little doc-rot Lee Jones
2021-03-26 14:34 ` [PATCH 08/25] HID: usbhid: hid-pidff: Demote a couple kernel-doc abuses Lee Jones
2021-03-26 14:34 ` [PATCH 09/25] HID: hid-alps: Correct struct misnaming Lee Jones
2021-03-26 14:34 ` [PATCH 10/25] HID: intel-ish-hid: Fix potential copy/paste error Lee Jones
2021-03-26 14:34 ` [PATCH 11/25] HID: hid-core: Fix incorrect function name in header Lee Jones
2021-03-26 14:34 ` [PATCH 12/25] HID: intel-ish-hid: ipc: Correct fw_reset_work_fn() " Lee Jones
2021-03-26 14:34 ` [PATCH 13/25] HID: ishtp-hid-client: Fix incorrect function name report_bad_packet() Lee Jones
2021-03-26 14:34 ` [PATCH 14/25] HID: hid-kye: Fix incorrect function name for kye_tablet_enable() Lee Jones
2021-03-26 14:34 ` [PATCH 15/25] HID: hid-picolcd_core: Remove unused variable 'ret' Lee Jones
2021-03-26 14:34 ` [PATCH 16/25] HID: hid-logitech-hidpp: Fix conformant kernel-doc header and demote abuses Lee Jones
2021-03-26 14:34 ` [PATCH 17/25] HID: hid-uclogic-rdesc: Kernel-doc is for functions and structs Lee Jones
2021-03-26 14:34 ` [PATCH 18/25] HID: hid-thrustmaster: Demote a bunch of kernel-doc abuses Lee Jones
2021-03-26 14:34 ` [PATCH 19/25] HID: hid-uclogic-params: Ensure function names are present and correct in kernel-doc headers Lee Jones
2021-03-26 14:34 ` [PATCH 20/25] HID: hid-sensor-custom: Remove unused variable 'ret' Lee Jones
2021-03-29 11:26   ` Jonathan Cameron
2021-03-26 14:34 ` [PATCH 21/25] HID: wacom_sys: Demote kernel-doc abuse Lee Jones
2021-03-26 14:34 ` [PATCH 22/25] HID: hid-sensor-hub: Remove unused struct member 'quirks' Lee Jones
2021-03-29 11:27   ` Jonathan Cameron
2021-03-26 14:34 ` [PATCH 23/25] HID: hid-sensor-hub: Move 'hsdev' description to correct struct definition Lee Jones
2021-03-29 11:30   ` Jonathan Cameron
2021-03-29 13:00     ` Lee Jones
2021-03-29 15:22       ` Jonathan Cameron
2021-03-26 14:34 ` [PATCH 24/25] HID: intel-ish-hid: ishtp-fw-loader: Fix a bunch of formatting issues Lee Jones
2021-03-26 14:34 ` Lee Jones [this message]
2021-04-06  8:56 ` [RESEND 00/25] Rid W=1 warnings from HID Lee Jones
2021-04-07 16:09   ` Benjamin Tissoires
2021-04-08  7:06     ` Lee Jones
2021-04-08 11:43       ` Benjamin Tissoires

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210326143458.508959-27-lee.jones@linaro.org \
    --to=lee.jones@linaro.org \
    --cc=arnd@arndb.de \
    --cc=benjamin.tissoires@redhat.com \
    --cc=daniel.drubin@intel.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).