Skip to contentSkip to conversation

page-alloc: further adjust assign_page{,s}()

PATCH In review Jan Beulich 4 participants 4 messages Sep 17, 2021 – Sep 20, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 page-alloc: further adjust assign_page{,s}()

The on-commit editing of 5260e8fb93f0 ("xen: re-define assign_pages and introduce a new function assign_page") didn't go quite far enough: A local variable and a function argument also would have wanted adjusting.

xen/common/page_alloc.c +2 -2
@@ -2269,7 +2269,7 @@ int assign_pages(
     unsigned int memflags)
 {
     int rc = 0;
-    unsigned long i;
+    unsigned int i;
 
     spin_lock(&d->page_alloc_lock);
 
@@ -2339,7 +2339,7 @@ int assign_pages(
 int assign_page(struct page_info *pg, unsigned int order, struct domain *d,
                 unsigned int memflags)
 {
-    return assign_pages(pg, 1UL << order, d, memflags);
+    return assign_pages(pg, 1U << order, d, memflags);
 }
 
 struct page_info *alloc_domheap_pages(
Reviewed-by on v1 1/1
#1 lore raw

Hi Jan,

Quoted 7 lines · Jan Beulich

The on-commit editing of 5260e8fb93f0 ("xen: re-define assign_pages and introduce a new function assign_page") didn't go quite far enough: A local variable and a function argument also would have wanted adjusting.

Cheers
Bertrand

Quoted 23 lines
xen/common/page_alloc.c +2 -2
@@ -2269,7 +2269,7 @@ int assign_pages(
    unsigned int memflags)
 {
    int rc = 0;
-    unsigned long i;
+    unsigned int i;
 
    spin_lock(&d->page_alloc_lock);
 
@@ -2339,7 +2339,7 @@ int assign_pages(
 int assign_page(struct page_info *pg, unsigned int order, struct domain *d,
                unsigned int memflags)
 {
-    return assign_pages(pg, 1UL << order, d, memflags);
+    return assign_pages(pg, 1U << order, d, memflags);
 }
 

struct page_info *alloc_domheap_pages(

Reviewed-by on v1 1/1
#2 lore raw
In reply to Jan Beulich
Quoted 5 lines · Jan Beulich

The on-commit editing of 5260e8fb93f0 ("xen: re-define assign_pages and introduce a new function assign_page") didn't go quite far enough: A local variable and a function argument also would have wanted adjusting.

Quoted 21 lines
xen/common/page_alloc.c +2 -2
@@ -2269,7 +2269,7 @@ int assign_pages(
     unsigned int memflags)
 {
     int rc = 0;
-    unsigned long i;
+    unsigned int i;
 
     spin_lock(&d->page_alloc_lock);
 
@@ -2339,7 +2339,7 @@ int assign_pages(
 int assign_page(struct page_info *pg, unsigned int order, struct domain *d,
                 unsigned int memflags)
 {
-    return assign_pages(pg, 1UL << order, d, memflags);
+    return assign_pages(pg, 1U << order, d, memflags);
 }
 
 struct page_info *alloc_domheap_pages(
#3 lore raw
In reply to Jan Beulich

Jan Beulich writes ("[PATCH] page-alloc: further adjust assign_page{,s}()"):

Quoted 3 lines

The on-commit editing of 5260e8fb93f0 ("xen: re-define assign_pages and introduce a new function assign_page") didn't go quite far enough: A local variable and a function argument also would have wanted adjusting.

This kind of thing is why I really dislike our practice of on-commit editing.

Ian.