[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1DF08879-5FE4-42CA-AF1B-5404D66E9E9E@holtmann.org>
Date: Mon, 18 Feb 2019 14:00:38 +0100
From: Marcel Holtmann <marcel@...tmann.org>
To: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Cc: Johan Hedberg <johan.hedberg@...il.com>,
"David S. Miller" <davem@...emloft.net>,
linux-bluetooth@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] Bluetooth: hci_event: Use struct_size() helper
Hi Gustavo,
> Make use of the struct_size() helper instead of an open-coded version
> in order to avoid any potential type mistakes, in particular in the
> context in which this code is being used.
>
> So, change the following form:
>
> sizeof(*ev) + ev->num_hndl * sizeof(struct hci_comp_pkts_info)
>
> to :
>
> struct_size(ev, handles, ev->num_hndl)
>
> This code was detected with the help of Coccinelle.
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
> ---
> net/bluetooth/hci_event.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
Powered by blists - more mailing lists