All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/hugetlb.c: remove deadstore in demote_size_show()
@ 2021-10-01 17:57 ` Nghia Le
  0 siblings, 0 replies; 6+ messages in thread
From: Nghia Le @ 2021-10-01 17:57 UTC (permalink / raw)
  To: linux-safety; +Cc: Nghia Le, lukas.bulwahn

Deadstore was detected by CodeCheck tool (ELISA group)

Removed demote_size and relevant assignment in function demote_size_show()
to fix deadstore issue of which stored value to demote_size is never read

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



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

* [linux-safety] [PATCH] mm/hugetlb.c: remove deadstore in demote_size_show()
@ 2021-10-01 17:57 ` Nghia Le
  0 siblings, 0 replies; 6+ messages in thread
From: Nghia Le @ 2021-10-01 17:57 UTC (permalink / raw)
  To: linux-safety; +Cc: Nghia Le, lukas.bulwahn

Deadstore was detected by CodeCheck tool (ELISA group)

Removed demote_size and relevant assignment in function demote_size_show()
to fix deadstore issue of which stored value to demote_size is never read

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 (#247): https://lists.elisa.tech/g/linux-safety/message/247
Mute This Topic: https://lists.elisa.tech/mt/86006510/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] mm/hugetlb.c: remove deadstore in demote_size_show()
@ 2021-10-02  5:13   ` Lukas Bulwahn
  0 siblings, 0 replies; 6+ messages in thread
From: Lukas Bulwahn @ 2021-10-02  5:13 UTC (permalink / raw)
  To: Nghia Le; +Cc: linux-safety

Just some minor improvements for the language:

On Fri, Oct 1, 2021 at 7:57 PM Nghia Le <nghialm78@gmail.com> wrote:
>
> Deadstore was detected by CodeCheck tool (ELISA group)

Hints:
  - Use active instead of passive tense
  - It is detected by "make clang-analyzer". The CodeChecker tool is
just the webUI frontend.
  - Dead store is written as two words (with a space between dead and store).

So, make it:
The command "make clang-analyzer" detected a dead store.

>
> Removed demote_size and relevant assignment in function demote_size_show()
> to fix deadstore issue of which stored value to demote_size is never read
>

Hints:
  - Use imperative form.
  - ... and just some better English grammar.

So make it:
Remove demote_size and corresponding assignment in function demote_size_show()
to fix dead store, as demote_size is never read.

Also change deadstore to dead store in subject.

Other than that, it looks good to me.

Send a PATCH v2 here. Then, we check again and you can send the patch
out to the maintainers.

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
>


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

* Re: [linux-safety] [PATCH] mm/hugetlb.c: remove deadstore in demote_size_show()
@ 2021-10-02  5:13   ` Lukas Bulwahn
  0 siblings, 0 replies; 6+ messages in thread
From: Lukas Bulwahn @ 2021-10-02  5:13 UTC (permalink / raw)
  To: Nghia Le; +Cc: linux-safety

Just some minor improvements for the language:

On Fri, Oct 1, 2021 at 7:57 PM Nghia Le <nghialm78@gmail.com> wrote:
>
> Deadstore was detected by CodeCheck tool (ELISA group)

Hints:
  - Use active instead of passive tense
  - It is detected by "make clang-analyzer". The CodeChecker tool is
just the webUI frontend.
  - Dead store is written as two words (with a space between dead and store).

So, make it:
The command "make clang-analyzer" detected a dead store.

>
> Removed demote_size and relevant assignment in function demote_size_show()
> to fix deadstore issue of which stored value to demote_size is never read
>

Hints:
  - Use imperative form.
  - ... and just some better English grammar.

So make it:
Remove demote_size and corresponding assignment in function demote_size_show()
to fix dead store, as demote_size is never read.

Also change deadstore to dead store in subject.

Other than that, it looks good to me.

Send a PATCH v2 here. Then, we check again and you can send the patch
out to the maintainers.

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 (#248): https://lists.elisa.tech/g/linux-safety/message/248
Mute This Topic: https://lists.elisa.tech/mt/86006510/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] mm/hugetlb.c: remove deadstore in demote_size_show()
@ 2021-10-02 11:56     ` Nghia Le
  0 siblings, 0 replies; 6+ messages in thread
From: Nghia Le @ 2021-10-02 11:56 UTC (permalink / raw)
  To: Lukas Bulwahn; +Cc: linux-safety

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

Dear Lukas,
Thank you for detailed comments as well as your help. Patch v2 is ready for
next review.
Best regards,
Nghia Le

On Sat, Oct 2, 2021 at 12:14 PM Lukas Bulwahn <lukas.bulwahn@gmail.com>
wrote:

> Just some minor improvements for the language:
>
> On Fri, Oct 1, 2021 at 7:57 PM Nghia Le <nghialm78@gmail.com> wrote:
> >
> > Deadstore was detected by CodeCheck tool (ELISA group)
>
> Hints:
>   - Use active instead of passive tense
>   - It is detected by "make clang-analyzer". The CodeChecker tool is
> just the webUI frontend.
>   - Dead store is written as two words (with a space between dead and
> store).
>
> So, make it:
> The command "make clang-analyzer" detected a dead store.
>
> >
> > Removed demote_size and relevant assignment in function
> demote_size_show()
> > to fix deadstore issue of which stored value to demote_size is never read
> >
>
> Hints:
>   - Use imperative form.
>   - ... and just some better English grammar.
>
> So make it:
> Remove demote_size and corresponding assignment in function
> demote_size_show()
> to fix dead store, as demote_size is never read.
>
> Also change deadstore to dead store in subject.
>
> Other than that, it looks good to me.
>
> Send a PATCH v2 here. Then, we check again and you can send the patch
> out to the maintainers.
>
> 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
> >
>

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

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

* Re: [linux-safety] [PATCH] mm/hugetlb.c: remove deadstore in demote_size_show()
@ 2021-10-02 11:56     ` Nghia Le
  0 siblings, 0 replies; 6+ messages in thread
From: Nghia Le @ 2021-10-02 11:56 UTC (permalink / raw)
  To: Lukas Bulwahn; +Cc: linux-safety

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

Dear Lukas,
Thank you for detailed comments as well as your help. Patch v2 is ready for
next review.
Best regards,
Nghia Le

On Sat, Oct 2, 2021 at 12:14 PM Lukas Bulwahn <lukas.bulwahn@gmail.com>
wrote:

> Just some minor improvements for the language:
>
> On Fri, Oct 1, 2021 at 7:57 PM Nghia Le <nghialm78@gmail.com> wrote:
> >
> > Deadstore was detected by CodeCheck tool (ELISA group)
>
> Hints:
>   - Use active instead of passive tense
>   - It is detected by "make clang-analyzer". The CodeChecker tool is
> just the webUI frontend.
>   - Dead store is written as two words (with a space between dead and
> store).
>
> So, make it:
> The command "make clang-analyzer" detected a dead store.
>
> >
> > Removed demote_size and relevant assignment in function
> demote_size_show()
> > to fix deadstore issue of which stored value to demote_size is never read
> >
>
> Hints:
>   - Use imperative form.
>   - ... and just some better English grammar.
>
> So make it:
> Remove demote_size and corresponding assignment in function
> demote_size_show()
> to fix dead store, as demote_size is never read.
>
> Also change deadstore to dead store in subject.
>
> Other than that, it looks good to me.
>
> Send a PATCH v2 here. Then, we check again and you can send the patch
> out to the maintainers.
>
> 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 (#250): https://lists.elisa.tech/g/linux-safety/message/250
Mute This Topic: https://lists.elisa.tech/mt/86006510/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: 4102 bytes --]

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

end of thread, other threads:[~2021-10-02 11:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-01 17:57 [PATCH] mm/hugetlb.c: remove deadstore in demote_size_show() Nghia Le
2021-10-01 17:57 ` [linux-safety] " Nghia Le
2021-10-02  5:13 ` Lukas Bulwahn
2021-10-02  5:13   ` [linux-safety] " Lukas Bulwahn
2021-10-02 11:56   ` Nghia Le
2021-10-02 11:56     ` [linux-safety] " Nghia Le

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.