Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp458653ybl; Wed, 11 Dec 2019 02:36:09 -0800 (PST) X-Google-Smtp-Source: APXvYqxYWqezU3GwvlpQKLryxhP7MMSeiIhEQnUTE8hFTxMM8JDXtqGNqp+LMLH5A9r2YUL4IsD3 X-Received: by 2002:aca:d507:: with SMTP id m7mr2094361oig.48.1576060569674; Wed, 11 Dec 2019 02:36:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576060569; cv=none; d=google.com; s=arc-20160816; b=Y0YT13swRWd358L7wOlFe8YW7+vvdgZnXzEPmG6EMO4Jl9hbNPY9KmSZER9t1Nz5Vm pONSNHqSihBN4TgCLMQprj1jJAItSF5FY7qxr23OMkdaXY7I+XO1Jj1g+Hn5RL1occUz Ny6CTE/U7QB6OHk9X2IfMSAFEwLlPFueA5qbdFq/roirAvJaHQ9qWS3I6mntE8i4bogV TE8eL93Qm7LD9jah4N8SqK2nVufqaCq24MGg+pJLkZsbwtzFjEaPokL/tz1IWl8hcdF5 frGB0YXxV1ZNWdrPKE57lnvHVj8O2dK+PlX+/Ute6VgurbOnFYKKe1LyKsa70yO6893F e5eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:to:from; bh=rCZtjB8xbyPFuFoJBtc2i1pzx4q1IKwA13uTFjUC5cQ=; b=stIOB+5d/gQOpuTg+JhralA0QbI2Lx3nrEazjGNjS4Tu0NGYDQjpRDp5x9T7icZxYj +KqIBK7fW5Ih/BbCOlWqmUKTEf6bxFH85HktLioT7vy0XzZRa+akPd6rIP/j96bScl7A D/MEwffqBtxKH0keH1iL7pkgvF/MF3EfAPNB29X+W/EQ549rV2AYiBbwAC1uPGMr6mJP AN88B80Z02sMmTHwVH/ZsrdpNXij7evEI05zNvREfx1MRJbO/r8r9bzmN7/whSVTDri8 KHb9lF+3+VO1xazUMPdPBVul6JlgPDnbCV2l4eCgtus7OEzChTlfAz1irWFqWifbphHO cWDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z84si888360oia.7.2019.12.11.02.35.57; Wed, 11 Dec 2019 02:36:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728862AbfLKKem (ORCPT + 99 others); Wed, 11 Dec 2019 05:34:42 -0500 Received: from coyote.holtmann.net ([212.227.132.17]:45573 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728890AbfLKKem (ORCPT ); Wed, 11 Dec 2019 05:34:42 -0500 Received: from localhost.localdomain (p4FF9F0D1.dip0.t-ipconnect.de [79.249.240.209]) by mail.holtmann.org (Postfix) with ESMTPSA id F3372CECD1 for ; Wed, 11 Dec 2019 11:43:51 +0100 (CET) From: Marcel Holtmann To: linux-bluetooth@vger.kernel.org Subject: [PATCH] Bluetooth: Remove usage of BT_ERR_RATELIMITED macro Date: Wed, 11 Dec 2019 11:34:36 +0100 Message-Id: <20191211103436.15369-1-marcel@holtmann.org> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org The macro is really not needed and can be replaced with either usage of bt_err_ratelimited or bt_dev_err_ratelimited. Signed-off-by: Marcel Holtmann --- include/net/bluetooth/bluetooth.h | 4 +--- net/bluetooth/hci_event.c | 14 ++++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index bd2675266859..e42bb8e03c09 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h @@ -138,8 +138,6 @@ void bt_err_ratelimited(const char *fmt, ...); #define BT_ERR(fmt, ...) bt_err(fmt "\n", ##__VA_ARGS__) #define BT_DBG(fmt, ...) pr_debug(fmt "\n", ##__VA_ARGS__) -#define BT_ERR_RATELIMITED(fmt, ...) bt_err_ratelimited(fmt "\n", ##__VA_ARGS__) - #define bt_dev_info(hdev, fmt, ...) \ BT_INFO("%s: " fmt, (hdev)->name, ##__VA_ARGS__) #define bt_dev_warn(hdev, fmt, ...) \ @@ -152,7 +150,7 @@ void bt_err_ratelimited(const char *fmt, ...); #define bt_dev_warn_ratelimited(hdev, fmt, ...) \ bt_warn_ratelimited("%s: " fmt, (hdev)->name, ##__VA_ARGS__) #define bt_dev_err_ratelimited(hdev, fmt, ...) \ - BT_ERR_RATELIMITED("%s: " fmt, (hdev)->name, ##__VA_ARGS__) + bt_err_ratelimited("%s: " fmt, (hdev)->name, ##__VA_ARGS__) /* Connection and socket states */ enum { diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index c1d3a303d97f..1941f120a376 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -5451,7 +5451,7 @@ static void hci_le_adv_report_evt(struct hci_dev *hdev, struct sk_buff *skb) hci_dev_unlock(hdev); } -static u8 ext_evt_type_to_legacy(u16 evt_type) +static u8 ext_evt_type_to_legacy(struct hci_dev *hdev, u16 evt_type) { if (evt_type & LE_EXT_ADV_LEGACY_PDU) { switch (evt_type) { @@ -5468,10 +5468,7 @@ static u8 ext_evt_type_to_legacy(u16 evt_type) return LE_ADV_SCAN_RSP; } - BT_ERR_RATELIMITED("Unknown advertising packet type: 0x%02x", - evt_type); - - return LE_ADV_INVALID; + goto invalid; } if (evt_type & LE_EXT_ADV_CONN_IND) { @@ -5491,8 +5488,9 @@ static u8 ext_evt_type_to_legacy(u16 evt_type) evt_type & LE_EXT_ADV_DIRECT_IND) return LE_ADV_NONCONN_IND; - BT_ERR_RATELIMITED("Unknown advertising packet type: 0x%02x", - evt_type); +invalid: + bt_dev_err_ratelimited(hdev, "Unknown advertising packet type: 0x%02x", + evt_type); return LE_ADV_INVALID; } @@ -5510,7 +5508,7 @@ static void hci_le_ext_adv_report_evt(struct hci_dev *hdev, struct sk_buff *skb) u16 evt_type; evt_type = __le16_to_cpu(ev->evt_type); - legacy_evt_type = ext_evt_type_to_legacy(evt_type); + legacy_evt_type = ext_evt_type_to_legacy(hdev, evt_type); if (legacy_evt_type != LE_ADV_INVALID) { process_adv_report(hdev, legacy_evt_type, &ev->bdaddr, ev->bdaddr_type, NULL, 0, ev->rssi, -- 2.23.0