Re: [PATCH] ext4/inode.c: remove dead stores in mpage_process_page()
Nghia Le <[email protected]> Fri, 22 Oct 2021 00:46:24 +0700
| Newsgroups | tech.elisa.lists.linux-safety |
|---|---|
| Message-ID | <CADkY59vMu_MnDR3rH7EC_-wapFRELahveRQ2iHfO9oewBjCdiA@mail.gmail.com> |
--000000000000de4c7d05cee079b1 Content-Type: text/plain; charset="UTF-8" Dear Lukas, Thanks for your comments, I submitted patch v2 for the revision Best regards, Nghia Le On Thu, Oct 21, 2021 at 10:57 PM Lukas Bulwahn <[email protected]> wrote: > On Thu, Oct 21, 2021 at 2:50 AM Nghia Le <[email protected]> wrote: > > > > The command "make clang-analyzer" detected dead stores. > > > > Use present tense here. s/detected/detects/ > > > Removed the all the assignments io_end_size=0 to fix dead stores, as > > io_end_size is 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 > > > Signed-off-by: Nghia Le <[email protected]> > > --- > > fs/ext4/inode.c | 2 -- > > 1 file changed, 2 deletions(-) > > > > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > > index 0f06305167d5..03efed2ed1ea 100644 > > --- a/fs/ext4/inode.c > > +++ b/fs/ext4/inode.c > > @@ -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 > > > --000000000000de4c7d05cee079b1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Dear Lukas,<div>Thanks for your comments, I submitted=C2= =A0 patch v2 for the revision</div><div>Best regards,</div><div>Nghia Le</d= iv></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_att= r">On Thu, Oct 21, 2021 at 10:57 PM Lukas Bulwahn <<a href=3D"mailto:luk= [email protected]">[email protected]</a>> wrote:<br></div><bloc= kquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:= 1px solid rgb(204,204,204);padding-left:1ex">On Thu, Oct 21, 2021 at 2:50 A= M Nghia Le <<a href=3D"mailto:[email protected]" target=3D"_blank">ngh= [email protected]</a>> wrote:<br> ><br> > The command "make clang-analyzer" detected dead stores.<br> ><br> <br> Use present tense here. s/detected/detects/<br> <br> > Removed the all the assignments io_end_size=3D0 to fix dead stores, as= <br> > io_end_size is never read.<br> ><br> <br> Use imperative here. So: s/Removed/Remove/<br> <br> drop the first "the".<br> <br> Maybe a better wording is:<br> <br> Do not reset io_end_size to 0 in the current paths, as the function<br> exists on those paths without further using io_end_size.<br> <br> ... and the subject line could be "ext4: remove useless resetting<br> io_end_size in mpage_process_page()".<br> <br> I hope this helps.<br> <br> Lukas<br> <br> > Signed-off-by: Nghia Le <<a href=3D"mailto:[email protected]" tar= get=3D"_blank">[email protected]</a>><br> > ---<br> >=C2=A0 fs/ext4/inode.c | 2 --<br> >=C2=A0 1 file changed, 2 deletions(-)<br> ><br> > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c<br> > index 0f06305167d5..03efed2ed1ea 100644<br> > --- a/fs/ext4/inode.c<br> > +++ b/fs/ext4/inode.c<br> > @@ -2260,7 +2260,6 @@ static int mpage_process_page(struct mpage_da_da= ta *mpd, struct page *page,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0mpd->map.m_len =3D 0;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0mpd->map.m_flags =3D 0;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0io_end_vec->size +=3D io_end_size;<br> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0io_end_size =3D 0;<br> ><br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0err =3D mpage_process_page_bufs(mpd, head, bh, lblk);<b= r> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0if (err > 0)<br> > @@ -2285,7 +2284,6 @@ static int mpage_process_page(struct mpage_da_da= ta *mpd, struct page *page,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} while (lblk++, (bh =3D bh->b_thi= s_page) !=3D head);<br> ><br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0io_end_vec->size +=3D io_end_size;= <br> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0io_end_size =3D 0;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*map_bh =3D false;<br> >=C2=A0 out:<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*m_lblk =3D lblk;<br> > --<br> > 2.25.1<br> ><br> </blockquote></div> --000000000000de4c7d05cee079b1--