All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH 1/4] Add ALIGN() macro
Date: Tue, 20 May 2008 16:54:07 -0500	[thread overview]
Message-ID: <4833487F.1010502@freescale.com> (raw)
In-Reply-To: <20080520210914.GB18756@game.jcrosoft.org>

Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 15:24 Tue 20 May     , Andy Fleming wrote:
>> ALIGN() returns the smallest aligned value greater than the passed
>> in address or size.  Taken from Linux.
>>
>> Signed-off-by: Andy Fleming <afleming@freescale.com>
>> ---
>>  include/common.h |    3 +++
>>  1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> diff --git a/include/common.h b/include/common.h
>> index d0f5704..68e0cbc 100644
>> --- a/include/common.h
>> +++ b/include/common.h
>> @@ -671,6 +671,9 @@ void __attribute__((weak)) show_boot_progress (int val);
>>  #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
>>  #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
>>  
>> +#define ALIGN(x,a)              __ALIGN_MASK(x,(typeof(x))(a)-1)
>> +#define __ALIGN_MASK(x,mask)    (((x)+(mask))&~(mask))
> please fix coding style and use tab instead of space for indent
> 
> #define ALIGN(x, a)		__ALIGN_MASK(x, (typeof(x)) (a) - 1)
> #define __ALIGN_MASK(x, mask)	(((x) + (mask)) & ~(mask))

That's not indenting, that's alignment.  Using tabs after anything that 
is not a tab causes the code to look awful if the tab stops are 
disturbed, such as by viewing with a different tab size, or as part of a 
patch.

-Scott

  reply	other threads:[~2008-05-20 21:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-20 20:24 [U-Boot-Users] [PATCH 1/4] Add ALIGN() macro Andy Fleming
2008-05-20 20:24 ` [U-Boot-Users] [PATCH 2/4] Add lmb_free Andy Fleming
2008-05-20 20:24   ` [U-Boot-Users] [PATCH 3/4] Fix an underflow bug in __lmb_alloc_base Andy Fleming
2008-05-20 20:24     ` [U-Boot-Users] [PATCH 4/4] Resize device tree to allow space for board changes and the chosen node Andy Fleming
2008-05-20 21:11   ` [U-Boot-Users] [PATCH 2/4] Add lmb_free Jean-Christophe PLAGNIOL-VILLARD
2008-05-20 22:31     ` Wolfgang Denk
2008-05-20 21:09 ` [U-Boot-Users] [PATCH 1/4] Add ALIGN() macro Jean-Christophe PLAGNIOL-VILLARD
2008-05-20 21:54   ` Scott Wood [this message]
2008-05-20 22:33     ` Wolfgang Denk
2008-05-20 22:29   ` Wolfgang Denk

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=4833487F.1010502@freescale.com \
    --to=scottwood@freescale.com \
    --cc=u-boot@lists.denx.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.