linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Marcel Holtmann <marcel@holtmann.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH] Bluetooth: use helper function for monitor's open/close notifications
Date: Tue, 27 Jul 2021 05:39:55 +0900	[thread overview]
Message-ID: <e51b7339-a432-de99-89a9-d97be776ee5d@i-love.sakura.ne.jp> (raw)
In-Reply-To: <CABBYNZLw-1xofLwsNYEcb7auN6KorPTLh3ZOWFR4V6n4knOT-g@mail.gmail.com>

On 2021/07/27 2:40, Luiz Augusto von Dentz wrote:
>> 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.

> 
>> +       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)
>>  {


  reply	other threads:[~2021-07-26 20:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-24 14:03 [PATCH] Bluetooth: use helper function for monitor's open/close notifications Tetsuo Handa
2021-07-26 17:40 ` Luiz Augusto von Dentz
2021-07-26 20:39   ` Tetsuo Handa [this message]
2021-07-26 21:26     ` Luiz Augusto von Dentz
2021-07-27  2:09 ` bluez.test.bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e51b7339-a432-de99-89a9-d97be776ee5d@i-love.sakura.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).