linux_dsm_epyc7002/drivers/usb/wusbcore
Gustavo A. R. Silva 01bdf01c7b usb: wusbcore: wa-xfer: 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, change the following form:

sizeof(*packet_desc) + (sizeof(packet_desc->PacketLength[0]) * seg->isoc_frame_count)

to :

struct_size(packet_status, PacketStatus, seg->isoc_frame_count);

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-19 14:41:38 +01:00
..
cbaf.c USB: wusbcore: Remove redundant license text 2017-11-07 15:45:01 +01:00
crypto.c crypto: drop mask=CRYPTO_ALG_ASYNC from 'cipher' tfm allocations 2018-11-20 14:26:55 +08:00
dev-sysfs.c USB: wusbcore: Remove redundant license text 2017-11-07 15:45:01 +01:00
devconnect.c USB: wusbcore: Remove redundant license text 2017-11-07 15:45:01 +01:00
Kconfig USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mmc.c USB: wusbcore: Remove redundant license text 2017-11-07 15:45:01 +01:00
pal.c USB: wusbcore: Remove redundant license text 2017-11-07 15:45:01 +01:00
reservation.c USB: wusbcore: Remove redundant license text 2017-11-07 15:45:01 +01:00
rh.c USB: wusbcore: Remove redundant license text 2017-11-07 15:45:01 +01:00
security.c usb: wusbcore: security: cast sizeof to int for comparison 2018-07-02 18:08:19 +02:00
wa-hc.c USB: wusbcore: Remove redundant license text 2017-11-07 15:45:01 +01:00
wa-hc.h USB: wusbcore: Remove redundant license text 2017-11-07 15:45:01 +01:00
wa-nep.c USB: wusbcore: remove redundant re-assignment to pointer 'dev' 2018-03-09 09:16:19 -08:00
wa-rpipe.c USB: wusbcore: Switch to bitmap_zalloc() 2018-09-10 20:08:21 +02:00
wa-xfer.c usb: wusbcore: wa-xfer: use struct_size() helper 2019-02-19 14:41:38 +01:00
wusbhc.c USB: wusbcore: Remove redundant license text 2017-11-07 15:45:01 +01:00
wusbhc.h USB: wusbcore: Remove redundant license text 2017-11-07 15:45:01 +01:00