projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
78baccb
)
habanalabs: remove redundant memset
author
Tom Rix
<trix@redhat.com>
Sat, 7 Jan 2023 18:48:27 +0000
(13:48 -0500)
committer
Oded Gabbay
<ogabbay@kernel.org>
Thu, 26 Jan 2023 09:52:11 +0000
(11:52 +0200)
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 <trix@redhat.com>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/accel/habanalabs/common/habanalabs_ioctl.c
patch
|
blob
|
history
diff --git
a/drivers/accel/habanalabs/common/habanalabs_ioctl.c
b/drivers/accel/habanalabs/common/habanalabs_ioctl.c
index
619d56c
..
949d385
100644
(file)
--- 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);