From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EC99C433FE for ; Thu, 21 Oct 2021 17:46:39 +0000 (UTC) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) by mx.groups.io with SMTP id smtpd.web09.1250.1634838398131644274 for ; Thu, 21 Oct 2021 10:46:38 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dNuy6+bz; spf=pass (domain: gmail.com, ip: 209.85.208.172, mailfrom: nghialm78@gmail.com) Received: by mail-lj1-f172.google.com with SMTP id q16so711351ljg.3 for ; Thu, 21 Oct 2021 10:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=veOpaI2lq7Avo3H4TlvtOuH0NziWVw+uIveWwX3gX3o=; b=dNuy6+bzHWDIA/x8OiF33HgYLNOfyKs8xFy3dDzfe+i+mNRRuEFgNGESqb6aghf8LU IXmWcZYbcLjSr6YHOfBqGQGFmZIa385a6/cOIoFVHYJzh2GqJHY9SANT3P6N1+m0xQti udyeiky69BijxvdHnEYGMjMFH6S5/fFYzXhwCrlTsMODCSOroRTsIh0TK/ioclxNyqbq hqvtMipPzdB85l+suxurIKhg5AlUmPS6Q55Hq+DAXkU1qzBqxqEtbyk0bcO1VlRq5Obi Kh8jmyRNE07V7Qi2D7LwUqaE33ggY++MAY47FTsOVsQ53KeFQL0IdXzrI0qu4dMkXM8f qZRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=veOpaI2lq7Avo3H4TlvtOuH0NziWVw+uIveWwX3gX3o=; b=Ij/jidD0OdceVC5FgRr8NllHSc6v+nbx/1MK11vfcc8z2bTWxaJq/YRdtqSfCfEycW q/p8jLn/KUhBL5Iq+OrSBL8ls+j1djkEdASyoZQetMJ5ShtXvhQH0nPSqzVjUNmtSgGY 3fZ9p8nVXnb1J68bCNeVC0HT98PO/7fuVNrTExFkGxdQHAc+hu/TB1JmyWROjTiOf5xu Ubux8ymdUXEM0V06geZz1NUue2rASe7CnhiU+dnItg791F5mi4lZBlCpVLBViG0iyelJ OJneisjGGbPfe0LyAonaUCsm4hb0kria6ZjxeWOYR/YpYp0YYPD0U60q/O8h68V9l+9l HYHw== X-Gm-Message-State: AOAM533GwZZ/Az8IQa3exv8sFrVINCvBlAXMuv2qICh+zXD9Z+LJ9X0N WQGZn4yKUUupk04QJkxP7uDXB9NeYTcmRuOQjwU= X-Google-Smtp-Source: ABdhPJx3XS1zOV0qpUFRWAAfzIIazR7r5bzEgglEeUmFsktAPr2YdfZr7sVH/R7xn4Rl56HyLqB6SlkmzxKIlDWagkg= X-Received: by 2002:a2e:3001:: with SMTP id w1mr7623686ljw.45.1634838396160; Thu, 21 Oct 2021 10:46:36 -0700 (PDT) MIME-Version: 1.0 References: <20211021004914.17239-1-nghialm78@gmail.com> In-Reply-To: From: Nghia Le Date: Fri, 22 Oct 2021 00:46:24 +0700 Message-ID: Subject: Re: [PATCH] ext4/inode.c: remove dead stores in mpage_process_page() To: Lukas Bulwahn Cc: linux-safety@lists.elisa.tech Content-Type: multipart/alternative; boundary="000000000000de4c7d05cee079b1" List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 21 Oct 2021 17:46:39 -0000 X-Groupsio-URL: https://lists.elisa.tech/g/linux-safety/message/255 --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 wrote: > On Thu, Oct 21, 2021 at 2:50 AM Nghia Le 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 > > --- > > 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
Dear Lukas,
Thanks for your comments, I submitted=C2= =A0 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 A= M Nghia Le <ngh= ialm78@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=3D0 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>
> ---
>=C2=A0 fs/ext4/inode.c | 2 --
>=C2=A0 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_da= ta *mpd, struct page *page,
>=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;
>=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;
>=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;
> -=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;
>
>=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); >=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)
> @@ -2285,7 +2284,6 @@ static int mpage_process_page(struct mpage_da_da= ta *mpd, struct page *page,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} while (lblk++, (bh =3D bh->b_thi= s_page) !=3D head);
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0io_end_vec->size +=3D io_end_size;=
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0io_end_size =3D 0;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*map_bh =3D false;
>=C2=A0 out:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*m_lblk =3D lblk;
> --
> 2.25.1
>
--000000000000de4c7d05cee079b1-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CA60C433F5 for ; Thu, 21 Oct 2021 17:46:39 +0000 (UTC) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3D72D6135F for ; Thu, 21 Oct 2021 17:46:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3D72D6135F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.elisa.tech X-Received: by 127.0.0.2 with SMTP id dejLYY5279335xMjekRBIseY; Thu, 21 Oct 2021 10:46:38 -0700 X-Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) by mx.groups.io with SMTP id smtpd.web09.1250.1634838398131644274 for ; Thu, 21 Oct 2021 10:46:38 -0700 X-Received: by mail-lj1-f172.google.com with SMTP id q16so711351ljg.3 for ; Thu, 21 Oct 2021 10:46:37 -0700 (PDT) X-Gm-Message-State: iF3w4jp7wxrf7GWx8qmY75qDx5278000AA= X-Google-Smtp-Source: ABdhPJx3XS1zOV0qpUFRWAAfzIIazR7r5bzEgglEeUmFsktAPr2YdfZr7sVH/R7xn4Rl56HyLqB6SlkmzxKIlDWagkg= X-Received: by 2002:a2e:3001:: with SMTP id w1mr7623686ljw.45.1634838396160; Thu, 21 Oct 2021 10:46:36 -0700 (PDT) MIME-Version: 1.0 References: <20211021004914.17239-1-nghialm78@gmail.com> In-Reply-To: From: "Nghia Le" Date: Fri, 22 Oct 2021 00:46:24 +0700 Message-ID: Subject: Re: [linux-safety] [PATCH] ext4/inode.c: remove dead stores in mpage_process_page() To: Lukas Bulwahn Cc: linux-safety@lists.elisa.tech Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: linux-safety@lists.elisa.tech List-Id: Mailing-List: list linux-safety@lists.elisa.tech; contact linux-safety+owner@lists.elisa.tech List-Post: Content-Type: multipart/alternative; boundary="000000000000de4c7d05cee079b1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.elisa.tech; q=dns/txt; s=20140610; t=1634838398; bh=yfewLn+BWJQtY9xGxpWZWyu9GXsI6K+szSeOxbkv4Y8=; h=Cc:Content-Type:Date:From:Subject:To; b=e3s2QZ8v1lav2MTvKo1yLfGeT99Mo/yaYxnuXKUixIONiXVBO1utbYDFVQ+xgnb5JNI jAf3Cn7LLsq6w2VKt2jDzD1/yBOjQlwBDXFAHFO8XdUDv964JIwZZI6FmvDj152nDoLME 3VyUgUEvSO14EdQ6I9EBxdRhUXE1bBuXsCU= Message-ID: <20211021174624.m8BdZALg8Xi4Fdlxh3KIGMx0tdBU21_U--G1LyI1z-s@z> --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 wrote: > On Thu, Oct 21, 2021 at 2:50 AM Nghia Le 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 > > --- > > 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] -=-=-=-=-=-=-=-=-=-=-=- --000000000000de4c7d05cee079b1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dear Lukas,
Thanks for your comments, I submitted=C2= =A0 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 A= M Nghia Le <ngh= ialm78@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=3D0 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>
> ---
>=C2=A0 fs/ext4/inode.c | 2 --
>=C2=A0 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_da= ta *mpd, struct page *page,
>=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;
>=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;
>=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;
> -=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;
>
>=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); >=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)
> @@ -2285,7 +2284,6 @@ static int mpage_process_page(struct mpage_da_da= ta *mpd, struct page *page,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} while (lblk++, (bh =3D bh->b_thi= s_page) !=3D head);
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0io_end_vec->size +=3D io_end_size;=
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0io_end_size =3D 0;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*map_bh =3D false;
>=C2=A0 out:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*m_lblk =3D lblk;
> --
> 2.25.1
>
_._,_._,_

L= inks:

You receive all messages sent to this group.

View/= Reply Online (#255) | Reply To Sender | Reply To Group | Mute This Topic | New Topic
Your Subscription | Contact Group Owner |= Unsubscribe= [linux-safety@archiver.kernel.org]

_._,_._,_
=20 --000000000000de4c7d05cee079b1--