From: Lukas Bulwahn <lukas.bulwahn@gmail.com>
To: Nghia Le <nghialm78@gmail.com>
Cc: linux-safety@lists.elisa.tech
Subject: Re: [PATCH v2] mm/hugetlb.c: remove dead store in demote_size_show()
Date: Sun, 3 Oct 2021 07:00:49 +0200 [thread overview]
Message-ID: <CAKXUXMxs7kxDhAfertYZ_=XVCFuX99dGAbo5MSGvQZY7zA58sg@mail.gmail.com> (raw)
Message-ID: <20211003050049.4neFNq3_q47CDcms3bcJIJz5wIXHqkxwxakd_Clmu-Y@z> (raw)
In-Reply-To: <20211002115347.77994-1-nghialm78@gmail.com>
On Sat, Oct 2, 2021 at 1:53 PM Nghia Le <nghialm78@gmail.com> wrote:
>
> The command "make clang-analyzer" detected a dead store.
>
> Remove demote_size and corresponding assignment in function
> demote_size_show() to fix dead store, as demote_size is never read
>
I suggest adding punctuation (a ".") at the end of this sentence.
Otherwise, this patch looks good.
Send the next revised patch out to the recommendations from
get_maintainers.pl and also CC: kernel-janitors
<kernel-janitors@vger.kernel.org> and me. Thanks.
Great work!
Lukas
> Signed-off-by: Nghia Le <nghialm78@gmail.com>
> ---
> mm/hugetlb.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 993efa70bce4..ef00e6ad0f6a 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -3706,11 +3706,9 @@ static ssize_t demote_size_show(struct kobject *kobj,
> struct kobj_attribute *attr, char *buf)
> {
> struct hstate *h;
> - unsigned long demote_size;
> int nid;
>
> h = kobj_to_hstate(kobj, &nid);
> - demote_size = h->demote_order;
>
> return sysfs_emit(buf, "%lukB\n",
> (unsigned long)(PAGE_SIZE << h->demote_order) / SZ_1K);
> --
> 2.25.1
>
next prev parent reply other threads:[~2021-10-03 5:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-02 11:53 [PATCH v2] mm/hugetlb.c: remove dead store in demote_size_show() Nghia Le
2021-10-02 11:53 ` [linux-safety] " Nghia Le
2021-10-03 5:00 ` Lukas Bulwahn [this message]
2021-10-03 5:00 ` Lukas Bulwahn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAKXUXMxs7kxDhAfertYZ_=XVCFuX99dGAbo5MSGvQZY7zA58sg@mail.gmail.com' \
--to=lukas.bulwahn@gmail.com \
--cc=linux-safety@lists.elisa.tech \
--cc=nghialm78@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).