* [PATCH][next] mm/execmem: Remove logically deadcode in execmem.c
@ 2024-10-10 18:10 Everest K.C.
2024-10-10 21:51 ` Shuah Khan
0 siblings, 1 reply; 2+ messages in thread
From: Everest K.C. @ 2024-10-10 18:10 UTC (permalink / raw)
To: akpm; +Cc: Everest K.C., skhan, linux-mm, kernel-janitors, linux-kernel
NULL check of variable `area` within the `mas_for_each` loop is
unnecessary, as the varialbe `area` can never be NULL. So, the
`continue` statement inside the if block is never reached.
Remove the if block that performs the NULL check.
This was reported by Coverity Scan:
https://scan7.scan.coverity.com/#/project-view/51525/11354?selectedIssue=1600362
Fixes: d44c3485820e ("execmem: add support for cache of large ROX pages")
Signed-off-by: Everest K.C. <everestkc@everestkc.com.np>
---
mm/execmem.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/mm/execmem.c b/mm/execmem.c
index 9c6ff9687860..97706d8ed720 100644
--- a/mm/execmem.c
+++ b/mm/execmem.c
@@ -75,9 +75,6 @@ static void execmem_cache_clean(struct work_struct *work)
mas_for_each(&mas, area, ULONG_MAX) {
size_t size;
- if (!area)
- continue;
-
size = mas_range_len(&mas);
if (IS_ALIGNED(size, PMD_SIZE) &&
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH][next] mm/execmem: Remove logically deadcode in execmem.c
2024-10-10 18:10 [PATCH][next] mm/execmem: Remove logically deadcode in execmem.c Everest K.C.
@ 2024-10-10 21:51 ` Shuah Khan
0 siblings, 0 replies; 2+ messages in thread
From: Shuah Khan @ 2024-10-10 21:51 UTC (permalink / raw)
To: Everest K.C., akpm; +Cc: linux-mm, kernel-janitors, linux-kernel, Shuah Khan
On 10/10/24 12:10, Everest K.C. wrote:
> NULL check of variable `area` within the `mas_for_each` loop is
> unnecessary, as the varialbe `area` can never be NULL. So, the
> `continue` statement inside the if block is never reached.
>
> Remove the if block that performs the NULL check.
>
> This was reported by Coverity Scan:
> https://scan7.scan.coverity.com/#/project-view/51525/11354?selectedIssue=1600362
>
> Fixes: d44c3485820e ("execmem: add support for cache of large ROX pages")
> Signed-off-by: Everest K.C. <everestkc@everestkc.com.np>
> ---
> mm/execmem.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/mm/execmem.c b/mm/execmem.c
> index 9c6ff9687860..97706d8ed720 100644
> --- a/mm/execmem.c
> +++ b/mm/execmem.c
> @@ -75,9 +75,6 @@ static void execmem_cache_clean(struct work_struct *work)
> mas_for_each(&mas, area, ULONG_MAX) {
> size_t size;
>
> - if (!area)
> - continue;
> -
This more of a question than comment:
mas_for_each() says:
Note: may return the zero entry.
Does that mean mas_range_len() can be zero? Does that
need to be handled?
> size = mas_range_len(&mas);
>
> if (IS_ALIGNED(size, PMD_SIZE) &&
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-10-10 21:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-10 18:10 [PATCH][next] mm/execmem: Remove logically deadcode in execmem.c Everest K.C.
2024-10-10 21:51 ` Shuah Khan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox