Thread (5 messages) 5 messages, 3 authors, 2021-07-27

Re: [PATCH] Bluetooth: use helper function for monitor's open/close notifications

From: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Date: 2021-07-26 20:40:15

On 2021/07/27 2:40, Luiz Augusto von Dentz wrote:
quoted
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 786a06a232fd..fc2336855dab 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -295,6 +295,11 @@ void hci_send_to_channel(unsigned short channel, struct sk_buff *skb,
        read_unlock(&hci_sk_list.lock);
 }

+static void __hci_send_to_monitor(struct sk_buff *skb)
+{
We can probably have the checks of NULL skb added directly here and
perhaps kfree_skb as well since it seems it is always a copy that is
sent here,
The NULL skb check is in hci_monitor_ctrl_open() and hci_monitor_ctrl_close().
The purpose of __hci_send_to_monitor() is to hide common arguments.
           the hci_send_to_monitor don't have __ prefix so I wonder
why you have chosen to use it?
Only to avoid name conflict with hci_send_to_monitor(). I thought that
the __ prefix is fine because hci_send_to_monitor() also calls this function.
Please suggest whatever name you want to use.
quoted
+       hci_send_to_channel(HCI_CHANNEL_MONITOR, skb, HCI_SOCK_TRUSTED, NULL);
+}
+
 /* Send frame to monitor socket */
 void hci_send_to_monitor(struct hci_dev *hdev, struct sk_buff *skb)
 {
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help