From 4b03ac8b5102ad95f9fede7d13fa236977593e7d Mon Sep 17 00:00:00 2001 From: Andy Fleming Date: Mon, 16 Jun 2008 13:58:53 -0500 Subject: Add ALIGN() macro ALIGN() returns the smallest aligned value greater than the passed in address or size. Taken from Linux. Signed-off-by: Andy Fleming --- include/common.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/common.h') diff --git a/include/common.h b/include/common.h index fd5adb3d6db..319078178bf 100644 --- a/include/common.h +++ b/include/common.h @@ -682,6 +682,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)) + /* Multicore arch functions */ #ifdef CONFIG_MP int cpu_status(int nr); -- cgit v1.2.3 From 75678c807a6272ecc5541eb32898c93887f08400 Mon Sep 17 00:00:00 2001 From: "Steven A. Falco" Date: Thu, 12 Jun 2008 13:22:12 -0400 Subject: Make setenv() return status Currently, the setenv function does not return an error code. This patch allows to test for errors. Signed-off-by: Steve Falco --- include/common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/common.h') diff --git a/include/common.h b/include/common.h index 319078178bf..10b997e9ec6 100644 --- a/include/common.h +++ b/include/common.h @@ -243,9 +243,9 @@ char *getenv (char *); int getenv_r (char *name, char *buf, unsigned len); int saveenv (void); #ifdef CONFIG_PPC /* ARM version to be fixed! */ -void inline setenv (char *, char *); +int inline setenv (char *, char *); #else -void setenv (char *, char *); +int setenv (char *, char *); #ifdef CONFIG_HAS_UID void forceenv (char *, char *); #endif -- cgit v1.2.3