* [PATCH] staging: erofs: clean up initialization of pointer de
@ 2019-06-17 12:55 Colin King
2019-06-17 13:45 ` Gao Xiang
2019-06-20 8:54 ` Chao Yu
0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2019-06-17 12:55 UTC (permalink / raw)
To: Gao Xiang, Chao Yu, Greg Kroah-Hartman, linux-erofs, devel
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Currently pointer de is being initialized with a value that is
never read and a few statements later de is being re-assigned. Clean
this up by ininitialzing de and removing the re-assignment.
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/staging/erofs/dir.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/erofs/dir.c b/drivers/staging/erofs/dir.c
index 9bbc68729c11..dbf6a151886c 100644
--- a/drivers/staging/erofs/dir.c
+++ b/drivers/staging/erofs/dir.c
@@ -42,10 +42,9 @@ static int erofs_fill_dentries(struct dir_context *ctx,
void *dentry_blk, unsigned int *ofs,
unsigned int nameoff, unsigned int maxsize)
{
- struct erofs_dirent *de = dentry_blk;
+ struct erofs_dirent *de = dentry_blk + *ofs;
const struct erofs_dirent *end = dentry_blk + nameoff;
- de = dentry_blk + *ofs;
while (de < end) {
const char *de_name;
unsigned int de_namelen;
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: erofs: clean up initialization of pointer de
2019-06-17 12:55 [PATCH] staging: erofs: clean up initialization of pointer de Colin King
@ 2019-06-17 13:45 ` Gao Xiang
2019-06-20 8:54 ` Chao Yu
1 sibling, 0 replies; 3+ messages in thread
From: Gao Xiang @ 2019-06-17 13:45 UTC (permalink / raw)
To: Colin King, Chao Yu, Greg Kroah-Hartman
Cc: linux-erofs, devel, kernel-janitors, linux-kernel
On 2019/6/17 20:55, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently pointer de is being initialized with a value that is
> never read and a few statements later de is being re-assigned. Clean
> this up by ininitialzing de and removing the re-assignment.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Loods good for me,
Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Thanks,
Gao Xiang
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: erofs: clean up initialization of pointer de
2019-06-17 12:55 [PATCH] staging: erofs: clean up initialization of pointer de Colin King
2019-06-17 13:45 ` Gao Xiang
@ 2019-06-20 8:54 ` Chao Yu
1 sibling, 0 replies; 3+ messages in thread
From: Chao Yu @ 2019-06-20 8:54 UTC (permalink / raw)
To: Colin King, Gao Xiang, Greg Kroah-Hartman, linux-erofs, devel
Cc: kernel-janitors, linux-kernel
On 2019/6/17 20:55, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently pointer de is being initialized with a value that is
> never read and a few statements later de is being re-assigned. Clean
> this up by ininitialzing de and removing the re-assignment.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Thanks,
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-06-20 8:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-17 12:55 [PATCH] staging: erofs: clean up initialization of pointer de Colin King
2019-06-17 13:45 ` Gao Xiang
2019-06-20 8:54 ` Chao Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).