linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/19] ARM: sort the meminfo array earlier
Date: Fri, 16 Sep 2011 12:21:16 -0700	[thread overview]
Message-ID: <4E73A1AC.20709@codeaurora.org> (raw)
In-Reply-To: <alpine.LFD.2.00.1109161345560.20358@xanadu.home>

On 09/16/11 11:09, Nicolas Pitre wrote:
> On Fri, 16 Sep 2011, Stephen Boyd wrote:
>
>
>> This looks like:
>>
>>     return clamp(bank_pfn_start(a) - bank_pfn_start(b), -1, 1);
> Won't work.  The pfn is of an unsigned type, hence the subtraction 
> result will also be unsigned.  The code above looks a bit odd, but there 
> is an implicit cast to a signed result with the result stored into a 
> long.
>
> What would have been even clearer, and possibly more efficient as well, 
> is something like this:
>
> 	if (bank_pfn_start(a) < bank_pfn_start(b))
> 		return -1;
> 	if (bank_pfn_start(a) > bank_pfn_start(b))
> 		return 1;
> 	return 0;

Ok so

    return clamp_t(long, bank_pfn_start(a) - bank_pfn_start(b), -1, 1); 


?

>
> But the goal here was to simply move the code, changing it would warrant 
> a separate patch.

Fair enough.

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

  reply	other threads:[~2011-09-16 19:21 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-16  7:07 [PATCH 0/19] removal of mach/vmalloc.h and generic optimizations Nicolas Pitre
2011-09-16  7:07 ` [PATCH 01/19] ARM: sort the meminfo array earlier Nicolas Pitre
2011-09-16 17:21   ` Stephen Boyd
2011-09-16 18:09     ` Nicolas Pitre
2011-09-16 19:21       ` Stephen Boyd [this message]
2011-09-16 20:44         ` Nicolas Pitre
2011-09-17 15:05   ` Russell King - ARM Linux
2011-09-17 15:49     ` Nicolas Pitre
2011-09-19  4:06       ` Nicolas Pitre
2011-09-19 11:22         ` Russell King - ARM Linux
2011-09-16  7:07 ` [PATCH 02/19] ARM: mach-dove: remove inclusion of <mach/vmalloc.h> Nicolas Pitre
2011-09-16  7:07 ` [PATCH 03/19] ARM: mach-prima2: don't define SIRFSOC_VA in terms of VMALLOC_END Nicolas Pitre
2011-09-16  7:25   ` Barry Song
2011-09-16  7:07 ` [PATCH 04/19] ARM: plat-mxc: remove inclusion of <mach/vmalloc.h> Nicolas Pitre
2011-09-16  7:07 ` [PATCH 05/19] ARM: plat-omap: don't define OMAP1_SRAM_VA in terms of VMALLOC_END Nicolas Pitre
2011-09-16  7:07 ` [PATCH 06/19] ARM: mach-at91: remove arch specific special handling for ioremap Nicolas Pitre
2011-09-19 13:35   ` Jean-Christophe PLAGNIOL-VILLARD
2011-09-19 14:13     ` Russell King - ARM Linux
2011-09-19 15:12       ` Nicolas Pitre
2011-09-19 15:08     ` Nicolas Pitre
2011-09-16  7:07 ` [PATCH 07/19] ARM: mach-davinci: " Nicolas Pitre
2011-09-16  7:07 ` [PATCH 08/19] ARM: mach-tegra: " Nicolas Pitre
2011-09-16  7:07 ` [PATCH 09/19] ARM: plat-omap: " Nicolas Pitre
2011-09-16  7:07 ` [PATCH 10/19] ARM: mach-bcmring: use proper constant to identify DMA memory area Nicolas Pitre
2011-09-16  7:07 ` [PATCH 11/19] ARM: mach-orion5x: remove arch specific special handling for ioremap Nicolas Pitre
2011-09-16  7:07 ` [PATCH 12/19] ARM: mach-kirkwood: " Nicolas Pitre
2011-09-16  7:07 ` [PATCH 13/19] ARM: mach-ixp23xx: " Nicolas Pitre
2011-09-16  7:07 ` [PATCH 14/19] ARM: plat-iop: " Nicolas Pitre
2011-09-16  7:07 ` [PATCH 15/19] mm: add vm_area_add_early() Nicolas Pitre
2011-09-16  7:07 ` [PATCH 16/19] ARM: move iotable mappings within the vmalloc region Nicolas Pitre
2011-09-16 10:39   ` Jamie Iles
2011-09-17 15:19   ` Russell King - ARM Linux
2011-09-17 16:05     ` Nicolas Pitre
2011-09-17 16:20       ` Russell King - ARM Linux
2011-09-19  4:13         ` Nicolas Pitre
2011-09-19 11:21           ` Russell King - ARM Linux
2011-09-19  4:18         ` Nicolas Pitre
2011-09-19 11:20           ` Russell King - ARM Linux
2011-09-19 15:05             ` Nicolas Pitre
2011-09-16  7:07 ` [PATCH 17/19] ARM: simplify __iounmap() when dealing with section based mapping Nicolas Pitre
2011-09-16  7:07 ` [PATCH 18/19] ARM: add generic ioremap optimization by reusing static mappings Nicolas Pitre
2011-09-16  7:07 ` [PATCH 19/19] ARM: big removal of now unused vmalloc.h files Nicolas Pitre
2011-09-16 13:26 ` [PATCH 0/19] removal of mach/vmalloc.h and generic optimizations Jamie Iles
2011-09-17 20:52 ` Arnd Bergmann
2011-09-18  2:46   ` Nicolas Pitre
2011-09-18  8:40     ` Arnd Bergmann
2011-09-19  4:39       ` Nicolas Pitre
2011-09-21  1:14       ` Nicolas Pitre
2011-09-21 17:09         ` Nicolas Pitre

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=4E73A1AC.20709@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).