From patchwork Fri Mar 26 14:34:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 409510 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1490467jai; Fri, 26 Mar 2021 07:37:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNRU7ZTIh6JBGxd7wPWlw4VeEDTuBLmLXND07orp8EQtuPGgJaDVvIY4bk4PciHTQLlRfA X-Received: by 2002:a17:907:75c7:: with SMTP id jl7mr16320524ejc.191.1616769389479; Fri, 26 Mar 2021 07:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616769389; cv=none; d=google.com; s=arc-20160816; b=Jsb5Rhrs95yx3HW1eAXWWNKjt2iK7Vg28Y+xQNxy6Q+F5Or27/ctvQfL/Dklr46O8C XeXbLSHGhHOJQUdtUnz3Qfp4mAcgstTdVOaWKs/zxotz6YaT2BSHbIAj8Efo3d1rDrcH LOdo35ggT2eKqkfoeukM/L8El3ITrWUUHW7kURK+DYQoDlWvBngN0DKKnv7nC1CxNDGd 2y4kZDVDiSjR5lh4ErDT0ymXpx5VyUE0ZeRru4Q6MMxyTA+AGChw9aGkDq2Jzxj+fL/l K5LmG7XcEMWz///PNgixvHMVl0wgKVIj8KmZ6cxFlhTPMrpD5zjeBqaa6Q9aLWa1u9js wOuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ClFGCdlyfHku/4SK1RS5YcXqT4jfIPIFaVtjJpjt8dI=; b=F3uSbdih3rFEZuiR7QLLTq+6M2AVzNWM5bGa+0RsWlgFDJE3zj4dU00FIAgNef4jGw ErMi0adWTNjzWPXQXKfjpz5ERJuu2TwhDPkLKzl8OdYbHVBFPXnAkF4K1ll5H4L6V2w2 Q8yrdf9RMf3v4s/Vhz0RbGkpwbaPfHXx2zqlng7u8OmUTb5XB10YjgnG6+f2Po4KeIgB 6QJYSIWoogPrxp5zxHAds8kZ9N1Q8ZcMTL7SLs7vMiYdtN2mHsWUByX/6Sc7//qL+OPW 4xbsHvwg5iYrhFCrRHMX7l4ZzbmS4IGnEgcYQkwfn6acrwXmG/y4GVXhO7ANNmzuMKl1 ishw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zBUWxDzz; spf=pass (google.com: domain of linux-input-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e16si2126144edz.7.2021.03.26.07.36.29; Fri, 26 Mar 2021 07:36:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-input-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zBUWxDzz; spf=pass (google.com: domain of linux-input-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231137AbhCZOgC (ORCPT + 1 other); Fri, 26 Mar 2021 10:36:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230391AbhCZOfa (ORCPT ); Fri, 26 Mar 2021 10:35:30 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D942AC0613AA for ; Fri, 26 Mar 2021 07:35:29 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id b9so5846127wrt.8 for ; Fri, 26 Mar 2021 07:35:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ClFGCdlyfHku/4SK1RS5YcXqT4jfIPIFaVtjJpjt8dI=; b=zBUWxDzz0qsrzy2U455hoEcT4SP9C4Lm/4mPsseMd6sftp+9qjrwtdVWRDIlVUR2x+ w6h7Q0xiW8Bzp6YynifdA8gq/zqqyRwbcDo66EEm8S1Drim13BvKjZKbpx2IFJ57IggZ 8dM0l76bPEoIA5gXy/ZPQH4V/8H9iGTmt4h5xfzYRtTSThHrC2Lr/W5to69igPN6TzzE P/RSQKpbeewsihN0s8oZBQyC2/RNS7miSKfZXusQQFsHdcOJgHbOOpFli/+4kyosRl51 KMDV47YmxBnIuVteCrUTadawpoAUFNmitlpM5WQNd+Jn1Vpz/XhyrpeYeAXCaCuf0s+G V1ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ClFGCdlyfHku/4SK1RS5YcXqT4jfIPIFaVtjJpjt8dI=; b=A4GwjsbWXMkDv1HYDjYH+0V/BBzF8J4/of0iHwzR2KycwgAZZ13kNO7dVX3LH3sT8b uOWrheCzllLOgOoktn7+kkfuL8rfPJK9M/lRbrhfLcyYjifRD8cQ/E1qb5vcaGHp1VhG +h3GAMJupwUx9JNeOpK/P1HzLkGgprEvYPqkDDGot46AfgJ2ZGdnNwE86BfngVPfeyOZ HZR97FNeuyskq4li/c9HAJYBzCOhUmGTbUdyTQM45ieNNYU96fI3sV1vSFH4ye1scY1Y JSUrwAozo1povoHVVRaJDNNcagmwKUSFWyJOCgX0nt0tvXq6tJQCZOgnULPL0v2URjdg BfeA== X-Gm-Message-State: AOAM532NA545NoF4pxuYi4hkz+4Bn/8o7anZa6Undv5e0LPQSZ8bQVuL f1qqttHxAz4sCPE3BhMGd2EEaQ== X-Received: by 2002:adf:cf11:: with SMTP id o17mr14923097wrj.391.1616769328584; Fri, 26 Mar 2021 07:35:28 -0700 (PDT) Received: from dell.default ([91.110.221.194]) by smtp.gmail.com with ESMTPSA id j26sm12878225wrh.57.2021.03.26.07.35.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Mar 2021 07:35:28 -0700 (PDT) From: Lee Jones To: lee.jones@linaro.org Cc: linux-kernel@vger.kernel.org, Srinivas Pandruvada , Jiri Kosina , Benjamin Tissoires , Daniel Drubin , linux-input@vger.kernel.org, Arnd Bergmann Subject: [PATCH 25/25] HID: ishtp-hid-client: Fix 'suggest-attribute=format' compiler warning Date: Fri, 26 Mar 2021 14:34:58 +0000 Message-Id: <20210326143458.508959-27-lee.jones@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210326143458.508959-1-lee.jones@linaro.org> References: <20210326143458.508959-1-lee.jones@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.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 Cc: Jiri Kosina Cc: Benjamin Tissoires Cc: Daniel Drubin Cc: linux-input@vger.kernel.org Suggested-by: Arnd Bergmann Signed-off-by: Lee Jones Acked-by: Srinivas Pandruvada --- 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(-) -- 2.27.0 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 #include +#include #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 +#include + 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);