Home
last modified time | relevance | path

Searched hist:"83 d9562b" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/net/wireless/ath/ath6kl/
H A Dwmi.c83d9562b Wed Apr 03 13:49:49 CDT 2019 Gustavo A. R. Silva <gustavo@embeddedor.com> ath6kl: wmi: use struct_size() helper

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, replace code of the following form:

sizeof(*ev) + ev->num_neighbors * sizeof(struct wmi_neighbor_info)

with:

struct_size(ev, neighbor, ev->num_neighbors)

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
83d9562b Wed Apr 03 13:49:49 CDT 2019 Gustavo A. R. Silva <gustavo@embeddedor.com> ath6kl: wmi: use struct_size() helper

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, replace code of the following form:

sizeof(*ev) + ev->num_neighbors * sizeof(struct wmi_neighbor_info)

with:

struct_size(ev, neighbor, ev->num_neighbors)

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>