From: Jiri Pirko <[email protected]>

Use designated initializer for dma_heap_export_info instead of
separate field assignments and avoid the need to explicitly
zero fields in preparation to follow-up patch.

Signed-off-by: Jiri Pirko <[email protected]>
---
 drivers/dma-buf/heaps/cma_heap.c    | 7 ++++---
 drivers/dma-buf/heaps/system_heap.c | 9 ++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/dma-buf/heaps/cma_heap.c b/drivers/dma-buf/heaps/cma_heap.c
index 42f88193eab9..d12c98be7fa9 100644
--- a/drivers/dma-buf/heaps/cma_heap.c
+++ b/drivers/dma-buf/heaps/cma_heap.c
@@ -388,7 +388,10 @@ static const struct dma_heap_ops cma_heap_ops = {
 
 static int __init __add_cma_heap(struct cma *cma, const char *name)
 {
-       struct dma_heap_export_info exp_info;
+       struct dma_heap_export_info exp_info = {
+               .name = name,
+               .ops = &cma_heap_ops,
+       };
        struct cma_heap *cma_heap;
 
        cma_heap = kzalloc(sizeof(*cma_heap), GFP_KERNEL);
@@ -396,8 +399,6 @@ static int __init __add_cma_heap(struct cma *cma, const 
char *name)
                return -ENOMEM;
        cma_heap->cma = cma;
 
-       exp_info.name = name;
-       exp_info.ops = &cma_heap_ops;
        exp_info.priv = cma_heap;
 
        cma_heap->heap = dma_heap_add(&exp_info);
diff --git a/drivers/dma-buf/heaps/system_heap.c 
b/drivers/dma-buf/heaps/system_heap.c
index 4c782fe33fd4..124dca56e4d8 100644
--- a/drivers/dma-buf/heaps/system_heap.c
+++ b/drivers/dma-buf/heaps/system_heap.c
@@ -427,13 +427,12 @@ static const struct dma_heap_ops system_heap_ops = {
 
 static int __init system_heap_create(void)
 {
-       struct dma_heap_export_info exp_info;
+       struct dma_heap_export_info exp_info = {
+               .name = "system",
+               .ops = &system_heap_ops,
+       };
        struct dma_heap *sys_heap;
 
-       exp_info.name = "system";
-       exp_info.ops = &system_heap_ops;
-       exp_info.priv = NULL;
-
        sys_heap = dma_heap_add(&exp_info);
        if (IS_ERR(sys_heap))
                return PTR_ERR(sys_heap);
-- 
2.51.1

Reply via email to