diff mbox series

[v2] mm/hugetlb.c: remove dead store in demote_size_show()

Message ID 20211002115347.77994-1-nghialm78@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v2] mm/hugetlb.c: remove dead store in demote_size_show() | expand

Commit Message

Nghia Le Oct. 2, 2021, 11:53 a.m. UTC
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

Signed-off-by: Nghia Le <nghialm78@gmail.com>
---
 mm/hugetlb.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Lukas Bulwahn Oct. 3, 2021, 5 a.m. UTC | #1
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
>


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

Patch

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