* [KJ][PATCH] ROUND_UP macro cleanup in arch/sh64/kernel/pci_sh5.c
2007-04-01 7:48 ` [KJ] [PATCH] " Milind Arun Choudhary
@ 2007-04-12 4:33 ` Milind Arun Choudhary
-1 siblings, 0 replies; 9+ messages in thread
From: Milind Arun Choudhary @ 2007-04-12 4:21 UTC (permalink / raw)
To: kernel-janitors, linuxsh-shmedia-dev; +Cc: linux-kernel, akpm, lethal
ROUND_UP macro cleanup, use ALIGN where ever appropriate.
Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
---
pci_sh5.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/arch/sh64/kernel/pci_sh5.c b/arch/sh64/kernel/pci_sh5.c
index 9dae689..11d1fef 100644
--- a/arch/sh64/kernel/pci_sh5.c
+++ b/arch/sh64/kernel/pci_sh5.c
@@ -376,8 +376,6 @@ irqreturn_t pcish5_serr_irq(int irq, void *dev_id, struct pt_regs *regs)
return IRQ_NONE;
}
-#define ROUND_UP(x, a) (((x) + (a) - 1) & ~((a) - 1))
-
static void __init
pcibios_size_bridge(struct pci_bus *bus, struct resource *ior,
struct resource *memr)
@@ -434,8 +432,8 @@ pcibios_size_bridge(struct pci_bus *bus, struct resource *ior,
mem_res.end -= mem_res.start;
/* Align the sizes up by bridge rules */
- io_res.end = ROUND_UP(io_res.end, 4*1024) - 1;
- mem_res.end = ROUND_UP(mem_res.end, 1*1024*1024) - 1;
+ io_res.end = ALIGN(io_res.end, 4*1024) - 1;
+ mem_res.end = ALIGN(mem_res.end, 1*1024*1024) - 1;
/* Adjust the bridge's allocation requirements */
bridge->resource[0].end = bridge->resource[0].start + io_res.end;
@@ -448,18 +446,16 @@ pcibios_size_bridge(struct pci_bus *bus, struct resource *ior,
/* adjust parent's resource requirements */
if (ior) {
- ior->end = ROUND_UP(ior->end, 4*1024);
+ ior->end = ALIGN(ior->end, 4*1024);
ior->end += io_res.end;
}
if (memr) {
- memr->end = ROUND_UP(memr->end, 1*1024*1024);
+ memr->end = ALIGN(memr->end, 1*1024*1024);
memr->end += mem_res.end;
}
}
-#undef ROUND_UP
-
static void __init pcibios_size_bridges(void)
{
struct resource io_res, mem_res;
--
Milind Arun Choudhary
^ permalink raw reply related [flat|nested] 9+ messages in thread* [KJ] [PATCH] ROUND_UP macro cleanup in arch/sh64/kernel/pci_sh5.c
@ 2007-04-12 4:33 ` Milind Arun Choudhary
0 siblings, 0 replies; 9+ messages in thread
From: Milind Arun Choudhary @ 2007-04-12 4:33 UTC (permalink / raw)
To: kernel-janitors, linuxsh-shmedia-dev; +Cc: linux-kernel, akpm, lethal
ROUND_UP macro cleanup, use ALIGN where ever appropriate.
Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
---
pci_sh5.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/arch/sh64/kernel/pci_sh5.c b/arch/sh64/kernel/pci_sh5.c
index 9dae689..11d1fef 100644
--- a/arch/sh64/kernel/pci_sh5.c
+++ b/arch/sh64/kernel/pci_sh5.c
@@ -376,8 +376,6 @@ irqreturn_t pcish5_serr_irq(int irq, void *dev_id, struct pt_regs *regs)
return IRQ_NONE;
}
-#define ROUND_UP(x, a) (((x) + (a) - 1) & ~((a) - 1))
-
static void __init
pcibios_size_bridge(struct pci_bus *bus, struct resource *ior,
struct resource *memr)
@@ -434,8 +432,8 @@ pcibios_size_bridge(struct pci_bus *bus, struct resource *ior,
mem_res.end -= mem_res.start;
/* Align the sizes up by bridge rules */
- io_res.end = ROUND_UP(io_res.end, 4*1024) - 1;
- mem_res.end = ROUND_UP(mem_res.end, 1*1024*1024) - 1;
+ io_res.end = ALIGN(io_res.end, 4*1024) - 1;
+ mem_res.end = ALIGN(mem_res.end, 1*1024*1024) - 1;
/* Adjust the bridge's allocation requirements */
bridge->resource[0].end = bridge->resource[0].start + io_res.end;
@@ -448,18 +446,16 @@ pcibios_size_bridge(struct pci_bus *bus, struct resource *ior,
/* adjust parent's resource requirements */
if (ior) {
- ior->end = ROUND_UP(ior->end, 4*1024);
+ ior->end = ALIGN(ior->end, 4*1024);
ior->end += io_res.end;
}
if (memr) {
- memr->end = ROUND_UP(memr->end, 1*1024*1024);
+ memr->end = ALIGN(memr->end, 1*1024*1024);
memr->end += mem_res.end;
}
}
-#undef ROUND_UP
-
static void __init pcibios_size_bridges(void)
{
struct resource io_res, mem_res;
--
Milind Arun Choudhary
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [KJ] [PATCH] ROUND_UP macro cleanup in
2007-04-12 4:33 ` [KJ] [PATCH] " Milind Arun Choudhary
@ 2007-04-12 13:10 ` Paul Mundt
-1 siblings, 0 replies; 9+ messages in thread
From: Paul Mundt @ 2007-04-12 13:10 UTC (permalink / raw)
To: Milind Arun Choudhary
Cc: kernel-janitors, linuxsh-shmedia-dev, linux-kernel, akpm
On Thu, Apr 12, 2007 at 09:51:50AM +0530, Milind Arun Choudhary wrote:
> ROUND_UP macro cleanup, use ALIGN where ever appropriate.
>
> Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
>
Looks fine, thanks.
Acked-by: Paul Mundt <lethal@linux-sh.org>
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [KJ][PATCH] ROUND_UP macro cleanup in arch/sh64/kernel/pci_sh5.c
@ 2007-04-12 13:10 ` Paul Mundt
0 siblings, 0 replies; 9+ messages in thread
From: Paul Mundt @ 2007-04-12 13:10 UTC (permalink / raw)
To: Milind Arun Choudhary
Cc: kernel-janitors, linuxsh-shmedia-dev, linux-kernel, akpm
On Thu, Apr 12, 2007 at 09:51:50AM +0530, Milind Arun Choudhary wrote:
> ROUND_UP macro cleanup, use ALIGN where ever appropriate.
>
> Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
>
Looks fine, thanks.
Acked-by: Paul Mundt <lethal@linux-sh.org>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [KJ][PATCH] ROUND_UP macro cleanup in arch/parisc
@ 2007-04-01 7:48 ` Milind Arun Choudhary
0 siblings, 0 replies; 9+ messages in thread
From: Milind Arun Choudhary @ 2007-04-01 7:36 UTC (permalink / raw)
To: kernel-janitors; +Cc: linux-kernel, akpm, parisc-linux, grundler, kyle, willy
ROUND_UP macro cleanup, use ALIGN where ever appropriate
Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
---
hpux/fs.c | 5 ++---
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 4204cd1..7ff5546 100644
--- a/arch/parisc/hpux/fs.c
+++ b/arch/parisc/hpux/fs.c
@@ -21,6 +21,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/file.h>
@@ -70,7 +71,6 @@ struct getdents_callback {
};
#define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de)))
-#define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1))
static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
u64 ino, unsigned d_type)
@@ -78,7 +78,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
struct hpux_dirent * dirent;
struct getdents_callback * buf = (struct getdents_callback *) __buf;
ino_t d_ino;
- int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1);
+ int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1,sizeof(long));
buf->error = -EINVAL; /* only used if we fail.. */
if (reclen > buf->count)
@@ -103,7 +103,6 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
}
#undef NAME_OFFSET
-#undef ROUND_UP
int hpux_getdents(unsigned int fd, struct hpux_dirent *dirent, unsigned int count)
{
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
index ce3245f..e590880 100644
--- a/arch/parisc/kernel/sys_parisc32.c
+++ b/arch/parisc/kernel/sys_parisc32.c
@@ -311,14 +311,13 @@ struct readdir32_callback {
int count;
};
-#define ROUND_UP(x,a) ((__typeof__(x))(((unsigned long)(x) + ((a) - 1)) & ~((a) - 1)))
#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
static int filldir32 (void *__buf, const char *name, int namlen,
loff_t offset, u64 ino, unsigned int d_type)
{
struct linux32_dirent __user * dirent;
struct getdents32_callback * buf = (struct getdents32_callback *) __buf;
- int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1, 4);
+ int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1, 4);
u32 d_ino;
buf->error = -EINVAL; /* only used if we fail.. */
--
Milind Arun Choudhary
^ permalink raw reply related [flat|nested] 9+ messages in thread* [KJ] [PATCH] ROUND_UP macro cleanup in arch/parisc
@ 2007-04-01 7:48 ` Milind Arun Choudhary
0 siblings, 0 replies; 9+ messages in thread
From: Milind Arun Choudhary @ 2007-04-01 7:48 UTC (permalink / raw)
To: kernel-janitors; +Cc: linux-kernel, akpm, parisc-linux, grundler, kyle, willy
ROUND_UP macro cleanup, use ALIGN where ever appropriate
Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
---
hpux/fs.c | 5 ++---
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 4204cd1..7ff5546 100644
--- a/arch/parisc/hpux/fs.c
+++ b/arch/parisc/hpux/fs.c
@@ -21,6 +21,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/file.h>
@@ -70,7 +71,6 @@ struct getdents_callback {
};
#define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de)))
-#define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1))
static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
u64 ino, unsigned d_type)
@@ -78,7 +78,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
struct hpux_dirent * dirent;
struct getdents_callback * buf = (struct getdents_callback *) __buf;
ino_t d_ino;
- int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1);
+ int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1,sizeof(long));
buf->error = -EINVAL; /* only used if we fail.. */
if (reclen > buf->count)
@@ -103,7 +103,6 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
}
#undef NAME_OFFSET
-#undef ROUND_UP
int hpux_getdents(unsigned int fd, struct hpux_dirent *dirent, unsigned int count)
{
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
index ce3245f..e590880 100644
--- a/arch/parisc/kernel/sys_parisc32.c
+++ b/arch/parisc/kernel/sys_parisc32.c
@@ -311,14 +311,13 @@ struct readdir32_callback {
int count;
};
-#define ROUND_UP(x,a) ((__typeof__(x))(((unsigned long)(x) + ((a) - 1)) & ~((a) - 1)))
#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
static int filldir32 (void *__buf, const char *name, int namlen,
loff_t offset, u64 ino, unsigned int d_type)
{
struct linux32_dirent __user * dirent;
struct getdents32_callback * buf = (struct getdents32_callback *) __buf;
- int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1, 4);
+ int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1, 4);
u32 d_ino;
buf->error = -EINVAL; /* only used if we fail.. */
--
Milind Arun Choudhary
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [KJ] [PATCH] ROUND_UP macro cleanup in arch/parisc
2007-04-01 7:48 ` [KJ] [PATCH] " Milind Arun Choudhary
@ 2007-04-04 5:05 ` Grant Grundler
-1 siblings, 0 replies; 9+ messages in thread
From: Grant Grundler @ 2007-04-04 5:05 UTC (permalink / raw)
To: Milind Arun Choudhary
Cc: kernel-janitors, linux-kernel, akpm, parisc-linux, grundler, kyle,
willy
On Sun, Apr 01, 2007 at 01:06:46PM +0530, Milind Arun Choudhary wrote:
> ROUND_UP macro cleanup, use ALIGN where ever appropriate
>
> Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
Also looks good to me. Just one white space nit we can fixup by hand.
Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
>
> ---
> hpux/fs.c | 5 ++---
> 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 4204cd1..7ff5546 100644
> --- a/arch/parisc/hpux/fs.c
> +++ b/arch/parisc/hpux/fs.c
> @@ -21,6 +21,7 @@
> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
> */
>
> +#include <linux/kernel.h>
> #include <linux/mm.h>
> #include <linux/sched.h>
> #include <linux/file.h>
> @@ -70,7 +71,6 @@ struct getdents_callback {
> };
>
> #define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de)))
> -#define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1))
>
> static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
> u64 ino, unsigned d_type)
> @@ -78,7 +78,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
> struct hpux_dirent * dirent;
> struct getdents_callback * buf = (struct getdents_callback *) __buf;
> ino_t d_ino;
> - int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1);
> + int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1,sizeof(long));
Nit: I'd want a blank space after the comma.
thanks,
grant
>
> buf->error = -EINVAL; /* only used if we fail.. */
> if (reclen > buf->count)
> @@ -103,7 +103,6 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
> }
>
> #undef NAME_OFFSET
> -#undef ROUND_UP
>
> int hpux_getdents(unsigned int fd, struct hpux_dirent *dirent, unsigned int count)
> {
> diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
> index ce3245f..e590880 100644
> --- a/arch/parisc/kernel/sys_parisc32.c
> +++ b/arch/parisc/kernel/sys_parisc32.c
> @@ -311,14 +311,13 @@ struct readdir32_callback {
> int count;
> };
>
> -#define ROUND_UP(x,a) ((__typeof__(x))(((unsigned long)(x) + ((a) - 1)) & ~((a) - 1)))
> #define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
> static int filldir32 (void *__buf, const char *name, int namlen,
> loff_t offset, u64 ino, unsigned int d_type)
> {
> struct linux32_dirent __user * dirent;
> struct getdents32_callback * buf = (struct getdents32_callback *) __buf;
> - int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1, 4);
> + int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1, 4);
> u32 d_ino;
>
> buf->error = -EINVAL; /* only used if we fail.. */
>
> --
> Milind Arun Choudhary
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [KJ][PATCH] ROUND_UP macro cleanup in arch/parisc
@ 2007-04-04 5:05 ` Grant Grundler
0 siblings, 0 replies; 9+ messages in thread
From: Grant Grundler @ 2007-04-04 5:05 UTC (permalink / raw)
To: Milind Arun Choudhary
Cc: kernel-janitors, linux-kernel, akpm, parisc-linux, grundler, kyle,
willy
On Sun, Apr 01, 2007 at 01:06:46PM +0530, Milind Arun Choudhary wrote:
> ROUND_UP macro cleanup, use ALIGN where ever appropriate
>
> Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
Also looks good to me. Just one white space nit we can fixup by hand.
Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
>
> ---
> hpux/fs.c | 5 ++---
> 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 4204cd1..7ff5546 100644
> --- a/arch/parisc/hpux/fs.c
> +++ b/arch/parisc/hpux/fs.c
> @@ -21,6 +21,7 @@
> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
> */
>
> +#include <linux/kernel.h>
> #include <linux/mm.h>
> #include <linux/sched.h>
> #include <linux/file.h>
> @@ -70,7 +71,6 @@ struct getdents_callback {
> };
>
> #define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de)))
> -#define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1))
>
> static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
> u64 ino, unsigned d_type)
> @@ -78,7 +78,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
> struct hpux_dirent * dirent;
> struct getdents_callback * buf = (struct getdents_callback *) __buf;
> ino_t d_ino;
> - int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1);
> + int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1,sizeof(long));
Nit: I'd want a blank space after the comma.
thanks,
grant
>
> buf->error = -EINVAL; /* only used if we fail.. */
> if (reclen > buf->count)
> @@ -103,7 +103,6 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
> }
>
> #undef NAME_OFFSET
> -#undef ROUND_UP
>
> int hpux_getdents(unsigned int fd, struct hpux_dirent *dirent, unsigned int count)
> {
> diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
> index ce3245f..e590880 100644
> --- a/arch/parisc/kernel/sys_parisc32.c
> +++ b/arch/parisc/kernel/sys_parisc32.c
> @@ -311,14 +311,13 @@ struct readdir32_callback {
> int count;
> };
>
> -#define ROUND_UP(x,a) ((__typeof__(x))(((unsigned long)(x) + ((a) - 1)) & ~((a) - 1)))
> #define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
> static int filldir32 (void *__buf, const char *name, int namlen,
> loff_t offset, u64 ino, unsigned int d_type)
> {
> struct linux32_dirent __user * dirent;
> struct getdents32_callback * buf = (struct getdents32_callback *) __buf;
> - int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1, 4);
> + int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1, 4);
> u32 d_ino;
>
> buf->error = -EINVAL; /* only used if we fail.. */
>
> --
> Milind Arun Choudhary
^ permalink raw reply [flat|nested] 9+ messages in thread
* [parisc-linux] Re: [KJ][PATCH] ROUND_UP macro cleanup in arch/parisc
2007-04-01 7:48 ` [KJ] [PATCH] " Milind Arun Choudhary
(?)
(?)
@ 2007-04-04 5:05 ` Grant Grundler
-1 siblings, 0 replies; 9+ messages in thread
From: Grant Grundler @ 2007-04-04 5:05 UTC (permalink / raw)
To: Milind Arun Choudhary
Cc: willy, linux-kernel, kyle, kernel-janitors, akpm, parisc-linux
On Sun, Apr 01, 2007 at 01:06:46PM +0530, Milind Arun Choudhary wrote:
> ROUND_UP macro cleanup, use ALIGN where ever appropriate
>
> Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
Also looks good to me. Just one white space nit we can fixup by hand.
Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
>
> ---
> hpux/fs.c | 5 ++---
> 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 4204cd1..7ff5546 100644
> --- a/arch/parisc/hpux/fs.c
> +++ b/arch/parisc/hpux/fs.c
> @@ -21,6 +21,7 @@
> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
> */
>
> +#include <linux/kernel.h>
> #include <linux/mm.h>
> #include <linux/sched.h>
> #include <linux/file.h>
> @@ -70,7 +71,6 @@ struct getdents_callback {
> };
>
> #define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de)))
> -#define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1))
>
> static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
> u64 ino, unsigned d_type)
> @@ -78,7 +78,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
> struct hpux_dirent * dirent;
> struct getdents_callback * buf = (struct getdents_callback *) __buf;
> ino_t d_ino;
> - int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1);
> + int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1,sizeof(long));
Nit: I'd want a blank space after the comma.
thanks,
grant
>
> buf->error = -EINVAL; /* only used if we fail.. */
> if (reclen > buf->count)
> @@ -103,7 +103,6 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
> }
>
> #undef NAME_OFFSET
> -#undef ROUND_UP
>
> int hpux_getdents(unsigned int fd, struct hpux_dirent *dirent, unsigned int count)
> {
> diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
> index ce3245f..e590880 100644
> --- a/arch/parisc/kernel/sys_parisc32.c
> +++ b/arch/parisc/kernel/sys_parisc32.c
> @@ -311,14 +311,13 @@ struct readdir32_callback {
> int count;
> };
>
> -#define ROUND_UP(x,a) ((__typeof__(x))(((unsigned long)(x) + ((a) - 1)) & ~((a) - 1)))
> #define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
> static int filldir32 (void *__buf, const char *name, int namlen,
> loff_t offset, u64 ino, unsigned int d_type)
> {
> struct linux32_dirent __user * dirent;
> struct getdents32_callback * buf = (struct getdents32_callback *) __buf;
> - int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1, 4);
> + int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1, 4);
> u32 d_ino;
>
> buf->error = -EINVAL; /* only used if we fail.. */
>
> --
> Milind Arun Choudhary
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-04-12 13:13 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-12 4:21 [KJ][PATCH] ROUND_UP macro cleanup in arch/sh64/kernel/pci_sh5.c Milind Arun Choudhary
2007-04-12 4:33 ` [KJ] [PATCH] " Milind Arun Choudhary
2007-04-12 13:10 ` [KJ] [PATCH] ROUND_UP macro cleanup in Paul Mundt
2007-04-12 13:10 ` [KJ][PATCH] ROUND_UP macro cleanup in arch/sh64/kernel/pci_sh5.c Paul Mundt
-- strict thread matches above, loose matches on Subject: below --
2007-04-01 7:36 [KJ][PATCH] ROUND_UP macro cleanup in arch/parisc Milind Arun Choudhary
2007-04-01 7:48 ` [KJ] [PATCH] " Milind Arun Choudhary
2007-04-04 5:05 ` Grant Grundler
2007-04-04 5:05 ` [KJ][PATCH] " Grant Grundler
2007-04-04 5:05 ` [parisc-linux] " Grant Grundler
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.