summaryrefslogtreecommitdiff
path: root/drivers/dma-buf/dma-resv.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2020-10-08 11:03:22 +0300
committerChristian König <christian.koenig@amd.com>2020-10-08 16:39:36 +0300
commit82e1b93ad8b95a1667708164220ed137d6f3adfb (patch)
tree9d3787c0cb87287ac1b2b3a283cfdc4ab624c290 /drivers/dma-buf/dma-resv.c
parent1a11a88cfd9a97e13be8bc880c4795f9844fbbec (diff)
downloadlinux-82e1b93ad8b95a1667708164220ed137d6f3adfb.tar.xz
dma-buf: use struct_size macro
Instead of manually calculating the structure size. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/394252/
Diffstat (limited to 'drivers/dma-buf/dma-resv.c')
-rw-r--r--drivers/dma-buf/dma-resv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma-buf/dma-resv.c b/drivers/dma-buf/dma-resv.c
index 1c8f2581cb09..bb5a42b10c29 100644
--- a/drivers/dma-buf/dma-resv.c
+++ b/drivers/dma-buf/dma-resv.c
@@ -63,7 +63,7 @@ static struct dma_resv_list *dma_resv_list_alloc(unsigned int shared_max)
{
struct dma_resv_list *list;
- list = kmalloc(offsetof(typeof(*list), shared[shared_max]), GFP_KERNEL);
+ list = kmalloc(struct_size(list, shared, shared_max), GFP_KERNEL);
if (!list)
return NULL;