ext4/inode.c: remove dead stores in mpage_process_page()
PATCH 1/1 ext4/inode.c: remove dead stores in mpage_process_page()
The command "make clang-analyzer" detected dead stores.
Removed the all the assignments io_end_size=0 to fix dead stores, as io_end_size is never read.
--- fs/ext4/inode.c | 2 -- 1 file changed, 2 deletions(-)
fs/ext4/inode.c +0 -2
@@ -2260,7 +2260,6 @@ static int mpage_process_page(struct mpage_da_data *mpd, struct page *page, mpd->map.m_len =0 ; mpd->map.m_flags =0 ; io_end_vec->size += io_end_size; - io_end_size =0 ; err =mpage_process_page_bufs (mpd, head, bh, lblk);if (err >0 )
@@ -2285,7 +2284,6 @@ static int mpage_process_page(struct mpage_da_data *mpd, struct page *page, }while (lblk++, (bh = bh->b_this_page) != head); io_end_vec->size += io_end_size; - io_end_size =0 ; *map_bh = false; out: *m_lblk = lblk;
Signature · 11 lines
2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#252): https://lists.elisa.tech/g/linux-safety/message/252 Mute This Topic: https://lists.elisa.tech/mt/86480121/5278000 Group Owner: [email protected] Unsubscribe: https://lists.elisa.tech/g/linux-safety/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
Quoted 3 lines · Nghia Le
The command "make clang-analyzer" detected dead stores.
Use present tense here. s/detected/detects/
Quoted 3 lines
Removed the all the assignments io_end_size=0 to fix dead stores, as
io_end_sizeis never read.
Use imperative here. So: s/Removed/Remove/
drop the first "the".
Maybe a better wording is:
Do not reset io_end_size to 0 in the current paths, as the function exists on those paths without further using io_end_size.
... and the subject line could be "ext4: remove useless resetting io_end_size in mpage_process_page()".
I hope this helps.
Lukas
Quoted 28 lines
Signed-off-by Nghia Le <[email protected]>--- fs/ext4/inode.c | 2 -- 1 file changed, 2 deletions(-)fs/ext4/inode.c +0
-3@@ -2260,7 +2260,6 @@ static int mpage_process_page(struct mpage_da_data *mpd, struct page *page, mpd->map.m_len =0 ; mpd->map.m_flags =0 ; io_end_vec->size += io_end_size; - io_end_size =0 ; err =mpage_process_page_bufs (mpd, head, bh, lblk);if (err >0 )@@ -2285,7 +2284,6 @@ static int mpage_process_page(struct mpage_da_data *mpd, struct page *page, }while (lblk++, (bh = bh->b_this_page) != head); io_end_vec->size += io_end_size; - io_end_size =0 ; *map_bh = false; out: *m_lblk = lblk; --2.25.1
Dear Lukas,
Thanks for your comments, I submitted patch v2 for the revision Best regards,
Nghia Le
Quoted 59 lines · Lukas Bulwahn
Quoted 3 lines · Nghia Le
The command "make clang-analyzer" detected dead stores.
Use present tense here. s/detected/detects/
Quoted 3 lines
Removed the all the assignments io_end_size=0 to fix dead stores, as
io_end_sizeis never read.Use imperative here. So: s/Removed/Remove/
drop the first "the".
Maybe a better wording is:
Do not reset
io_end_sizeto 0 in the current paths, as the function exists on those paths without further usingio_end_size.... and the subject line could be "ext4: remove useless resetting
io_end_sizeinmpage_process_page()".I hope this helps.
Lukas
fs/ext4/inode.c static int mpage_process_page(struct mpage_da_data
Quoted 10 lines
Signed-off-by Nghia Le <[email protected]>--- fs/ext4/inode.c | 2 -- 1 file changed, 2 deletions(-)fs/ext4/inode.c +0
-0@@ -2260,7 +2260,6 @@ static int mpage_process_page(struct mpage_da_data*mpd, struct page *page,
fs/ext4/inode.c static int mpage_process_page(struct mpage_da_data *mpd, struct page *page,
Quoted 6 lines
fs/ext4/inode.c +0
-1mpd->map.m_len =0 ; mpd->map.m_flags =0 ; io_end_vec->size += io_end_size; - io_end_size =0 ; err = mpage_process_page_bufs(mpd, head, bh,lblk);
fs/ext4/inode.c static int mpage_process_page(struct mpage_da_data
Quoted 2 lines
fs/ext4/inode.c +0
-0if (err >0 )@@ -2285,7 +2284,6 @@ static int mpage_process_page(struct mpage_da_data*mpd, struct page *page,
Quoted 10 lines
fs/ext4/inode.c +0
-2}while (lblk++, (bh = bh->b_this_page) != head); io_end_vec->size += io_end_size; - io_end_size =0 ; *map_bh = false; out: *m_lblk = lblk; --2.25.1