OSDN Git Service

ethernet: ti: am65-cpsw-qos: Use struct_size() in devm_kzalloc()
authorGustavo A. R. Silva <gustavoars@kernel.org>
Fri, 19 Jun 2020 17:37:15 +0000 (12:37 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 19 Jun 2020 20:42:08 +0000 (13:42 -0700)
commitf362b70bd67add130ae4321306b62237356889a4
treeaf25ce1b2fe60bbd61b86986c8f3f27bae519c9a
parentcc7a21b6fbd945f8d8f61422ccd27203c1fafeb7
ethernet: ti: am65-cpsw-qos: Use struct_size() in devm_kzalloc()

Make use of the struct_size() helper instead of an open-coded version
in order to avoid any potential type mistakes. Also, remove unnecessary
variable _size_.

This code was detected with the help of Coccinelle and, audited and
fixed manually.

Addresses-KSPP-ID: https://github.com/KSPP/linux/issues/83
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/am65-cpsw-qos.c