All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Xishi Qiu <qiuxishi@huawei.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	dave@sr71.net, Rik van Riel <riel@redhat.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-tip-commits@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Linux MM <linux-mm@kvack.org>
Subject: Re: [PATCH V3 2/2] x86/mm: use min instead of min_t
Date: Wed, 10 Dec 2014 07:54:57 +0100	[thread overview]
Message-ID: <20141210065457.GA20596@gmail.com> (raw)
In-Reply-To: <5487AB3F.7050807@huawei.com>


* Xishi Qiu <qiuxishi@huawei.com> wrote:

> The type of "MAX_DMA_PFN" and "xXx_pfn" are both unsigned long now, so use
> min() instead of min_t().
> 
> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
> Suggested-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>  arch/x86/kernel/e820.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
> index 49f8864..dd2f07a 100644
> --- a/arch/x86/kernel/e820.c
> +++ b/arch/x86/kernel/e820.c
> @@ -1114,8 +1114,8 @@ void __init memblock_find_dma_reserve(void)
>  	 * at first, and assume boot_mem will not take below MAX_DMA_PFN
>  	 */
>  	for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, NULL) {
> -		start_pfn = min_t(unsigned long, start_pfn, MAX_DMA_PFN);
> -		end_pfn = min_t(unsigned long, end_pfn, MAX_DMA_PFN);
> +		start_pfn = min(start_pfn, MAX_DMA_PFN);
> +		end_pfn = min(end_pfn, MAX_DMA_PFN);
>  		nr_pages += end_pfn - start_pfn;

Yes, harmonizing the types is a much nicer solution, it allows 
cleanups like this.

Thanks,

	Ingo

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Ingo Molnar <mingo@kernel.org>
To: Xishi Qiu <qiuxishi@huawei.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	dave@sr71.net, Rik van Riel <riel@redhat.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-tip-commits@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Linux MM <linux-mm@kvack.org>
Subject: Re: [PATCH V3 2/2] x86/mm: use min instead of min_t
Date: Wed, 10 Dec 2014 07:54:57 +0100	[thread overview]
Message-ID: <20141210065457.GA20596@gmail.com> (raw)
In-Reply-To: <5487AB3F.7050807@huawei.com>


* Xishi Qiu <qiuxishi@huawei.com> wrote:

> The type of "MAX_DMA_PFN" and "xXx_pfn" are both unsigned long now, so use
> min() instead of min_t().
> 
> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
> Suggested-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>  arch/x86/kernel/e820.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
> index 49f8864..dd2f07a 100644
> --- a/arch/x86/kernel/e820.c
> +++ b/arch/x86/kernel/e820.c
> @@ -1114,8 +1114,8 @@ void __init memblock_find_dma_reserve(void)
>  	 * at first, and assume boot_mem will not take below MAX_DMA_PFN
>  	 */
>  	for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, NULL) {
> -		start_pfn = min_t(unsigned long, start_pfn, MAX_DMA_PFN);
> -		end_pfn = min_t(unsigned long, end_pfn, MAX_DMA_PFN);
> +		start_pfn = min(start_pfn, MAX_DMA_PFN);
> +		end_pfn = min(end_pfn, MAX_DMA_PFN);
>  		nr_pages += end_pfn - start_pfn;

Yes, harmonizing the types is a much nicer solution, it allows 
cleanups like this.

Thanks,

	Ingo

  reply	other threads:[~2014-12-10  6:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-10  2:09 [PATCH V3 2/2] x86/mm: use min instead of min_t Xishi Qiu
2014-12-10  2:09 ` Xishi Qiu
2014-12-10  6:54 ` Ingo Molnar [this message]
2014-12-10  6:54   ` Ingo Molnar
2014-12-11 12:26 ` [tip:x86/urgent] x86/mm: Use min() instead of min_t() in the e820 printout code tip-bot for Xishi Qiu
2014-12-11 12:26   ` tip-bot for Xishi Qiu

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=20141210065457.GA20596@gmail.com \
    --to=mingo@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=dave@sr71.net \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=qiuxishi@huawei.com \
    --cc=riel@redhat.com \
    --cc=tglx@linutronix.de \
    /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 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.