From mboxrd@z Thu Jan 1 00:00:00 1970 From: Troy Kisky Date: Wed, 28 Nov 2012 14:05:29 -0700 Subject: [U-Boot] [PATCH V4 01/11] imximage: mx53 needs transfer length a multiple of 512 In-Reply-To: <20121128202555.5B849201208@gemini.denx.de> References: <1349315254-21151-9-git-send-email-troy.kisky@boundarydevices.com> <1354066303-29762-1-git-send-email-troy.kisky@boundarydevices.com> <1354066303-29762-2-git-send-email-troy.kisky@boundarydevices.com> <20121128092758.D8E4F20104E@gemini.denx.de> <50B65583.1070309@boundarydevices.com> <20121128202555.5B849201208@gemini.denx.de> Message-ID: <50B67C99.8080609@boundarydevices.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 11/28/2012 1:25 PM, Wolfgang Denk wrote: > Dear Troy Kisky, > > In message <50B65583.1070309@boundarydevices.com> you wrote: >> Oddly enough, I originally called it ROUND_UP. But then I saw these lines >> in include/common.h > And why didn't you find (and use) ROUND() in include/common.h ? > > Best regards, > > Wolfgang Denk > I did also find ROUND, so I checked to see what Linux did. Linux does not have ROUND, but it does have ALIGN. But I personally prefer ROUND, or even better ROUND_UP. I just wanted to use the most common form. u-boot seems to use ROUND in config files and ALIGN in .c files But the reason I didn't include common.h is because of the target specific files that it also includes. Would you mind if I moved _________________________ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) #define ROUND(a,b) (((a) + (b) - 1) & ~((b) - 1)) #define DIV_ROUND(n,d) (((n) + ((d)/2)) / (d)) #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)) ------------------------------------- from common.h to a new file common_macro.h and included common_macro.h instead? Perhaps you have a better alternative? Thanks Troy