mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-05 01:54:09 +08:00
HID: ishtp-hid-client: Fix 'suggest-attribute=format' compiler warning
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> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
This commit is contained in:
parent
509405cd7e
commit
c57179c735
@ -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) {
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user