LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [KJ][PATCH] ROUND_UP macro cleanup in drivers/pci
@ 2007-04-01 11:14 Milind Arun Choudhary
  2007-04-04 17:59 ` Scott Murray
  0 siblings, 1 reply; 2+ messages in thread
From: Milind Arun Choudhary @ 2007-04-01 11:14 UTC (permalink / raw)
  To: kernel-janitors; +Cc: linux-kernel, akpm, pcihpd-discuss, scottm, linux-pci


ROUND_UP macro cleanup, use ALIGN where ever appropriate

Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>

---
 hotplug/cpci_hotplug_pci.c |    2 --
 setup-bus.c                |    8 +++-----
 2 files changed, 3 insertions(+), 7 deletions(-)


diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
index 7b1beaa..5e9be44 100644
--- a/drivers/pci/hotplug/cpci_hotplug_pci.c
+++ b/drivers/pci/hotplug/cpci_hotplug_pci.c
@@ -45,8 +45,6 @@ extern int cpci_debug;
 #define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
 #define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg)
 
-#define ROUND_UP(x, a)		(((x) + (a) - 1) & ~((a) - 1))
-
 
 u8 cpci_get_attention_status(struct slot* slot)
 {
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 3554f39..e02766f 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -34,8 +34,6 @@
 #define DBG(x...)
 #endif
 
-#define ROUND_UP(x, a)		(((x) + (a) - 1) & ~((a) - 1))
-
 static void __devinit
 pbus_assign_resources_sorted(struct pci_bus *bus)
 {
@@ -314,7 +312,7 @@ pbus_size_io(struct pci_bus *bus)
 #if defined(CONFIG_ISA) || defined(CONFIG_EISA)
 	size = (size & 0xff) + ((size & ~0xffUL) << 2);
 #endif
-	size = ROUND_UP(size + size1, 4096);
+	size = ALIGN(size + size1, 4096);
 	if (!size) {
 		b_res->flags = 0;
 		return;
@@ -383,11 +381,11 @@ pbus_size_mem(struct pci_bus *bus, unsigned long mask, unsigned long type)
 
 		if (!align)
 			min_align = align1;
-		else if (ROUND_UP(align + min_align, min_align) < align1)
+		else if (ALIGN(align + min_align, min_align) < align1)
 			min_align = align1 >> 1;
 		align += aligns[order];
 	}
-	size = ROUND_UP(size, min_align);
+	size = ALIGN(size, min_align);
 	if (!size) {
 		b_res->flags = 0;
 		return 1;

--
Milind Arun Choudhary

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [KJ][PATCH] ROUND_UP macro cleanup in drivers/pci
  2007-04-01 11:14 [KJ][PATCH] ROUND_UP macro cleanup in drivers/pci Milind Arun Choudhary
@ 2007-04-04 17:59 ` Scott Murray
  0 siblings, 0 replies; 2+ messages in thread
From: Scott Murray @ 2007-04-04 17:59 UTC (permalink / raw)
  To: Milind Arun Choudhary
  Cc: kernel-janitors, linux-kernel, akpm, pcihpd-discuss, linux-pci

On Sun, 1 Apr 2007, Milind Arun Choudhary wrote:

>
> ROUND_UP macro cleanup, use ALIGN where ever appropriate
>
> Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>

Ack for the hotplug/cpci_hotplug_pci.c change, looks like I missed
removing that define back when I originally reworked things for 2.6.
The setup-bus.c change looks okay to me as well, but probably needs
sign-off from Greg.

Signed-off-by: Scott Murray <scottm@somanetworks.com>

> ---
>  hotplug/cpci_hotplug_pci.c |    2 --
>  setup-bus.c                |    8 +++-----
>  2 files changed, 3 insertions(+), 7 deletions(-)
>
>
> diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
> index 7b1beaa..5e9be44 100644
> --- a/drivers/pci/hotplug/cpci_hotplug_pci.c
> +++ b/drivers/pci/hotplug/cpci_hotplug_pci.c
> @@ -45,8 +45,6 @@ extern int cpci_debug;
>  #define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
>  #define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg)
>
> -#define ROUND_UP(x, a)		(((x) + (a) - 1) & ~((a) - 1))
> -
>
>  u8 cpci_get_attention_status(struct slot* slot)
>  {
> diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
> index 3554f39..e02766f 100644
> --- a/drivers/pci/setup-bus.c
> +++ b/drivers/pci/setup-bus.c
> @@ -34,8 +34,6 @@
>  #define DBG(x...)
>  #endif
>
> -#define ROUND_UP(x, a)		(((x) + (a) - 1) & ~((a) - 1))
> -
>  static void __devinit
>  pbus_assign_resources_sorted(struct pci_bus *bus)
>  {
> @@ -314,7 +312,7 @@ pbus_size_io(struct pci_bus *bus)
>  #if defined(CONFIG_ISA) || defined(CONFIG_EISA)
>  	size = (size & 0xff) + ((size & ~0xffUL) << 2);
>  #endif
> -	size = ROUND_UP(size + size1, 4096);
> +	size = ALIGN(size + size1, 4096);
>  	if (!size) {
>  		b_res->flags = 0;
>  		return;
> @@ -383,11 +381,11 @@ pbus_size_mem(struct pci_bus *bus, unsigned long mask, unsigned long type)
>
>  		if (!align)
>  			min_align = align1;
> -		else if (ROUND_UP(align + min_align, min_align) < align1)
> +		else if (ALIGN(align + min_align, min_align) < align1)
>  			min_align = align1 >> 1;
>  		align += aligns[order];
>  	}
> -	size = ROUND_UP(size, min_align);
> +	size = ALIGN(size, min_align);
>  	if (!size) {
>  		b_res->flags = 0;
>  		return 1;
>
> --
> Milind Arun Choudhary
>

-- 
Scott Murray
SOMA Networks, Inc.
Toronto, Ontario
e-mail: scottm@somanetworks.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-04-04 18:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-01 11:14 [KJ][PATCH] ROUND_UP macro cleanup in drivers/pci Milind Arun Choudhary
2007-04-04 17:59 ` Scott Murray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).