From: Tom Rix Date: Sat, 7 Jan 2023 18:48:27 +0000 (-0500) Subject: habanalabs: remove redundant memset X-Git-Tag: v6.3-rc1~135^2~18^2~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7d7b9aca2423d243748361cfb72e7fbdb8b37b9;p=thirdparty%2Fkernel%2Flinux.git habanalabs: remove redundant memset From reviewing the code, the line memset(kdata, 0, usize); is not needed because kdata is either zeroed by kdata = kzalloc(asize, GFP_KERNEL); when allocated at runtime or by char stack_kdata[128] = {0}; at compile time. Signed-off-by: Tom Rix Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- diff --git a/drivers/accel/habanalabs/common/habanalabs_ioctl.c b/drivers/accel/habanalabs/common/habanalabs_ioctl.c index 619d56c40b303..949d385271603 100644 --- a/drivers/accel/habanalabs/common/habanalabs_ioctl.c +++ b/drivers/accel/habanalabs/common/habanalabs_ioctl.c @@ -1123,8 +1123,6 @@ static long _hl_ioctl(struct file *filep, unsigned int cmd, unsigned long arg, retcode = -EFAULT; goto out_err; } - } else if (cmd & IOC_OUT) { - memset(kdata, 0, usize); } retcode = func(hpriv, kdata);