linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Marco Elver <elver@google.com>
To: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Alexander Potapenko <glider@google.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, kasan-dev@googlegroups.com
Subject: Re: [PATCH] mm: kfence: Use PAGE_ALIGNED helper
Date: Fri, 20 May 2022 09:43:46 +0200	[thread overview]
Message-ID: <YodGstrh0kfh0o1j@elver.google.com> (raw)
In-Reply-To: <20220520021833.121405-1-wangkefeng.wang@huawei.com>

On Fri, May 20, 2022 at 10:18AM +0800, 'Kefeng Wang' via kasan-dev wrote:
> Use PAGE_ALIGNED macro instead of IS_ALIGNED and passing PAGE_SIZE.
> 
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>

Reviewed-by: Marco Elver <elver@google.com>

> ---
>  mm/kfence/kfence_test.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/kfence/kfence_test.c b/mm/kfence/kfence_test.c
> index 96206a4ee9ab..a97bffe0cc3e 100644
> --- a/mm/kfence/kfence_test.c
> +++ b/mm/kfence/kfence_test.c
> @@ -296,10 +296,9 @@ static void *test_alloc(struct kunit *test, size_t size, gfp_t gfp, enum allocat
>  
>  			if (policy == ALLOCATE_ANY)
>  				return alloc;
> -			if (policy == ALLOCATE_LEFT && IS_ALIGNED((unsigned long)alloc, PAGE_SIZE))
> +			if (policy == ALLOCATE_LEFT && PAGE_ALIGNED(alloc))
>  				return alloc;
> -			if (policy == ALLOCATE_RIGHT &&
> -			    !IS_ALIGNED((unsigned long)alloc, PAGE_SIZE))
> +			if (policy == ALLOCATE_RIGHT && !PAGE_ALIGNED(alloc))
>  				return alloc;
>  		} else if (policy == ALLOCATE_NONE)
>  			return alloc;
> -- 
> 2.35.3


  reply	other threads:[~2022-05-20  7:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20  2:18 [PATCH] mm: kfence: Use PAGE_ALIGNED helper Kefeng Wang
2022-05-20  7:43 ` Marco Elver [this message]
2022-05-20 10:26 ` Muchun Song
2022-05-23  6:32   ` Kefeng Wang
2022-05-23  6:46     ` Muchun Song
2022-05-23  7:13       ` Kefeng Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YodGstrh0kfh0o1j@elver.google.com \
    --to=elver@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-mm@kvack.org \
    --cc=wangkefeng.wang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).