linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 2/2] x86/mm: use min instead of min_t
@ 2014-12-10  2:09 Xishi Qiu
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Xishi Qiu @ 2014-12-10  2:09 UTC (permalink / raw)
  To: Andrew Morton, Ingo Molnar, dave, Rik van Riel, H. Peter Anvin,
	Thomas Gleixner
  Cc: linux-tip-commits, LKML, Linux MM, Xishi Qiu

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;
 	}
 
-- 
2.0.0

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH V3 2/2] x86/mm: use min instead of min_t
  2014-12-10  2:09 [PATCH V3 2/2] x86/mm: use min instead of min_t Xishi Qiu
@ 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
  1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2014-12-10  6:54 UTC (permalink / raw)
  To: Xishi Qiu
  Cc: Andrew Morton, dave, Rik van Riel, H. Peter Anvin,
	Thomas Gleixner, linux-tip-commits, LKML, Linux MM


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:x86/urgent] x86/mm: Use min() instead of min_t() in the e820 printout code
  2014-12-10  2:09 [PATCH V3 2/2] x86/mm: use min instead of min_t Xishi Qiu
  2014-12-10  6:54 ` Ingo Molnar
@ 2014-12-11 12:26 ` tip-bot for Xishi Qiu
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Xishi Qiu @ 2014-12-11 12:26 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mingo, riel, hpa, linux-kernel, akpm, dave, tglx, qiuxishi, linux-mm

Commit-ID:  29258cf49eb794f00989fc47da8700759a42778b
Gitweb:     http://git.kernel.org/tip/29258cf49eb794f00989fc47da8700759a42778b
Author:     Xishi Qiu <qiuxishi@huawei.com>
AuthorDate: Wed, 10 Dec 2014 10:09:03 +0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 11 Dec 2014 11:35:02 +0100

x86/mm: Use min() instead of min_t() in the e820 printout code

The type of "MAX_DMA_PFN" and "xXx_pfn" are both unsigned long
now, so use min() instead of min_t().

Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
Cc: Linux MM <linux-mm@kvack.org>
Cc: <dave@sr71.net>
Cc: Rik van Riel <riel@redhat.com>
Link: http://lkml.kernel.org/r/5487AB3F.7050807@huawei.com
Signed-off-by: Ingo Molnar <mingo@kernel.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;
 	}
 

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-11 12:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-10  2:09 [PATCH V3 2/2] x86/mm: use min instead of min_t Xishi Qiu
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox