lkml.org 
[lkml]   [2020]   [Dec]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -next] drm/i915: Use kzalloc for allocating only one thing
Date
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
@@

- kcalloc(1,
+ kzalloc(
...)
// </smpl>

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
index f88473d396f4..6994b167d0c8 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
@@ -415,7 +415,7 @@ static int igt_evict_contexts(void *arg)
struct reserved *r;

mutex_unlock(&ggtt->vm.mutex);
- r = kcalloc(1, sizeof(*r), GFP_KERNEL);
+ r = kzalloc(sizeof(*r), GFP_KERNEL);
mutex_lock(&ggtt->vm.mutex);
if (!r) {
err = -ENOMEM;
--
2.22.0
\
 
 \ /
  Last update: 2020-12-29 14:57    [W:0.021 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site