All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] xen/mm: pg_offlined can be defined as bool in free_heap_pages()
@ 2022-02-23 19:08 Julien Grall
  2022-02-23 19:38 ` Andrew Cooper
  0 siblings, 1 reply; 3+ messages in thread
From: Julien Grall @ 2022-02-23 19:08 UTC (permalink / raw)
  To: xen-devel; +Cc: julien, Julien Grall

From: Julien Grall <jgrall@amazon.com>

The local variable pg_offlined in free_heap_pages() can only take two
values. So switch it to a bool.

Signed-off-by: Julien Grall <jgrall@amazon.com>

---
    Changes in v2:
        - pg_offlined should be initialized to false rather than true
---
 xen/common/page_alloc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index e971bf91e0be..319029140f30 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1437,8 +1437,9 @@ static void free_heap_pages(
 {
     unsigned long mask;
     mfn_t mfn = page_to_mfn(pg);
-    unsigned int i, node = phys_to_nid(mfn_to_maddr(mfn)), pg_offlined = 0;
+    unsigned int i, node = phys_to_nid(mfn_to_maddr(mfn));
     unsigned int zone = page_to_zone(pg);
+    bool pg_offlined = false;
 
     ASSERT(order <= MAX_ORDER);
 
@@ -1447,7 +1448,7 @@ static void free_heap_pages(
     for ( i = 0; i < (1 << order); i++ )
     {
         if ( mark_page_free(&pg[i], mfn_add(mfn, i)) )
-            pg_offlined = 1;
+            pg_offlined = true;
 
         if ( need_scrub )
         {
-- 
2.32.0



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

* Re: [PATCH v2] xen/mm: pg_offlined can be defined as bool in free_heap_pages()
  2022-02-23 19:08 [PATCH v2] xen/mm: pg_offlined can be defined as bool in free_heap_pages() Julien Grall
@ 2022-02-23 19:38 ` Andrew Cooper
  2022-02-24 17:31   ` Julien Grall
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cooper @ 2022-02-23 19:38 UTC (permalink / raw)
  To: Julien Grall, xen-devel; +Cc: Julien Grall

On 23/02/2022 19:08, Julien Grall wrote:
> From: Julien Grall <jgrall@amazon.com>
>
> The local variable pg_offlined in free_heap_pages() can only take two
> values. So switch it to a bool.
>
> Signed-off-by: Julien Grall <jgrall@amazon.com>

I'd argue this might want to go as far as declaring Fixes: 289610483fc43
which really did introduce one bool pg_offlined and one unsigned int
pg_offlined which were the same thing.

Either way, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

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

* Re: [PATCH v2] xen/mm: pg_offlined can be defined as bool in free_heap_pages()
  2022-02-23 19:38 ` Andrew Cooper
@ 2022-02-24 17:31   ` Julien Grall
  0 siblings, 0 replies; 3+ messages in thread
From: Julien Grall @ 2022-02-24 17:31 UTC (permalink / raw)
  To: Andrew Cooper, xen-devel; +Cc: Julien Grall

Hi Andrew,

On 23/02/2022 19:38, Andrew Cooper wrote:
> On 23/02/2022 19:08, Julien Grall wrote:
>> From: Julien Grall <jgrall@amazon.com>
>>
>> The local variable pg_offlined in free_heap_pages() can only take two
>> values. So switch it to a bool.
>>
>> Signed-off-by: Julien Grall <jgrall@amazon.com>
> 
> I'd argue this might want to go as far as declaring Fixes: 289610483fc43
> which really did introduce one bool pg_offlined and one unsigned int
> pg_offlined which were the same thing.

I am OK with that. I will add it while committing the patch.

> 
> Either way, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks!

Cheers,

-- 
Julien Grall


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

end of thread, other threads:[~2022-02-24 17:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-23 19:08 [PATCH v2] xen/mm: pg_offlined can be defined as bool in free_heap_pages() Julien Grall
2022-02-23 19:38 ` Andrew Cooper
2022-02-24 17:31   ` Julien Grall

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.