From patchwork Mon Jul 22 21:26:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joshua Clayton X-Patchwork-Id: 11053453 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7BE0B1399 for ; Mon, 22 Jul 2019 21:26:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C6F828468 for ; Mon, 22 Jul 2019 21:26:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 60C18284D2; Mon, 22 Jul 2019 21:26:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 304E028468 for ; Mon, 22 Jul 2019 21:26:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728822AbfGVV0c (ORCPT ); Mon, 22 Jul 2019 17:26:32 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:34517 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726167AbfGVV0c (ORCPT ); Mon, 22 Jul 2019 17:26:32 -0400 Received: by mail-ed1-f66.google.com with SMTP id s49so7060722edb.1; Mon, 22 Jul 2019 14:26:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+bRZKFPZcTX7fMyUb8/I2gLfJHJqWPBkkotjXmJnSu0=; b=rdXa6GX1TcSZ5GStG9bQ1cyz3RvjQfJP/NfGkOVlWyse770pEjq7AaSe+8sci73fLH +x3rm5nT7/NnE12o4DKDD04ASsjmkuY+0L7b8GZqGDqvuIb3o8gtJQH6xNjOmWDYbH7T FrJrUKeFdeD9x8e0IqsxEcLju3naCChqYf/hOgTXCzs8WSbwbwBH3SrVptrplqdRnoQQ DNHzGxqSh2FKZLNt/oghEDFptRCJ5eBduQ2DCoBsonaDERNzVakjfIPtKAY7DQmVQ1XY nzl/0RxHwz5uy5s7OsJyhEPGNpMFBaDUqHI0Ws60F6l9z155aVzZuYOrurgKFJ71tv1o sMmQ== 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=+bRZKFPZcTX7fMyUb8/I2gLfJHJqWPBkkotjXmJnSu0=; b=KPC0yc0o6mK/wn3GAWZqxDLQQt/baf57AaMK/yVp3wYf54sWyUC1TWV81L5jqFo7Lk DR+sq2Zf9tIelhlmK3jAlvSYW7hwMKsyPJchL4/ECwZpxSVBfXlsA5WOzxYqXpwWntGg fKmrFiXGxYYrAGmOjSKoGtDZkDl5eTyZl9FUdaca/OZGO9OGZ3nmOhuyG8OlFhR7gcwU cMZn+jcPQH1jJj/XbkcZJVsyisqin8MnkqqThuDttIY5x2DPHl1emCAdZc7FgvmFy6Ah nUERuHEsIEtAExpk65qmxH0uFJZt6BBcgJPcydhcDnnROv4b78VVgzQNZ8Yg1bQg2f+e hVng== X-Gm-Message-State: APjAAAXbPeR6mStmeS2tH102HaaXQ2D9dTji6aN1wvKAoGyYZJZg/5HF SmbltpyC0khPMX9x7jrcOao= X-Google-Smtp-Source: APXvYqw7dg/YwFhrgjgLsUOUlwUbBZaoENW9FClXuY2WxF6BmzPpNaxvrwXl9AvuopjNhllkKtaOoA== X-Received: by 2002:a17:906:2e59:: with SMTP id r25mr53899459eji.293.1563830789944; Mon, 22 Jul 2019 14:26:29 -0700 (PDT) Received: from localhost.localdomain ([65.154.66.198]) by smtp.gmail.com with ESMTPSA id a67sm11469524edf.6.2019.07.22.14.26.28 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 14:26:29 -0700 (PDT) From: stillcompiling@gmail.com To: Joe Perches , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org (open list:HID CORE LAYER), linux-kernel@vger.kernel.org (open list) Cc: Joshua Clayton Subject: [PATCH v2 1/3] HID: core: reformat and reduce hid_printk macros Date: Mon, 22 Jul 2019 15:26:11 -0600 Message-Id: <20190722212613.24906-1-stillcompiling@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190722163642.10417-2-stillcompiling@gmail.com> References: <20190722163642.10417-2-stillcompiling@gmail.com> MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Joshua Clayton Reformat hid_printk macros to use standard __VA_ARGS__ syntax Remove hid_printk(), hid_emerg(), hid_crit(), and hid_alert(). Per Joe Perches these unused and likely never to be used. Signed-off-by: Joshua Clayton --- include/linux/hid.h | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/include/linux/hid.h b/include/linux/hid.h index d770ab1a0479..b5e73331100e 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -1154,29 +1154,21 @@ int hid_pidff_init(struct hid_device *hid); #define hid_pidff_init NULL #endif -#define dbg_hid(format, arg...) \ +#define dbg_hid(fmt, ...) \ do { \ if (hid_debug) \ - printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \ + printk(KERN_DEBUG "%s: " fmt, __FILE__, ##__VA_ARGS__) \ } while (0) -#define hid_printk(level, hid, fmt, arg...) \ - dev_printk(level, &(hid)->dev, fmt, ##arg) -#define hid_emerg(hid, fmt, arg...) \ - dev_emerg(&(hid)->dev, fmt, ##arg) -#define hid_crit(hid, fmt, arg...) \ - dev_crit(&(hid)->dev, fmt, ##arg) -#define hid_alert(hid, fmt, arg...) \ - dev_alert(&(hid)->dev, fmt, ##arg) -#define hid_err(hid, fmt, arg...) \ - dev_err(&(hid)->dev, fmt, ##arg) -#define hid_notice(hid, fmt, arg...) \ - dev_notice(&(hid)->dev, fmt, ##arg) -#define hid_warn(hid, fmt, arg...) \ - dev_warn(&(hid)->dev, fmt, ##arg) -#define hid_info(hid, fmt, arg...) \ - dev_info(&(hid)->dev, fmt, ##arg) -#define hid_dbg(hid, fmt, arg...) \ - dev_dbg(&(hid)->dev, fmt, ##arg) +#define hid_err(hid, fmt, ...) \ + dev_err(&(hid)->dev, fmt, ##__VA_ARGS__) +#define hid_notice(hid, fmt, ...) \ + dev_notice(&(hid)->dev, fmt, ##__VA_ARGS__) +#define hid_warn(hid, fmt, ...) \ + dev_warn(&(hid)->dev, fmt, ##__VA_ARGS__) +#define hid_info(hid, fmt, ...) \ + dev_info(&(hid)->dev, fmt, ##__VA_ARGS__) +#define hid_dbg(hid, fmt, ...) \ + dev_dbg(&(hid)->dev, fmt, ##__VA_ARGS__) #endif From patchwork Mon Jul 22 21:26:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joshua Clayton X-Patchwork-Id: 11053449 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 074F61399 for ; Mon, 22 Jul 2019 21:26:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB9DF28468 for ; Mon, 22 Jul 2019 21:26:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DFA01284D2; Mon, 22 Jul 2019 21:26:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 909E528468 for ; Mon, 22 Jul 2019 21:26:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729846AbfGVV0e (ORCPT ); Mon, 22 Jul 2019 17:26:34 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:45225 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732605AbfGVV0d (ORCPT ); Mon, 22 Jul 2019 17:26:33 -0400 Received: by mail-ed1-f68.google.com with SMTP id x19so35965152eda.12; Mon, 22 Jul 2019 14:26:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9U7GzV8yeekKe6e4fBok/0l5M8KlRr66XHZl5JwGq/Q=; b=tZ2TAEP+CkDEOXvasanyS/2zbrqa0RGK8u1Kc839Sl5eo74fOrtqWSdroBOAnU7VTj o26jWX6ivyXOpssGLYZU9OkR2dSi2zpDAHmx8G82+P8LxqFnIAER0C3m34DqMI6Xfu2B IeqjlBNHXXxJmINZ4/irey8wXifWJAVQtwm+2bu3Ti9M1YJPgubwKrQwbY73RGeNDa/S 7T4xY/7Xju8yVe648S2hKamOzaZ0TNlodCZyYK/BLkKG7XA+NWZ0AngyIFRJtl571CVA +Rui2fJo7r+UPQrKA0I2Q/W8odDNAnXBYqXxYTXmedkWbsT9wkMSXTzwc+lRwU75v6l4 ImvA== 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=9U7GzV8yeekKe6e4fBok/0l5M8KlRr66XHZl5JwGq/Q=; b=DO9bZ85XPtY3x8S97r4NRR0bAyQaZqeL2bkgk4SscgfxCzGURqCYrMKd9aBwdmsaMs fd5xmey8RU6QEJAAJU218E9CooZ0gRB9SWQtt/jFsPP7qb+6wbTmMXtGndc37hxLpEbb qakYDfbX6Yl+6JNYkC0sC0vurmtSXGtviRz3GeP9sO6H90RJ1xiiqGkFgP77m19yeElh BfGtez4NG4ORgZ+fiFkibJncFEzV3K6R4Bu2fAs5qXkeuBYBbWRJ5k4Aj9Fax11xLZqh pQ0W7BJRQmzDA/9exg4GTzRQ8CfHYtTL3Myl0LPYu/Gz2tMIH8wpakEjiecRDNVJo95o Sjzw== X-Gm-Message-State: APjAAAWSfqiEcjtIcIzXCEjUXpdnaCOs2S9MgvmGvqDCg1ehikxiGnjp dhDkfpmHYNzlqCi0YKYXTKo= X-Google-Smtp-Source: APXvYqzXEcvH42kQi3NIePyl487sKAo26GXNb9jufG33ojSR7+epYt8y6kVomfFPBqEtSjGXYbKdKQ== X-Received: by 2002:a17:906:4e95:: with SMTP id v21mr55052224eju.105.1563830792009; Mon, 22 Jul 2019 14:26:32 -0700 (PDT) Received: from localhost.localdomain ([65.154.66.198]) by smtp.gmail.com with ESMTPSA id a67sm11469524edf.6.2019.07.22.14.26.30 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 14:26:31 -0700 (PDT) From: stillcompiling@gmail.com To: Joe Perches , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org (open list:HID CORE LAYER), linux-kernel@vger.kernel.org (open list) Cc: Joshua Clayton Subject: [PATCH v2 2/3] HID: core: Add printk_once variants to hid_warn() etc Date: Mon, 22 Jul 2019 15:26:12 -0600 Message-Id: <20190722212613.24906-2-stillcompiling@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190722212613.24906-1-stillcompiling@gmail.com> References: <20190722163642.10417-2-stillcompiling@gmail.com> <20190722212613.24906-1-stillcompiling@gmail.com> MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Joshua Clayton hid_warn_once() is needed, add the others as part of the block Signed-off-by: Joshua Clayton --- include/linux/hid.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/hid.h b/include/linux/hid.h index b5e73331100e..306dde3760a4 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -1171,4 +1171,15 @@ do { \ #define hid_dbg(hid, fmt, ...) \ dev_dbg(&(hid)->dev, fmt, ##__VA_ARGS__) +#define hid_err_once(hid, fmt, ...) \ + dev_err_once(&(hid)->dev, fmt, ##__VA_ARGS__) +#define hid_notice_once(hid, fmt, ...) \ + dev_notice_once(&(hid)->dev, fmt, ##__VA_ARGS__) +#define hid_warn_once(hid, fmt, ...) \ + dev_warn_once(&(hid)->dev, fmt, ##__VA_ARGS__) +#define hid_info_once(hid, fmt, ...) \ + dev_info_once(&(hid)->dev, fmt, ##__VA_ARGS__) +#define hid_dbg_once(hid, fmt, ...) \ + dev_dbg_once(&(hid)->dev, fmt, ##__VA_ARGS__) + #endif From patchwork Mon Jul 22 21:26:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joshua Clayton X-Patchwork-Id: 11053451 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5C55B912 for ; Mon, 22 Jul 2019 21:26:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DCE628468 for ; Mon, 22 Jul 2019 21:26:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41516284D2; Mon, 22 Jul 2019 21:26:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA0AE28468 for ; Mon, 22 Jul 2019 21:26:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732605AbfGVV0g (ORCPT ); Mon, 22 Jul 2019 17:26:36 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:39769 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732607AbfGVV0f (ORCPT ); Mon, 22 Jul 2019 17:26:35 -0400 Received: by mail-ed1-f66.google.com with SMTP id m10so41875536edv.6; Mon, 22 Jul 2019 14:26:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KM/OihnolL+F1PXvRp03ASHFDh/aKfLJ+VNL7vMQ4JU=; b=GTxJUMUbN1sLxMNXdAHXgTSg3YUDHugEwJYqoAC/le7mkZpVlVZztVkYWG4eomYsHz A2mXn/7E1qLJo0qOUogD/1twqQk1pS+vq8yv3rcYouF7ULJPh5ZgZoBZiMA7VJZQwDlM aPvfkYezADe3MvYlKqXTAqLEOeij++63092tLIN1W1TSFOcInI/bU590hxL3ohuM5WNw clZ+1PZqpM+8NuddvHXO6j0ubSE04W1X6FhWOevNqOchAX1ipN9gva/cwXjTxx5uJtSp /dLuC4+hGEsZiPb1mTNjjNj1KqLgIV26EsShbyPPVedyrU8S33a6KT2TaE63z6mC2UN0 AOIA== 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=KM/OihnolL+F1PXvRp03ASHFDh/aKfLJ+VNL7vMQ4JU=; b=q3wLWMH+DsSL85cx1szD4C/iG2PGf6iaJGdQ0dNOSkvkzbqXdKt40Efb8Qq7FKndMD 7Fkv756vUEtqiB0FOJHPJmdg4h+Rl3vM9E+67YrxxCJ5G1QY6bEoLtKzm9DMI/+LI7v2 Z9OWkKnzVJ9wPfpUBu5GzKMgYOFI9IWuYz8XJSt/pPzmHfan+jYiLWbXgAcJHANEQc41 bIZLDRQsJxJhNmNtILLeZfsbzUXfX0EqCj+55UCqtEnFwgLgr26ybJ+tkb1YXb9sUdst hzFJWI+6WffQ4+3LoaVtN2J5nRRrTt5IEE10GXRetcdl7Ty81Q9b3OLjy4iLoq8TjK/u Zjsw== X-Gm-Message-State: APjAAAX6EqLReEUQQf8muNRZx2v7bQFZhjXdtG28ywu1OTbj3B0dpuTi 2FDIE+pruHyNzKTfa6TZpbk= X-Google-Smtp-Source: APXvYqy2ZNXpy3vciRC86L7bxksQpiBrSq3iqDdJDzd0eGTdKCpWOzPUvrwVcWpWpGJRwjmIapO28Q== X-Received: by 2002:a17:906:ca56:: with SMTP id jx22mr54067358ejb.201.1563830794127; Mon, 22 Jul 2019 14:26:34 -0700 (PDT) Received: from localhost.localdomain ([65.154.66.198]) by smtp.gmail.com with ESMTPSA id a67sm11469524edf.6.2019.07.22.14.26.32 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 14:26:33 -0700 (PDT) From: stillcompiling@gmail.com To: Joe Perches , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org (open list:HID CORE LAYER), linux-kernel@vger.kernel.org (open list) Cc: Joshua Clayton Subject: [PATCH v2 3/3] HID: core: only warn once of oversize hid report Date: Mon, 22 Jul 2019 15:26:13 -0600 Message-Id: <20190722212613.24906-3-stillcompiling@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190722212613.24906-1-stillcompiling@gmail.com> References: <20190722163642.10417-2-stillcompiling@gmail.com> <20190722212613.24906-1-stillcompiling@gmail.com> MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Joshua Clayton On HP spectre x360 convertible the message: hid-sensor-hub 001F:8087:0AC2.0002: hid_field_extract() called with n (192) > 32! (kworker/1:2) is continually printed many times per second, crowding out all else Protect dmesg by printing the warning only one time. Signed-off-by: Joshua Clayton --- drivers/hid/hid-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 210b81a56e1a..0cb53dddf341 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1311,8 +1311,8 @@ u32 hid_field_extract(const struct hid_device *hid, u8 *report, unsigned offset, unsigned n) { if (n > 32) { - hid_warn(hid, "hid_field_extract() called with n (%d) > 32! (%s)\n", - n, current->comm); + hid_warn_once(hid, "%s() called with n (%d) > 32! (%s)\n", + __func__ ,n , current->comm); n = 32; }