Message ID | 20201229135213.23757-1-zhengyongjun3@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [-next] drm/i915: Use kzalloc for allocating only one thing | expand |
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;
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(-)