* [KJ][PATCH]ROUND_UP macro cleanup in drivers/net/ixgb
@ 2007-04-03 2:55 ` Milind Arun Choudhary
0 siblings, 0 replies; 12+ messages in thread
From: Milind Arun Choudhary @ 2007-04-03 2:43 UTC (permalink / raw)
To: kernel-janitors, e1000-devel
Cc: linux-kernel, akpm, auke-jan.h.kok, john.ronciak,
jesse.brandeburg, ayyappan.veeraiyan
IXGB_ROUNDUP macro cleanup ,use ALIGN
Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
---
ixgb.h | 3 ---
ixgb_ethtool.c | 4 ++--
ixgb_main.c | 4 ++--
ixgb_param.c | 4 ++--
4 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
index cf30a10..c8e9086 100644
--- a/drivers/net/ixgb/ixgb.h
+++ b/drivers/net/ixgb/ixgb.h
@@ -111,9 +111,6 @@ struct ixgb_adapter;
/* How many Rx Buffers do we bundle into one write to the hardware ? */
#define IXGB_RX_BUFFER_WRITE 8 /* Must be power of 2 */
-/* only works for sizes that are powers of 2 */
-#define IXGB_ROUNDUP(i, size) ((i) = (((i) + (size) - 1) & ~((size) - 1)))
-
/* wrapper around a pointer to a socket buffer,
* so a DMA handle can be stored along with the buffer */
struct ixgb_buffer {
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index d6628bd..cdefaff 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -577,11 +577,11 @@ ixgb_set_ringparam(struct net_device *netdev,
rxdr->count = max(ring->rx_pending,(uint32_t)MIN_RXD);
rxdr->count = min(rxdr->count,(uint32_t)MAX_RXD);
- IXGB_ROUNDUP(rxdr->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
+ rxdr->count = ALIGN(rxdr->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
txdr->count = max(ring->tx_pending,(uint32_t)MIN_TXD);
txdr->count = min(txdr->count,(uint32_t)MAX_TXD);
- IXGB_ROUNDUP(txdr->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
+ txdr->count = ALIGN(txdr->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
if(netif_running(adapter->netdev)) {
/* Try to get new resources before deleting old */
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index afc2ec7..158c71e 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -685,7 +685,7 @@ ixgb_setup_tx_resources(struct ixgb_adapter *adapter)
/* round up to nearest 4K */
txdr->size = txdr->count * sizeof(struct ixgb_tx_desc);
- IXGB_ROUNDUP(txdr->size, 4096);
+ txdr->size = ALIGN(txdr->size, 4096);
txdr->desc = pci_alloc_consistent(pdev, txdr->size, &txdr->dma);
if(!txdr->desc) {
@@ -774,7 +774,7 @@ ixgb_setup_rx_resources(struct ixgb_adapter *adapter)
/* Round up to nearest 4K */
rxdr->size = rxdr->count * sizeof(struct ixgb_rx_desc);
- IXGB_ROUNDUP(rxdr->size, 4096);
+ rxdr->size = ALIGN(rxdr->size, 4096);
rxdr->desc = pci_alloc_consistent(pdev, rxdr->size, &rxdr->dma);
diff --git a/drivers/net/ixgb/ixgb_param.c b/drivers/net/ixgb/ixgb_param.c
index b27442a..ee8cc67 100644
--- a/drivers/net/ixgb/ixgb_param.c
+++ b/drivers/net/ixgb/ixgb_param.c
@@ -284,7 +284,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
} else {
tx_ring->count = opt.def;
}
- IXGB_ROUNDUP(tx_ring->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
+ tx_ring->count = ALIGN(tx_ring->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
}
{ /* Receive Descriptor Count */
struct ixgb_option opt = {
@@ -303,7 +303,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
} else {
rx_ring->count = opt.def;
}
- IXGB_ROUNDUP(rx_ring->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
+ rx_ring->count = ALIGN(rx_ring->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
}
{ /* Receive Checksum Offload Enable */
struct ixgb_option opt = {
--
Milind Arun Choudhary
^ permalink raw reply related [flat|nested] 12+ messages in thread* [KJ] [PATCH]ROUND_UP macro cleanup in drivers/net/ixgb
@ 2007-04-03 2:55 ` Milind Arun Choudhary
0 siblings, 0 replies; 12+ messages in thread
From: Milind Arun Choudhary @ 2007-04-03 2:55 UTC (permalink / raw)
To: kernel-janitors, e1000-devel
Cc: linux-kernel, akpm, auke-jan.h.kok, john.ronciak,
jesse.brandeburg, ayyappan.veeraiyan
IXGB_ROUNDUP macro cleanup ,use ALIGN
Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
---
ixgb.h | 3 ---
ixgb_ethtool.c | 4 ++--
ixgb_main.c | 4 ++--
ixgb_param.c | 4 ++--
4 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
index cf30a10..c8e9086 100644
--- a/drivers/net/ixgb/ixgb.h
+++ b/drivers/net/ixgb/ixgb.h
@@ -111,9 +111,6 @@ struct ixgb_adapter;
/* How many Rx Buffers do we bundle into one write to the hardware ? */
#define IXGB_RX_BUFFER_WRITE 8 /* Must be power of 2 */
-/* only works for sizes that are powers of 2 */
-#define IXGB_ROUNDUP(i, size) ((i) = (((i) + (size) - 1) & ~((size) - 1)))
-
/* wrapper around a pointer to a socket buffer,
* so a DMA handle can be stored along with the buffer */
struct ixgb_buffer {
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index d6628bd..cdefaff 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -577,11 +577,11 @@ ixgb_set_ringparam(struct net_device *netdev,
rxdr->count = max(ring->rx_pending,(uint32_t)MIN_RXD);
rxdr->count = min(rxdr->count,(uint32_t)MAX_RXD);
- IXGB_ROUNDUP(rxdr->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
+ rxdr->count = ALIGN(rxdr->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
txdr->count = max(ring->tx_pending,(uint32_t)MIN_TXD);
txdr->count = min(txdr->count,(uint32_t)MAX_TXD);
- IXGB_ROUNDUP(txdr->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
+ txdr->count = ALIGN(txdr->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
if(netif_running(adapter->netdev)) {
/* Try to get new resources before deleting old */
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index afc2ec7..158c71e 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -685,7 +685,7 @@ ixgb_setup_tx_resources(struct ixgb_adapter *adapter)
/* round up to nearest 4K */
txdr->size = txdr->count * sizeof(struct ixgb_tx_desc);
- IXGB_ROUNDUP(txdr->size, 4096);
+ txdr->size = ALIGN(txdr->size, 4096);
txdr->desc = pci_alloc_consistent(pdev, txdr->size, &txdr->dma);
if(!txdr->desc) {
@@ -774,7 +774,7 @@ ixgb_setup_rx_resources(struct ixgb_adapter *adapter)
/* Round up to nearest 4K */
rxdr->size = rxdr->count * sizeof(struct ixgb_rx_desc);
- IXGB_ROUNDUP(rxdr->size, 4096);
+ rxdr->size = ALIGN(rxdr->size, 4096);
rxdr->desc = pci_alloc_consistent(pdev, rxdr->size, &rxdr->dma);
diff --git a/drivers/net/ixgb/ixgb_param.c b/drivers/net/ixgb/ixgb_param.c
index b27442a..ee8cc67 100644
--- a/drivers/net/ixgb/ixgb_param.c
+++ b/drivers/net/ixgb/ixgb_param.c
@@ -284,7 +284,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
} else {
tx_ring->count = opt.def;
}
- IXGB_ROUNDUP(tx_ring->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
+ tx_ring->count = ALIGN(tx_ring->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
}
{ /* Receive Descriptor Count */
struct ixgb_option opt = {
@@ -303,7 +303,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
} else {
rx_ring->count = opt.def;
}
- IXGB_ROUNDUP(rx_ring->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
+ rx_ring->count = ALIGN(rx_ring->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
}
{ /* Receive Checksum Offload Enable */
struct ixgb_option opt = {
--
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] 12+ messages in thread* Re: [KJ] [PATCH]ROUND_UP macro cleanup in drivers/net/ixgb
2007-04-03 2:55 ` [KJ] [PATCH]ROUND_UP " Milind Arun Choudhary
@ 2007-04-03 5:45 ` Kok, Auke
-1 siblings, 0 replies; 12+ messages in thread
From: Kok, Auke @ 2007-04-03 5:45 UTC (permalink / raw)
To: Milind Arun Choudhary
Cc: kernel-janitors, e1000-devel, linux-kernel, akpm, auke-jan.h.kok,
john.ronciak, jesse.brandeburg, ayyappan.veeraiyan
Milind Arun Choudhary wrote:
> IXGB_ROUNDUP macro cleanup ,use ALIGN
cool beans!
Same reply as to the ALIGN patch you sent for e1000 -> We'll take it for a spin
and I'll push your patch upstream as part of the regular updates!
Thanks,
Auke
>
> Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
>
> ---
>
> ixgb.h | 3 ---
> ixgb_ethtool.c | 4 ++--
> ixgb_main.c | 4 ++--
> ixgb_param.c | 4 ++--
> 4 files changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
> index cf30a10..c8e9086 100644
> --- a/drivers/net/ixgb/ixgb.h
> +++ b/drivers/net/ixgb/ixgb.h
> @@ -111,9 +111,6 @@ struct ixgb_adapter;
> /* How many Rx Buffers do we bundle into one write to the hardware ? */
> #define IXGB_RX_BUFFER_WRITE 8 /* Must be power of 2 */
>
> -/* only works for sizes that are powers of 2 */
> -#define IXGB_ROUNDUP(i, size) ((i) = (((i) + (size) - 1) & ~((size) - 1)))
> -
> /* wrapper around a pointer to a socket buffer,
> * so a DMA handle can be stored along with the buffer */
> struct ixgb_buffer {
> diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
> index d6628bd..cdefaff 100644
> --- a/drivers/net/ixgb/ixgb_ethtool.c
> +++ b/drivers/net/ixgb/ixgb_ethtool.c
> @@ -577,11 +577,11 @@ ixgb_set_ringparam(struct net_device *netdev,
>
> rxdr->count = max(ring->rx_pending,(uint32_t)MIN_RXD);
> rxdr->count = min(rxdr->count,(uint32_t)MAX_RXD);
> - IXGB_ROUNDUP(rxdr->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
> + rxdr->count = ALIGN(rxdr->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
>
> txdr->count = max(ring->tx_pending,(uint32_t)MIN_TXD);
> txdr->count = min(txdr->count,(uint32_t)MAX_TXD);
> - IXGB_ROUNDUP(txdr->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
> + txdr->count = ALIGN(txdr->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
>
> if(netif_running(adapter->netdev)) {
> /* Try to get new resources before deleting old */
> diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
> index afc2ec7..158c71e 100644
> --- a/drivers/net/ixgb/ixgb_main.c
> +++ b/drivers/net/ixgb/ixgb_main.c
> @@ -685,7 +685,7 @@ ixgb_setup_tx_resources(struct ixgb_adapter *adapter)
> /* round up to nearest 4K */
>
> txdr->size = txdr->count * sizeof(struct ixgb_tx_desc);
> - IXGB_ROUNDUP(txdr->size, 4096);
> + txdr->size = ALIGN(txdr->size, 4096);
>
> txdr->desc = pci_alloc_consistent(pdev, txdr->size, &txdr->dma);
> if(!txdr->desc) {
> @@ -774,7 +774,7 @@ ixgb_setup_rx_resources(struct ixgb_adapter *adapter)
> /* Round up to nearest 4K */
>
> rxdr->size = rxdr->count * sizeof(struct ixgb_rx_desc);
> - IXGB_ROUNDUP(rxdr->size, 4096);
> + rxdr->size = ALIGN(rxdr->size, 4096);
>
> rxdr->desc = pci_alloc_consistent(pdev, rxdr->size, &rxdr->dma);
>
> diff --git a/drivers/net/ixgb/ixgb_param.c b/drivers/net/ixgb/ixgb_param.c
> index b27442a..ee8cc67 100644
> --- a/drivers/net/ixgb/ixgb_param.c
> +++ b/drivers/net/ixgb/ixgb_param.c
> @@ -284,7 +284,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
> } else {
> tx_ring->count = opt.def;
> }
> - IXGB_ROUNDUP(tx_ring->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
> + tx_ring->count = ALIGN(tx_ring->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
> }
> { /* Receive Descriptor Count */
> struct ixgb_option opt = {
> @@ -303,7 +303,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
> } else {
> rx_ring->count = opt.def;
> }
> - IXGB_ROUNDUP(rx_ring->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
> + rx_ring->count = ALIGN(rx_ring->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
> }
> { /* Receive Checksum Offload Enable */
> struct ixgb_option opt = {
>
>
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [KJ][PATCH]ROUND_UP macro cleanup in drivers/net/ixgb
@ 2007-04-03 5:45 ` Kok, Auke
0 siblings, 0 replies; 12+ messages in thread
From: Kok, Auke @ 2007-04-03 5:45 UTC (permalink / raw)
To: Milind Arun Choudhary
Cc: kernel-janitors, e1000-devel, linux-kernel, akpm, auke-jan.h.kok,
john.ronciak, jesse.brandeburg, ayyappan.veeraiyan
Milind Arun Choudhary wrote:
> IXGB_ROUNDUP macro cleanup ,use ALIGN
cool beans!
Same reply as to the ALIGN patch you sent for e1000 -> We'll take it for a spin
and I'll push your patch upstream as part of the regular updates!
Thanks,
Auke
>
> Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
>
> ---
>
> ixgb.h | 3 ---
> ixgb_ethtool.c | 4 ++--
> ixgb_main.c | 4 ++--
> ixgb_param.c | 4 ++--
> 4 files changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
> index cf30a10..c8e9086 100644
> --- a/drivers/net/ixgb/ixgb.h
> +++ b/drivers/net/ixgb/ixgb.h
> @@ -111,9 +111,6 @@ struct ixgb_adapter;
> /* How many Rx Buffers do we bundle into one write to the hardware ? */
> #define IXGB_RX_BUFFER_WRITE 8 /* Must be power of 2 */
>
> -/* only works for sizes that are powers of 2 */
> -#define IXGB_ROUNDUP(i, size) ((i) = (((i) + (size) - 1) & ~((size) - 1)))
> -
> /* wrapper around a pointer to a socket buffer,
> * so a DMA handle can be stored along with the buffer */
> struct ixgb_buffer {
> diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
> index d6628bd..cdefaff 100644
> --- a/drivers/net/ixgb/ixgb_ethtool.c
> +++ b/drivers/net/ixgb/ixgb_ethtool.c
> @@ -577,11 +577,11 @@ ixgb_set_ringparam(struct net_device *netdev,
>
> rxdr->count = max(ring->rx_pending,(uint32_t)MIN_RXD);
> rxdr->count = min(rxdr->count,(uint32_t)MAX_RXD);
> - IXGB_ROUNDUP(rxdr->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
> + rxdr->count = ALIGN(rxdr->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
>
> txdr->count = max(ring->tx_pending,(uint32_t)MIN_TXD);
> txdr->count = min(txdr->count,(uint32_t)MAX_TXD);
> - IXGB_ROUNDUP(txdr->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
> + txdr->count = ALIGN(txdr->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
>
> if(netif_running(adapter->netdev)) {
> /* Try to get new resources before deleting old */
> diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
> index afc2ec7..158c71e 100644
> --- a/drivers/net/ixgb/ixgb_main.c
> +++ b/drivers/net/ixgb/ixgb_main.c
> @@ -685,7 +685,7 @@ ixgb_setup_tx_resources(struct ixgb_adapter *adapter)
> /* round up to nearest 4K */
>
> txdr->size = txdr->count * sizeof(struct ixgb_tx_desc);
> - IXGB_ROUNDUP(txdr->size, 4096);
> + txdr->size = ALIGN(txdr->size, 4096);
>
> txdr->desc = pci_alloc_consistent(pdev, txdr->size, &txdr->dma);
> if(!txdr->desc) {
> @@ -774,7 +774,7 @@ ixgb_setup_rx_resources(struct ixgb_adapter *adapter)
> /* Round up to nearest 4K */
>
> rxdr->size = rxdr->count * sizeof(struct ixgb_rx_desc);
> - IXGB_ROUNDUP(rxdr->size, 4096);
> + rxdr->size = ALIGN(rxdr->size, 4096);
>
> rxdr->desc = pci_alloc_consistent(pdev, rxdr->size, &rxdr->dma);
>
> diff --git a/drivers/net/ixgb/ixgb_param.c b/drivers/net/ixgb/ixgb_param.c
> index b27442a..ee8cc67 100644
> --- a/drivers/net/ixgb/ixgb_param.c
> +++ b/drivers/net/ixgb/ixgb_param.c
> @@ -284,7 +284,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
> } else {
> tx_ring->count = opt.def;
> }
> - IXGB_ROUNDUP(tx_ring->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
> + tx_ring->count = ALIGN(tx_ring->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
> }
> { /* Receive Descriptor Count */
> struct ixgb_option opt = {
> @@ -303,7 +303,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
> } else {
> rx_ring->count = opt.def;
> }
> - IXGB_ROUNDUP(rx_ring->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
> + rx_ring->count = ALIGN(rx_ring->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
> }
> { /* Receive Checksum Offload Enable */
> struct ixgb_option opt = {
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [KJ][PATCH]ROUND_UP macro cleanup in drivers/net/ppp_generic.c
@ 2007-04-04 17:49 ` Milind Arun Choudhary
0 siblings, 0 replies; 12+ messages in thread
From: Milind Arun Choudhary @ 2007-04-04 17:46 UTC (permalink / raw)
To: kernel-janitors; +Cc: linux-kernel, akpm, linux-ppp, paulus
ROUND_UP macro cleanup use DIV_ROUND_UP
Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
---
ppp_generic.c | 4 +---
1 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index ef58e41..4b302f3 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -88,8 +88,6 @@ struct ppp_file {
#define PF_TO_PPP(pf) PF_TO_X(pf, struct ppp)
#define PF_TO_CHANNEL(pf) PF_TO_X(pf, struct channel)
-#define ROUNDUP(n, x) (((n) + (x) - 1) / (x))
-
/*
* Data structure describing one ppp unit.
* A ppp unit corresponds to a ppp network interface device
@@ -1297,7 +1295,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
*/
fragsize = len;
if (nfree > 1)
- fragsize = ROUNDUP(fragsize, nfree);
+ fragsize = DIV_ROUND_UP(fragsize, nfree);
/* nbigger channels get fragsize bytes, the rest get fragsize-1,
except if nbigger=0, then they all get fragsize. */
nbigger = len % nfree;
---
Milind Arun Choudhary
^ permalink raw reply related [flat|nested] 12+ messages in thread* [KJ] [PATCH]ROUND_UP macro cleanup in drivers/net/ppp_generic.c
@ 2007-04-04 17:49 ` Milind Arun Choudhary
0 siblings, 0 replies; 12+ messages in thread
From: Milind Arun Choudhary @ 2007-04-04 17:53 UTC (permalink / raw)
To: kernel-janitors; +Cc: linux-kernel, akpm, linux-ppp, paulus
ROUND_UP macro cleanup use DIV_ROUND_UP
Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
---
ppp_generic.c | 4 +---
1 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index ef58e41..4b302f3 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -88,8 +88,6 @@ struct ppp_file {
#define PF_TO_PPP(pf) PF_TO_X(pf, struct ppp)
#define PF_TO_CHANNEL(pf) PF_TO_X(pf, struct channel)
-#define ROUNDUP(n, x) (((n) + (x) - 1) / (x))
-
/*
* Data structure describing one ppp unit.
* A ppp unit corresponds to a ppp network interface device
@@ -1297,7 +1295,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
*/
fragsize = len;
if (nfree > 1)
- fragsize = ROUNDUP(fragsize, nfree);
+ fragsize = DIV_ROUND_UP(fragsize, nfree);
/* nbigger channels get fragsize bytes, the rest get fragsize-1,
except if nbigger=0, then they all get fragsize. */
nbigger = len % nfree;
---
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] 12+ messages in thread* [KJ][PATCH]ROUND_UP macro cleanup in drivers/net/ppp_generic.c
@ 2007-04-04 17:49 ` Milind Arun Choudhary
0 siblings, 0 replies; 12+ messages in thread
From: Milind Arun Choudhary @ 2007-04-04 17:49 UTC (permalink / raw)
To: kernel-janitors; +Cc: linux-kernel, akpm, linux-ppp, paulus
ROUND_UP macro cleanup use DIV_ROUND_UP
Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
---
ppp_generic.c | 4 +---
1 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index ef58e41..4b302f3 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -88,8 +88,6 @@ struct ppp_file {
#define PF_TO_PPP(pf) PF_TO_X(pf, struct ppp)
#define PF_TO_CHANNEL(pf) PF_TO_X(pf, struct channel)
-#define ROUNDUP(n, x) (((n) + (x) - 1) / (x))
-
/*
* Data structure describing one ppp unit.
* A ppp unit corresponds to a ppp network interface device
@@ -1297,7 +1295,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
*/
fragsize = len;
if (nfree > 1)
- fragsize = ROUNDUP(fragsize, nfree);
+ fragsize = DIV_ROUND_UP(fragsize, nfree);
/* nbigger channels get fragsize bytes, the rest get fragsize-1,
except if nbigger==0, then they all get fragsize. */
nbigger = len % nfree;
---
Milind Arun Choudhary
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [KJ] [PATCH]ROUND_UP macro cleanup in drivers/net/ppp_generic.c
2007-04-04 17:49 ` [KJ][PATCH]ROUND_UP " Milind Arun Choudhary
(?)
@ 2007-04-09 18:28 ` Paul Mackerras
-1 siblings, 0 replies; 12+ messages in thread
From: Paul Mackerras @ 2007-04-09 18:28 UTC (permalink / raw)
To: Milind Arun Choudhary; +Cc: kernel-janitors, linux-kernel, akpm, linux-ppp
Milind Arun Choudhary writes:
> ROUND_UP macro cleanup use DIV_ROUND_UP
>
> Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
Acked-by: Paul Mackerras <paulus@samba.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] 12+ messages in thread
* [KJ][PATCH]ROUND_UP macro cleanup in drivers/char/lp.c
2007-04-03 2:55 ` [KJ] [PATCH]ROUND_UP " Milind Arun Choudhary
@ 2007-04-04 17:49 ` Milind Arun Choudhary
-1 siblings, 0 replies; 12+ messages in thread
From: Milind Arun Choudhary @ 2007-04-04 17:37 UTC (permalink / raw)
To: kernel-janitors; +Cc: linux-kernel, akpm
ROUND_UP macro cleanup use DIV_ROUND_UP
Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
---
lp.c | 5 +----
1 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/char/lp.c b/drivers/char/lp.c
index b51d08b..c086910 100644
--- a/drivers/char/lp.c
+++ b/drivers/char/lp.c
@@ -139,9 +139,6 @@
/* if you have more than 8 printers, remember to increase LP_NO */
#define LP_NO 8
-/* ROUND_UP macro from fs/select.c */
-#define ROUND_UP(x,y) (((x)+(y)-1)/(y))
-
static struct lp_struct lp_table[LP_NO];
static unsigned int lp_count = 0;
@@ -652,7 +649,7 @@ static int lp_ioctl(struct inode *inode, struct file *file,
(par_timeout.tv_usec < 0)) {
return -EINVAL;
}
- to_jiffies = ROUND_UP(par_timeout.tv_usec, 1000000/HZ);
+ to_jiffies = DIV_ROUND_UP(par_timeout.tv_usec, 1000000/HZ);
to_jiffies += par_timeout.tv_sec * (long) HZ;
if (to_jiffies <= 0) {
return -EINVAL;
--
Milind Arun Choudhary
^ permalink raw reply related [flat|nested] 12+ messages in thread* [KJ] [PATCH]ROUND_UP macro cleanup in drivers/char/lp.c
@ 2007-04-04 17:49 ` Milind Arun Choudhary
0 siblings, 0 replies; 12+ messages in thread
From: Milind Arun Choudhary @ 2007-04-04 17:49 UTC (permalink / raw)
To: kernel-janitors; +Cc: linux-kernel, akpm
ROUND_UP macro cleanup use DIV_ROUND_UP
Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
---
lp.c | 5 +----
1 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/char/lp.c b/drivers/char/lp.c
index b51d08b..c086910 100644
--- a/drivers/char/lp.c
+++ b/drivers/char/lp.c
@@ -139,9 +139,6 @@
/* if you have more than 8 printers, remember to increase LP_NO */
#define LP_NO 8
-/* ROUND_UP macro from fs/select.c */
-#define ROUND_UP(x,y) (((x)+(y)-1)/(y))
-
static struct lp_struct lp_table[LP_NO];
static unsigned int lp_count = 0;
@@ -652,7 +649,7 @@ static int lp_ioctl(struct inode *inode, struct file *file,
(par_timeout.tv_usec < 0)) {
return -EINVAL;
}
- to_jiffies = ROUND_UP(par_timeout.tv_usec, 1000000/HZ);
+ to_jiffies = DIV_ROUND_UP(par_timeout.tv_usec, 1000000/HZ);
to_jiffies += par_timeout.tv_sec * (long) HZ;
if (to_jiffies <= 0) {
return -EINVAL;
--
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] 12+ messages in thread
end of thread, other threads:[~2007-04-09 21:49 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-03 2:43 [KJ][PATCH]ROUND_UP macro cleanup in drivers/net/ixgb Milind Arun Choudhary
2007-04-03 2:55 ` [KJ] [PATCH]ROUND_UP " Milind Arun Choudhary
2007-04-03 5:45 ` Kok, Auke
2007-04-03 5:45 ` [KJ][PATCH]ROUND_UP " Kok, Auke
2007-04-04 17:46 ` [KJ][PATCH]ROUND_UP macro cleanup in drivers/net/ppp_generic.c Milind Arun Choudhary
2007-04-04 17:53 ` [KJ] [PATCH]ROUND_UP " Milind Arun Choudhary
2007-04-04 17:49 ` [KJ][PATCH]ROUND_UP " Milind Arun Choudhary
2007-04-09 18:28 ` [KJ] [PATCH]ROUND_UP " Paul Mackerras
2007-04-09 18:28 ` [KJ][PATCH]ROUND_UP " Paul Mackerras
2007-04-09 18:28 ` Paul Mackerras
-- strict thread matches above, loose matches on Subject: below --
2007-04-04 17:37 [KJ][PATCH]ROUND_UP macro cleanup in drivers/char/lp.c Milind Arun Choudhary
2007-04-04 17:49 ` [KJ] [PATCH]ROUND_UP " Milind Arun Choudhary
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.