diff options
author | Milind Arun Choudhary <milindchoudhary@gmail.com> | 2007-04-01 03:36:46 -0400 |
---|---|---|
committer | Kyle McMartin <kyle@athena.road.mcmartin.ca> | 2007-05-22 23:56:14 -0400 |
commit | ea74342900dbe79f2a31ed3609b9e2bdb5c7198c (patch) | |
tree | fafb38b50f34624b1eb0efc44bfe7a1cdeadccd4 /arch/parisc | |
parent | 7022672e4046fac4699aa5f8ff2a5213b7ec4ff9 (diff) |
[PARISC] ROUND_UP macro cleanup in arch/parisc
ROUND_UP macro cleanup, use ALIGN where ever appropriate
Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'arch/parisc')
-rw-r--r-- | arch/parisc/hpux/fs.c | 5 | ||||
-rw-r--r-- | arch/parisc/kernel/sys_parisc32.c | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c index d86e15776779..f2042e6466a4 100644 --- a/arch/parisc/hpux/fs.c +++ b/arch/parisc/hpux/fs.c | |||
@@ -21,6 +21,7 @@ | |||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <linux/kernel.h> | ||
24 | #include <linux/mm.h> | 25 | #include <linux/mm.h> |
25 | #include <linux/sched.h> | 26 | #include <linux/sched.h> |
26 | #include <linux/file.h> | 27 | #include <linux/file.h> |
@@ -69,7 +70,6 @@ struct getdents_callback { | |||
69 | }; | 70 | }; |
70 | 71 | ||
71 | #define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) | 72 | #define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) |
72 | #define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1)) | ||
73 | 73 | ||
74 | static int filldir(void * __buf, const char * name, int namlen, loff_t offset, | 74 | static int filldir(void * __buf, const char * name, int namlen, loff_t offset, |
75 | u64 ino, unsigned d_type) | 75 | u64 ino, unsigned d_type) |
@@ -77,7 +77,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, | |||
77 | struct hpux_dirent __user * dirent; | 77 | struct hpux_dirent __user * dirent; |
78 | struct getdents_callback * buf = (struct getdents_callback *) __buf; | 78 | struct getdents_callback * buf = (struct getdents_callback *) __buf; |
79 | ino_t d_ino; | 79 | ino_t d_ino; |
80 | int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1); | 80 | int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1, sizeof(long)); |
81 | 81 | ||
82 | buf->error = -EINVAL; /* only used if we fail.. */ | 82 | buf->error = -EINVAL; /* only used if we fail.. */ |
83 | if (reclen > buf->count) | 83 | if (reclen > buf->count) |
@@ -102,7 +102,6 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, | |||
102 | } | 102 | } |
103 | 103 | ||
104 | #undef NAME_OFFSET | 104 | #undef NAME_OFFSET |
105 | #undef ROUND_UP | ||
106 | 105 | ||
107 | int hpux_getdents(unsigned int fd, struct hpux_dirent __user *dirent, unsigned int count) | 106 | int hpux_getdents(unsigned int fd, struct hpux_dirent __user *dirent, unsigned int count) |
108 | { | 107 | { |
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c index a8ebac4fadec..bb23ff71c28e 100644 --- a/arch/parisc/kernel/sys_parisc32.c +++ b/arch/parisc/kernel/sys_parisc32.c | |||
@@ -311,14 +311,13 @@ struct readdir32_callback { | |||
311 | int count; | 311 | int count; |
312 | }; | 312 | }; |
313 | 313 | ||
314 | #define ROUND_UP(x,a) ((__typeof__(x))(((unsigned long)(x) + ((a) - 1)) & ~((a) - 1))) | ||
315 | #define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) | 314 | #define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) |
316 | static int filldir32 (void *__buf, const char *name, int namlen, | 315 | static int filldir32 (void *__buf, const char *name, int namlen, |
317 | loff_t offset, u64 ino, unsigned int d_type) | 316 | loff_t offset, u64 ino, unsigned int d_type) |
318 | { | 317 | { |
319 | struct linux32_dirent __user * dirent; | 318 | struct linux32_dirent __user * dirent; |
320 | struct getdents32_callback * buf = (struct getdents32_callback *) __buf; | 319 | struct getdents32_callback * buf = (struct getdents32_callback *) __buf; |
321 | int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1, 4); | 320 | int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1, 4); |
322 | u32 d_ino; | 321 | u32 d_ino; |
323 | 322 | ||
324 | buf->error = -EINVAL; /* only used if we fail.. */ | 323 | buf->error = -EINVAL; /* only used if we fail.. */ |