Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp721247ybl; Wed, 11 Dec 2019 06:33:06 -0800 (PST) X-Google-Smtp-Source: APXvYqzch1fn+OBB5LVbg2zlTyuXtycUQsGlkCqsQEE3hawJsT9upLD1P3IJnTlq0ZLoOB2Pp5oa X-Received: by 2002:a9d:6d81:: with SMTP id x1mr2643151otp.9.1576074785939; Wed, 11 Dec 2019 06:33:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576074785; cv=none; d=google.com; s=arc-20160816; b=OxdkTEexizvGmSFT4rSL6g1xgYu4jkqxAtkA220F5K26pQC4jzCPRLwhXCxJrg1Iwx 7wHtXUfTgPHvyyLQ8JuuBrGpZ3cHF0t0fbBh0LSCOCJeopI34PV1WoITn1KpszySKFgu F0Bt4GfFrBpeicy08e9noUqIiDIf+J703Fzs++LprOBlva6rolFFSIlQSam4ypYGGRJ6 n6pbiC/oN04HNJj32pBhQxDQDjPMU3oaDsvbCKemxmZGQSByNMVB7oeXVLhuz1Kb7q77 QPxOcHViNCc8yl/Z4OlLKWntLFtnq8Cg0mBhufq6CE9Oprf83u/uwHOcVnJmVLECv53Z UlhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=K8M28FWZ9VlZq7WswPyp5ZMZgtOL+Dx4QRXiP5F3k1k=; b=ZiumTS7JWVtaBRlVChFI23ShNJVMT5qgeZJuGgLtIgMi2Mc7exJwKNZrEQfawcfdS6 Kf/x98B+x4L9aEUUCU96695exF7PkGz/K2++1sAKFMsfcEupOm09aLxzapHFr5lJL8Xs SGuA59qQZ6aHEGxY6PXihMjq550ZYWPKoS3WfzlCREFB7ViyVjJEO4zV3Kz7DtlCDjBv hBLpZycoNiOpo5tJAqq0jgyiwHqH+nLAvy+jEuPSbfzPa7rtM78psn/IxhyTk65KIx5W T7YQrGXNM7K2eN+H/8h39wxdAzYbufszE07Viv/GQ+1RCAkzqeM+SqBr7qrxifp7Mghr d37A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Xf6fTGN1; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a8si1243679otp.35.2019.12.11.06.32.41; Wed, 11 Dec 2019 06:33:05 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=Xf6fTGN1; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729872AbfLKOc0 (ORCPT + 99 others); Wed, 11 Dec 2019 09:32:26 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:34050 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729791AbfLKOc0 (ORCPT ); Wed, 11 Dec 2019 09:32:26 -0500 Received: by mail-lj1-f194.google.com with SMTP id m6so24332982ljc.1 for ; Wed, 11 Dec 2019 06:32:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=K8M28FWZ9VlZq7WswPyp5ZMZgtOL+Dx4QRXiP5F3k1k=; b=Xf6fTGN1bsyfksNaPXduo8Pc2qK2PU0q2PzWvELovU8f8HXOxIfpr5Dqrf65B8bNEs yjzr0CkaE4PxebeOHz7k4hzRA0Egt6WubaBhy5dGsfem7FTtxIXkn8dIS6PHlaURMWKR zg8ODzl7RqHYPhTJUetsPWl6BM6JtF4ioWq+WAjQP7Tlu8X9/7Xnhn6TyKbahRTizLpH NCFFry0hj5uZgwFaKksBh3JqsMnkuoWrFM5CtYVdjmKnVDsr33X3aEVjN1PCq/PkxpR4 gArn2RfUb6wRd1sn2hMQtKQRHYhTi1ZJgfWZ/VCPQjHvHprSyVrNMYa+LBYhYg+WB5Dp Lx4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=K8M28FWZ9VlZq7WswPyp5ZMZgtOL+Dx4QRXiP5F3k1k=; b=Yezv/NEfZmVJssAGpTVaiWFB4Ao4/H0L8D3+WcawdN/FKGm3Poh4HMqzfED4pcZpWN 9zPlGEHWldETyP486y65Y5ofYthVsmRBurGumAmR8urqzPdrCfhusSIqphpWHe5mhBOq hbHr7Y8btyKLmPb6se8mKXPk01OHNEvuPDbu3yHF7+2xDgepzIxr4uXCIDYclWz7hrSR KutUUOe9KwsHoFFVr4F1jMYB/6oHndT0kmzRZok9x20j8KNGLplPoyLI7RGnanWaFRUH xqfjw18bE3d7mqVuRk+0HNTTKygFPLJAq6pGFZAnX6KOXE5JOUsE2yV32ObFbqjhww+L wExA== X-Gm-Message-State: APjAAAWLl1oT+n6c95/r6Tja56zcP/BmCRXn//qRW6SsYu6EiX/qxcVQ Omd0OIttAk01xUSXC3LqoDSOv3YcH3+Dmvt0oZS7nUsl X-Received: by 2002:a2e:2418:: with SMTP id k24mr2380872ljk.49.1576074743447; Wed, 11 Dec 2019 06:32:23 -0800 (PST) MIME-Version: 1.0 References: <20191211103436.15369-1-marcel@holtmann.org> In-Reply-To: <20191211103436.15369-1-marcel@holtmann.org> From: Alain Michaud Date: Wed, 11 Dec 2019 09:32:12 -0500 Message-ID: Subject: Re: [PATCH] Bluetooth: Remove usage of BT_ERR_RATELIMITED macro To: Marcel Holtmann Cc: BlueZ Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org looks good to me. Thanks for picking it up, I was about to this morning :) On Wed, Dec 11, 2019 at 5:34 AM Marcel Holtmann wrote: > > 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 >