From patchwork Mon Jul 22 21:48:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joshua Clayton X-Patchwork-Id: 11053547 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 DDCF96C5 for ; Mon, 22 Jul 2019 21:48:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA16626E1A for ; Mon, 22 Jul 2019 21:48:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B959928508; Mon, 22 Jul 2019 21:48: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 2FCEA2847E for ; Mon, 22 Jul 2019 21:48:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732901AbfGVVso (ORCPT ); Mon, 22 Jul 2019 17:48:44 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:34446 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730274AbfGVVsn (ORCPT ); Mon, 22 Jul 2019 17:48:43 -0400 Received: by mail-ed1-f66.google.com with SMTP id s49so7115350edb.1; Mon, 22 Jul 2019 14:48:42 -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=ZbTATclhVfBlGWFDB5efjA9W9vf6/Py4hi06i3erHPU=; b=AnoDBrthgsI3o8DGAH7++2JDKpO82XDtupaff6mpz+ogj/++m9LBhYgjzm5kZJkgeJ NGtdFGN3lGgpql95xFsgGsh0Wom2dUDyrglnt4RNWBFy7aNU5veBR7Vbpscp67hceA4i N42ClwCCBIvusI0evmnIdaWNN5TOIWZC+f1PuT8JonpTCccV8zWWC403k9ixwjL1STCf wAq+EK/I3Us34HitRF6oj1Yf0eRD0V/n4K1mD5kRZEbw5Xrc4pSaPcmkSZPY0yzHqWpa lHcVIbPb4ZRVLJnbbFQER1Jgt9sTFsbwLhbpiKlk+t0wmhPKJbTaUjkkKC21dIpfWLEJ 3lyw== 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=ZbTATclhVfBlGWFDB5efjA9W9vf6/Py4hi06i3erHPU=; b=PEXk9YTtgtDvcZZsnv6jyEUauXg94WcttO8V4GrNzTPh/V7RYoJ2D5vgNNci4Y/NZx pd2KLB5plvy9WH2F24A4ZcR/4o3/GG653tG9i6DnHtztNNMEFkO1B5LMWyu4rIVm8RR4 Z5m2x1TNl5FWDBnUzG8W1PhVaPFZSy3cjVnC1RttqxPdtvX+hBaOtcYuECAuosoZFhrk IOaRd85r321dZ47f1OdG5evJspjlVhflo8i+3HpqhkD9dfx2Q/UbatM5qMy2l/lAY6Ef i0mViu6MeN/NZeSVB3e5+NATylSkA7EPfOLb3nWsS4GAkhCnLtT7SbYpRIKCaDQyDwej F8Iw== X-Gm-Message-State: APjAAAWfnnXbPsBo41/qFad6kBrPM5iKH8hDwiY5k3Ax1GJgGJA3f9XW +x0ySQUxdM+jgeMPdBwK1Gc= X-Google-Smtp-Source: APXvYqwPv/bMIzABFLEfvw6u9o5ZuTRHhGYUL6UWFvdaMSvHKjs0ttQnmpA18+gun2JCC71272dLlw== X-Received: by 2002:a17:906:ad86:: with SMTP id la6mr52067941ejb.43.1563832121287; Mon, 22 Jul 2019 14:48:41 -0700 (PDT) Received: from localhost.localdomain ([65.154.66.198]) by smtp.gmail.com with ESMTPSA id d4sm11315617edb.4.2019.07.22.14.48.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 14:48:40 -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 v3 1/3] HID: core: reformat and reduce hid_printk macros Date: Mon, 22 Jul 2019 15:48:25 -0600 Message-Id: <20190722214827.29257-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..e6c7efdb0458 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:48:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joshua Clayton X-Patchwork-Id: 11053551 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 72BEB912 for ; Mon, 22 Jul 2019 21:48:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63F2226E1A for ; Mon, 22 Jul 2019 21:48:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5516A28508; Mon, 22 Jul 2019 21:48:57 +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 06A1126E1A for ; Mon, 22 Jul 2019 21:48:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732905AbfGVVsq (ORCPT ); Mon, 22 Jul 2019 17:48:46 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:40099 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732820AbfGVVsp (ORCPT ); Mon, 22 Jul 2019 17:48:45 -0400 Received: by mail-ed1-f66.google.com with SMTP id k8so41910815eds.7; Mon, 22 Jul 2019 14:48:44 -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=FENI0QfMNWJ5FelefUZ+G7/NZ/3sRK983AKLe0QVPsY=; b=foRZa2mKuNS0W4zx9VOG2nUDtf+PVaLSKNMRH/WoEqE8A/SBhtWy2nX2RoO68PUWGn 0Fp0d2oGpz6wVH4L9BX/rjXP02fw8e8ycjDwhn60M7dhZD1bR57CvVsP2jXl+Sesvemy 3BgbyMZEIeGgob3bIYEZxgDkM6/xxn1xsRVzYC2/I5+0Jq64tv75TyNNPNsgDctvMxtD Li+GVV3rrPw2DRKepkEJk+j02qz8Ig91R3zwQWUfROA/+0QWctki903r/lUkDDvSu0YK Z5nBuzWDA7oQwWeymApHbiP8+vQnTMLODjCHaGpxU7B5Mws40okzvjLhNNcsKdGc4/FR kTvQ== 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=FENI0QfMNWJ5FelefUZ+G7/NZ/3sRK983AKLe0QVPsY=; b=htUqq0O1edWQVQXO21VaektRTQyP0KI1kPT+LVZ6EbTC8Wf3KJK9ypEDSS10tCXgHA MaWw0XM2Qr1VD9cSZ2CRNpgLj06KZ20ALRFF5aUs1yWHmMSCoPtMuhhGn93MMbpXblqI sKmD48e1tMdJSooQELJGr+vQihV2LU7jSJVIwH9YxJDkEvkTR2oUf/0CIc7cYr0uSUrC WzloEirT3UQEOvfTSoFtPEHHsnaG/eQX5xermx0OVUr2weYLUhIpTHGiShCkd+ZVlGPi qSFCY2hq3xhdg2JvX+CBB8d8w2P4t2XrNHTRbOfRuP3SGEaGcqvYOmxf5G1SgS980tg3 Kwlg== X-Gm-Message-State: APjAAAVbJFlKkPx8+eHR7GpGJofDOyPVxt90vZa+NFV/ya1mdb+Ev7lL GnIZeHg1jJU5K3v2SUAcpec= X-Google-Smtp-Source: APXvYqyhoZvhyamR/6SYBtIdjJBcWbJapKFpTHtITm9MTjWGT5XBVJH7plBHhgLnsDYMitV9xTnl9w== X-Received: by 2002:a17:906:3018:: with SMTP id 24mr56168412ejz.187.1563832123314; Mon, 22 Jul 2019 14:48:43 -0700 (PDT) Received: from localhost.localdomain ([65.154.66.198]) by smtp.gmail.com with ESMTPSA id d4sm11315617edb.4.2019.07.22.14.48.41 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 14:48:42 -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 v3 2/3] HID: core: Add printk_once variants to hid_warn() etc Date: Mon, 22 Jul 2019 15:48:26 -0600 Message-Id: <20190722214827.29257-2-stillcompiling@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190722214827.29257-1-stillcompiling@gmail.com> References: <20190722163642.10417-2-stillcompiling@gmail.com> <20190722214827.29257-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 e6c7efdb0458..cd41f209043f 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:48:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joshua Clayton X-Patchwork-Id: 11053549 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 F1E99912 for ; Mon, 22 Jul 2019 21:48:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1C6A26E1A for ; Mon, 22 Jul 2019 21:48:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5FE428508; Mon, 22 Jul 2019 21:48:54 +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 7C8E026E1A for ; Mon, 22 Jul 2019 21:48:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732919AbfGVVsr (ORCPT ); Mon, 22 Jul 2019 17:48:47 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:38842 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732907AbfGVVsr (ORCPT ); Mon, 22 Jul 2019 17:48:47 -0400 Received: by mail-ed1-f67.google.com with SMTP id r12so7147103edo.5; Mon, 22 Jul 2019 14:48:46 -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=inZa3TVmWFkwKROJnwjdOzwsfiSlRUzlERV4AMAiDbU=; b=Kjc7Z7LbkyZQoSYGIqGObI6lmtBjBt3vDFoIHBE3IjlpFyFMt7itVoEIPg7EzqEBkl 2r9oOlFGi1mlcnyOXAP44kNxY2aHsO6VkgNWB1zaHyHoHMt4UiG/7yD/gDv3uLi1Rpg1 8rF7bLnZ+D/TXDBAokXCP38dEDpTOa98eOOt7DHgmu63o1n23PAqRxElh0dOoRa/giWn p75TAJt6Qs5SIaNDwPoHcBJ7mcP1ZwyHnUWPqVVNY6B9zzsbqIN6LDsKpBWLnhL+MnR+ PNE7pLw2VZUHOTfsDFcuXB8wm3Tma+QmNe15fuTV3co19jvD8JDyHzlAbXE4V0O5VMO7 Dufg== 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=inZa3TVmWFkwKROJnwjdOzwsfiSlRUzlERV4AMAiDbU=; b=BhYyz3JgA6Z8bI0/Ng0DMjxkqAW2XogEMNaL9CgKu3epKeeL/wQ0OxFlF6SIF+VJdX l858D9Wb39Rn7BIm0EN5rj0aHWFYEMNWuZFGHvt4E75JCddDNyayjMFDTKSfm/r4aDIG OtA0YpdAH0bjTaO7jGFpnBTuKybGWzm7nX2Zw9UwnCPzW48nI1L/Bt/M8F3X+6ayttnX BsvWfb2tWczLgS41kmZolcj7ARCYZ5qHG3VrOqfU3Lsgqg9F6wtHHATsvE7Z378SkX+m Iv5NtpURhPuaDpatOtpS9L2bnPI5MLrfpHQjMBHHDRWqewRm00O+xntYpblMcxzQuzdV BTzA== X-Gm-Message-State: APjAAAXc+oXSlxsRjVO3rVHvsdUGh387tsEyLW5EYQ8ZgDF5H0lMV6dy 8cvGsu3GHkCsP1wCLfwfCxQ= X-Google-Smtp-Source: APXvYqwaf+94HctotgfRZtaDLULEesihLhjER6anVGZWKKut2Gqj7GVw1S5B6Pok/SYDL+TqT8txlw== X-Received: by 2002:a17:906:340e:: with SMTP id c14mr56112743ejb.170.1563832125374; Mon, 22 Jul 2019 14:48:45 -0700 (PDT) Received: from localhost.localdomain ([65.154.66.198]) by smtp.gmail.com with ESMTPSA id d4sm11315617edb.4.2019.07.22.14.48.43 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 14:48:44 -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 v3 3/3] HID: core: only warn once of oversize hid report Date: Mon, 22 Jul 2019 15:48:27 -0600 Message-Id: <20190722214827.29257-3-stillcompiling@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190722214827.29257-1-stillcompiling@gmail.com> References: <20190722163642.10417-2-stillcompiling@gmail.com> <20190722214827.29257-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..3eaee2c37931 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; }