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

Jan Beulich posted 1 patch 2 years, 6 months ago
Failed in applying to current master (apply log)
[PATCH] page-alloc: further adjust assign_page{,s}()
Posted by Jan Beulich 2 years, 6 months ago
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.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -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(


Re: [PATCH] page-alloc: further adjust assign_page{,s}()
Posted by Bertrand Marquis 2 years, 6 months ago
Hi Jan,

> On 17 Sep 2021, at 10:58, Jan Beulich <jbeulich@suse.com> wrote:
> 
> 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.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> 
> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -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(
> 
> 


Re: [PATCH] page-alloc: further adjust assign_page{,s}()
Posted by Ian Jackson 2 years, 6 months ago
Jan Beulich writes ("[PATCH] 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.

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

Ian.

Re: [PATCH] page-alloc: further adjust assign_page{,s}()
Posted by Stefano Stabellini 2 years, 6 months ago
On Fri, 17 Sep 2021, Jan Beulich wrote:
> 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.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -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(
>