All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: David Miller <davem@davemloft.net>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>,
	"open list:NETWORKING [GENERAL]" <netdev@vger.kernel.org>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Subject: Re: [PATCH 01/15] skbuff: introduce skb_pull_data
Date: Tue, 30 Nov 2021 18:16:02 -0800	[thread overview]
Message-ID: <CABBYNZJGpswn03StZb97XQOUu5rj2_GGkj-UdZWdQOwuWwNVXQ@mail.gmail.com> (raw)
In-Reply-To: <20211130171105.64d6cf36@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>

Hi Jakub,

On Tue, Nov 30, 2021 at 5:11 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Tue, 30 Nov 2021 16:02:01 -0800 Luiz Augusto von Dentz wrote:
> > From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> >
> > Like skb_pull but returns the original data pointer before pulling the
> > data after performing a check against sbk->len.
> >
> > This allows to change code that does "struct foo *p = (void *)skb->data;"
> > which is hard to audit and error prone, to:
> >
> >         p = skb_pull_data(skb, sizeof(*p));
> >         if (!p)
> >                 return;
> >
> > Which is both safer and cleaner.
>
> It doesn't take a data pointer, so not really analogous to
> skb_put_data() and friends which come to mind. But I have
> no better naming suggestions. You will need to respin, tho,
> if you want us to apply these directly, the patches as posted
> don't apply to either netdev tree.

I cross posted it to net-dev just in case you guys had some strong
opinions on introducing such a function, it was in fact suggested by
Dan but I also didn't find a better name so I went with it, if you
guys prefer we can merge it in bluetooth-next first as usual.

-- 
Luiz Augusto von Dentz

  reply	other threads:[~2021-12-01  2:16 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01  0:02 [PATCH 00/15] Rework parsing of HCI events Luiz Augusto von Dentz
2021-12-01  0:02 ` [PATCH 01/15] skbuff: introduce skb_pull_data Luiz Augusto von Dentz
2021-12-01  1:11   ` Jakub Kicinski
2021-12-01  2:16     ` Luiz Augusto von Dentz [this message]
2021-12-01  2:27       ` Jakub Kicinski
2021-12-01  7:22         ` Marcel Holtmann
2021-12-01 15:22           ` Jakub Kicinski
2021-12-01  5:20   ` Dan Carpenter
2021-12-01  0:02 ` [PATCH 02/15] Bluetooth: HCI: Use skb_pull_data to parse BR/EDR events Luiz Augusto von Dentz
2021-12-01 15:06   ` kernel test robot
2021-12-01 15:06     ` kernel test robot
2021-12-01  0:02 ` [PATCH 03/15] Bluetooth: HCI: Use skb_pull_data to parse Command Complete event Luiz Augusto von Dentz
2021-12-01  0:02 ` [PATCH 04/15] Bluetooth: HCI: Use skb_pull_data to parse Number of Complete Packets event Luiz Augusto von Dentz
2021-12-01  0:02 ` [PATCH 05/15] Bluetooth: HCI: Use skb_pull_data to parse Inquiry Result event Luiz Augusto von Dentz
2021-12-01  0:02 ` [PATCH 06/15] Bluetooth: HCI: Use skb_pull_data to parse Inquiry Result with RSSI event Luiz Augusto von Dentz
2021-12-01  0:02 ` [PATCH 07/15] Bluetooth: HCI: Use skb_pull_data to parse Extended Inquiry Result event Luiz Augusto von Dentz
2021-12-01  0:02 ` [PATCH 08/15] Bluetooth: HCI: Use skb_pull_data to parse LE Metaevents Luiz Augusto von Dentz
2021-12-01  0:02 ` [PATCH 09/15] Bluetooth: HCI: Use skb_pull_data to parse LE Advertising Report event Luiz Augusto von Dentz
2021-12-01  0:02 ` [PATCH 10/15] Bluetooth: HCI: Use skb_pull_data to parse LE Ext " Luiz Augusto von Dentz
2021-12-01  0:02 ` [PATCH 11/15] Bluetooth: HCI: Use skb_pull_data to parse LE Direct " Luiz Augusto von Dentz
2021-12-01  0:02 ` [PATCH 12/15] Bluetooth: hci_event: Use of a function table to handle HCI events Luiz Augusto von Dentz
2021-12-01  1:54   ` kernel test robot
2021-12-01  1:54     ` kernel test robot
2021-12-01  3:22   ` kernel test robot
2021-12-01  3:22     ` kernel test robot
2021-12-01  3:22   ` kernel test robot
2021-12-01  3:22     ` kernel test robot
2022-01-25 14:46   ` Mike Lothian
2022-03-12  1:56     ` Mike Lothian
2022-03-12 14:45       ` Dan Carpenter
2022-03-14 13:14         ` Mike Lothian
2021-12-01  0:02 ` [PATCH 13/15] Bluetooth: hci_event: Use of a function table to handle LE subevents Luiz Augusto von Dentz
2021-12-01  0:02 ` [PATCH 14/15] Bluetooth: hci_event: Use of a function table to handle Command Complete Luiz Augusto von Dentz
2021-12-01  0:02 ` [PATCH 15/15] Bluetooth: hci_event: Use of a function table to handle Command Status Luiz Augusto von Dentz

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=CABBYNZJGpswn03StZb97XQOUu5rj2_GGkj-UdZWdQOwuWwNVXQ@mail.gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.von.dentz@intel.com \
    --cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.