linux-brain/drivers/gpu/drm/nouveau/nvif
Gustavo A. R. Silva 7b97492555 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 <gustavo@embeddedor.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2019-08-23 12:55:31 +10:00
..
Kbuild drm/nouveau: fix bogus GPL-2 license header 2019-07-19 16:26:51 +10:00
client.c drm/nouveau/core/client: allow creation of subclients 2017-02-17 15:15:00 +10:00
device.c drm/nouveau/fifo/gv100: initial support 2018-05-18 15:01:46 +10:00
disp.c drm/nouveau/disp/tu102: rename implementation from tu104 2019-02-20 08:59:58 +10:00
driver.c drm/nouveau/core/client: allow creation of subclients 2017-02-17 15:15:00 +10:00
fifo.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
mem.c drm/nouveau/disp/nv50-: pass nvkm_memory objects for channel push buffers 2018-05-18 15:01:21 +10:00
mmu.c drm/nouveau/mmu: use struct_size() helper 2019-08-23 12:55:31 +10:00
notify.c drm/nouveau: fix notify data leak 2016-11-07 14:04:37 +10:00
object.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
user.c drm/nouveau/fifo/gv100: initial support 2018-05-18 15:01:46 +10:00
userc361.c drm/nouveau/fifo/gv100: initial support 2018-05-18 15:01:46 +10:00
vmm.c drm/nouveau/mmu: support initialisation of client-managed address-spaces 2019-02-20 09:00:00 +10:00