linux-safety.lists.elisa.tech archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4/inode.c: remove dead stores in mpage_process_page()
@ 2021-10-21  0:49 Nghia Le
  2021-10-21  0:49 ` [linux-safety] " Nghia Le
  2021-10-21 15:57 ` Lukas Bulwahn
  0 siblings, 2 replies; 6+ messages in thread
From: Nghia Le @ 2021-10-21  0:49 UTC (permalink / raw)
  To: linux-safety; +Cc: Nghia Le, lukas.bulwahn

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.

Signed-off-by: Nghia Le <nghialm78@gmail.com>
---
 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



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [linux-safety] [PATCH] ext4/inode.c: remove dead stores in mpage_process_page()
  2021-10-21  0:49 [PATCH] ext4/inode.c: remove dead stores in mpage_process_page() Nghia Le
@ 2021-10-21  0:49 ` Nghia Le
  2021-10-21 15:57 ` Lukas Bulwahn
  1 sibling, 0 replies; 6+ messages in thread
From: Nghia Le @ 2021-10-21  0:49 UTC (permalink / raw)
  To: linux-safety; +Cc: Nghia Le, lukas.bulwahn

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.

Signed-off-by: Nghia Le <nghialm78@gmail.com>
---
 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



-=-=-=-=-=-=-=-=-=-=-=-
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: linux-safety+owner@lists.elisa.tech
Unsubscribe: https://lists.elisa.tech/g/linux-safety/unsub [linux-safety@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ext4/inode.c: remove dead stores in mpage_process_page()
  2021-10-21  0:49 [PATCH] ext4/inode.c: remove dead stores in mpage_process_page() Nghia Le
  2021-10-21  0:49 ` [linux-safety] " Nghia Le
@ 2021-10-21 15:57 ` Lukas Bulwahn
  2021-10-21 15:57   ` [linux-safety] " Lukas Bulwahn
  2021-10-21 17:46   ` Nghia Le
  1 sibling, 2 replies; 6+ messages in thread
From: Lukas Bulwahn @ 2021-10-21 15:57 UTC (permalink / raw)
  To: Nghia Le; +Cc: linux-safety

On Thu, Oct 21, 2021 at 2:50 AM Nghia Le <nghialm78@gmail.com> 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 <nghialm78@gmail.com>
> ---
>  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
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-safety] [PATCH] ext4/inode.c: remove dead stores in mpage_process_page()
  2021-10-21 15:57 ` Lukas Bulwahn
@ 2021-10-21 15:57   ` Lukas Bulwahn
  2021-10-21 17:46   ` Nghia Le
  1 sibling, 0 replies; 6+ messages in thread
From: Lukas Bulwahn @ 2021-10-21 15:57 UTC (permalink / raw)
  To: Nghia Le; +Cc: linux-safety

On Thu, Oct 21, 2021 at 2:50 AM Nghia Le <nghialm78@gmail.com> 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 <nghialm78@gmail.com>
> ---
>  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
>


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#253): https://lists.elisa.tech/g/linux-safety/message/253
Mute This Topic: https://lists.elisa.tech/mt/86480121/5278000
Group Owner: linux-safety+owner@lists.elisa.tech
Unsubscribe: https://lists.elisa.tech/g/linux-safety/unsub [linux-safety@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ext4/inode.c: remove dead stores in mpage_process_page()
  2021-10-21 15:57 ` Lukas Bulwahn
  2021-10-21 15:57   ` [linux-safety] " Lukas Bulwahn
@ 2021-10-21 17:46   ` Nghia Le
  2021-10-21 17:46     ` [linux-safety] " Nghia Le
  1 sibling, 1 reply; 6+ messages in thread
From: Nghia Le @ 2021-10-21 17:46 UTC (permalink / raw)
  To: Lukas Bulwahn; +Cc: linux-safety

[-- Attachment #1: Type: text/plain, Size: 1903 bytes --]

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 <lukas.bulwahn@gmail.com>
wrote:

> On Thu, Oct 21, 2021 at 2:50 AM Nghia Le <nghialm78@gmail.com> 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 <nghialm78@gmail.com>
> > ---
> >  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
> >
>

[-- Attachment #2: Type: text/html, Size: 2764 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-safety] [PATCH] ext4/inode.c: remove dead stores in mpage_process_page()
  2021-10-21 17:46   ` Nghia Le
@ 2021-10-21 17:46     ` Nghia Le
  0 siblings, 0 replies; 6+ messages in thread
From: Nghia Le @ 2021-10-21 17:46 UTC (permalink / raw)
  To: Lukas Bulwahn; +Cc: linux-safety

[-- Attachment #1: Type: text/plain, Size: 2290 bytes --]

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 <lukas.bulwahn@gmail.com>
wrote:

> On Thu, Oct 21, 2021 at 2:50 AM Nghia Le <nghialm78@gmail.com> 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 <nghialm78@gmail.com>
> > ---
> >  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
> >
>


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#255): https://lists.elisa.tech/g/linux-safety/message/255
Mute This Topic: https://lists.elisa.tech/mt/86480121/5278000
Group Owner: linux-safety+owner@lists.elisa.tech
Unsubscribe: https://lists.elisa.tech/g/linux-safety/unsub [linux-safety@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 3968 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-21 17:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21  0:49 [PATCH] ext4/inode.c: remove dead stores in mpage_process_page() Nghia Le
2021-10-21  0:49 ` [linux-safety] " Nghia Le
2021-10-21 15:57 ` Lukas Bulwahn
2021-10-21 15:57   ` [linux-safety] " Lukas Bulwahn
2021-10-21 17:46   ` Nghia Le
2021-10-21 17:46     ` [linux-safety] " Nghia Le

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).