linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Xishi Qiu <qiuxishi@huawei.com>
Cc: Ingo Molnar <mingo@kernel.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 V2] x86/mm: Fix zone ranges boot printout
Date: Tue, 9 Dec 2014 14:50:38 -0800	[thread overview]
Message-ID: <20141209145038.6253a2b99379bfb1255fa95e@linux-foundation.org> (raw)
In-Reply-To: <54866C18.1050203@huawei.com>

On Tue, 9 Dec 2014 11:27:20 +0800 Xishi Qiu <qiuxishi@huawei.com> wrote:

> Changelog:
> V2:
> 	-fix building warnings of min(...).
>
> ...
>
> --- a/arch/x86/mm/init.c
> +++ b/arch/x86/mm/init.c
> @@ -674,10 +674,12 @@ void __init zone_sizes_init(void)
>  	memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
>  
>  #ifdef CONFIG_ZONE_DMA
> -	max_zone_pfns[ZONE_DMA]		= MAX_DMA_PFN;
> +	max_zone_pfns[ZONE_DMA]		= min_t(unsigned long,
> +						max_low_pfn, MAX_DMA_PFN);

MAX_DMA_PFN has type int.

>  #endif
>  #ifdef CONFIG_ZONE_DMA32
> -	max_zone_pfns[ZONE_DMA32]	= MAX_DMA32_PFN;
> +	max_zone_pfns[ZONE_DMA32]	= min_t(unsigned long,
> +						max_low_pfn, MAX_DMA32_PFN);

MAX_DMA32_PFN has type UL (I think?) so there's no need for min_t here.

>  #endif
>  	max_zone_pfns[ZONE_NORMAL]	= max_low_pfn;
>  #ifdef CONFIG_HIGHMEM


Let's try to get the types correct, rather than hacking around fixing
up fallout from earlier incorrect type choices?

What is the type of a pfn?  Unsigned long, generally, when we bother
thinking about it.

So how about we make MAX_DMA_PFN have type UL?  I assume that fixes the
warning?

If we do this, we should also be able to undo the min_t hackery in
arch/x86/kernel/e820.c:memblock_find_dma_reserve().

--
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>

  reply	other threads:[~2014-12-09 22:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-09  3:27 Xishi Qiu
2014-12-09 22:50 ` Andrew Morton [this message]
2014-12-10  1:40   ` 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=20141209145038.6253a2b99379bfb1255fa95e@linux-foundation.org \
    --to=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=mingo@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox