diff options
author | Gustavo A. R. Silva <[email protected]> | 2019-05-24 12:15:36 -0500 |
---|---|---|
committer | Ben Skeggs <[email protected]> | 2019-08-23 12:55:31 +1000 |
commit | 7b97492555b1063417c143d2c22c503f6299c0b0 (patch) | |
tree | cc08a7beb52de51319b80178008938cf6e1885c0 /net/switchdev/switchdev.c | |
parent | 690ae20c0426f8a6f48d2c285a53c465ebcb0c1f (diff) |
drm/nouveau/mmu: 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 the following form:
sizeof(*kind) + sizeof(*kind->data) * mmu->kind_nr;
with:
struct_size(kind, data, mmu->kind_nr)
This code was detected with the help of Coccinelle.
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Ben Skeggs <[email protected]>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions