All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/net/tokenring/3c359.c
@ 2007-08-13 10:25 ` Surya Prabhakar N
  0 siblings, 0 replies; 8+ messages in thread
From: Surya Prabhakar N @ 2007-08-13 10:13 UTC (permalink / raw)
  To: mikep, netdev; +Cc: linux-tr, Linux Kernel, kernel-janitors

Hi,
   Replacing kmalloc with kzalloc and cleaning up memset in 
drivers/net/tokenring/3c359.c


Signed-off-by: Surya Prabhakar <surya.prabhakar@wipro.com>
---

diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c
index 9f1b6ab..d36dd53 100644
--- a/drivers/net/tokenring/3c359.c
+++ b/drivers/net/tokenring/3c359.c
@@ -641,14 +641,14 @@ static int xl_open(struct net_device *dev)
 	 * Now to set up the Rx and Tx buffer structures
 	 */
 	/* These MUST be on 8 byte boundaries */
-	xl_priv->xl_tx_ring = kmalloc((sizeof(struct xl_tx_desc) * XL_TX_RING_SIZE) + 7, GFP_DMA | GFP_KERNEL) ; 
+	xl_priv->xl_tx_ring = kzalloc((sizeof(struct xl_tx_desc) * XL_TX_RING_SIZE) + 7, GFP_DMA | GFP_KERNEL) ; 
 	if (xl_priv->xl_tx_ring == NULL) {
 		printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers.\n",
 				     dev->name);
 		free_irq(dev->irq,dev);
 		return -ENOMEM;
 	}
-	xl_priv->xl_rx_ring = kmalloc((sizeof(struct xl_rx_desc) * XL_RX_RING_SIZE) +7, GFP_DMA | GFP_KERNEL) ; 
+	xl_priv->xl_rx_ring = kzalloc((sizeof(struct xl_rx_desc) * XL_RX_RING_SIZE) +7, GFP_DMA | GFP_KERNEL) ; 
 	if (xl_priv->xl_tx_ring == NULL) {
 		printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers.\n",
 				     dev->name);
@@ -656,8 +656,6 @@ static int xl_open(struct net_device *dev)
 		kfree(xl_priv->xl_tx_ring);
 		return -ENOMEM;
 	}
-	memset(xl_priv->xl_tx_ring,0,sizeof(struct xl_tx_desc) * XL_TX_RING_SIZE) ; 
-	memset(xl_priv->xl_rx_ring,0,sizeof(struct xl_rx_desc) * XL_RX_RING_SIZE) ; 
 
 	 /* Setup Rx Ring */
 	 for (i=0 ; i < XL_RX_RING_SIZE ; i++) { 

--
thanks
surya.

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

* [KJ] drivers/net/tokenring/3c359.c
@ 2007-08-13 10:25 ` Surya Prabhakar N
  0 siblings, 0 replies; 8+ messages in thread
From: Surya Prabhakar N @ 2007-08-13 10:25 UTC (permalink / raw)
  To: mikep, netdev; +Cc: linux-tr, Linux Kernel, kernel-janitors

Hi,
   Replacing kmalloc with kzalloc and cleaning up memset in 
drivers/net/tokenring/3c359.c


Signed-off-by: Surya Prabhakar <surya.prabhakar@wipro.com>
---

diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c
index 9f1b6ab..d36dd53 100644
--- a/drivers/net/tokenring/3c359.c
+++ b/drivers/net/tokenring/3c359.c
@@ -641,14 +641,14 @@ static int xl_open(struct net_device *dev)
 	 * Now to set up the Rx and Tx buffer structures
 	 */
 	/* These MUST be on 8 byte boundaries */
-	xl_priv->xl_tx_ring = kmalloc((sizeof(struct xl_tx_desc) * XL_TX_RING_SIZE) + 7, GFP_DMA | GFP_KERNEL) ; 
+	xl_priv->xl_tx_ring = kzalloc((sizeof(struct xl_tx_desc) * XL_TX_RING_SIZE) + 7, GFP_DMA | GFP_KERNEL) ; 
 	if (xl_priv->xl_tx_ring = NULL) {
 		printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers.\n",
 				     dev->name);
 		free_irq(dev->irq,dev);
 		return -ENOMEM;
 	}
-	xl_priv->xl_rx_ring = kmalloc((sizeof(struct xl_rx_desc) * XL_RX_RING_SIZE) +7, GFP_DMA | GFP_KERNEL) ; 
+	xl_priv->xl_rx_ring = kzalloc((sizeof(struct xl_rx_desc) * XL_RX_RING_SIZE) +7, GFP_DMA | GFP_KERNEL) ; 
 	if (xl_priv->xl_tx_ring = NULL) {
 		printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers.\n",
 				     dev->name);
@@ -656,8 +656,6 @@ static int xl_open(struct net_device *dev)
 		kfree(xl_priv->xl_tx_ring);
 		return -ENOMEM;
 	}
-	memset(xl_priv->xl_tx_ring,0,sizeof(struct xl_tx_desc) * XL_TX_RING_SIZE) ; 
-	memset(xl_priv->xl_rx_ring,0,sizeof(struct xl_rx_desc) * XL_RX_RING_SIZE) ; 
 
 	 /* Setup Rx Ring */
 	 for (i=0 ; i < XL_RX_RING_SIZE ; i++) { 

--
thanks
surya.
_______________________________________________
REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon.
To resubscribe, send email to majordomo@vger.kernel.org with
&quot;subscribe kernel-janitors&quot; in message body and follow instructions.

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] 8+ messages in thread

* [KJ] Re: drivers/net/tokenring/3c359.c
  2007-08-13 10:25 ` [KJ] drivers/net/tokenring/3c359.c Surya Prabhakar N
@ 2007-08-13 13:59   ` Alan Cox
  -1 siblings, 0 replies; 8+ messages in thread
From: Alan Cox @ 2007-08-13 13:59 UTC (permalink / raw)
  To: surya.prabhakar; +Cc: mikep, netdev, linux-tr, Linux Kernel, kernel-janitors

On Mon, 13 Aug 2007 15:43:30 +0530
Surya Prabhakar N <surya.prabhakar@wipro.com> wrote:

> Hi,
>    Replacing kmalloc with kzalloc and cleaning up memset in 
> drivers/net/tokenring/3c359.c
> 
> 
> Signed-off-by: Surya Prabhakar <surya.prabhakar@wipro.com>

Acked-by: Alan Cox <alan@redhat.com>
_______________________________________________
REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon.
To resubscribe, send email to majordomo@vger.kernel.org with
&quot;subscribe kernel-janitors&quot; in message body and follow instructions.

Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

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

* Re: drivers/net/tokenring/3c359.c
@ 2007-08-13 13:59   ` Alan Cox
  0 siblings, 0 replies; 8+ messages in thread
From: Alan Cox @ 2007-08-13 13:59 UTC (permalink / raw)
  To: surya.prabhakar; +Cc: mikep, netdev, linux-tr, Linux Kernel, kernel-janitors

On Mon, 13 Aug 2007 15:43:30 +0530
Surya Prabhakar N <surya.prabhakar@wipro.com> wrote:

> Hi,
>    Replacing kmalloc with kzalloc and cleaning up memset in 
> drivers/net/tokenring/3c359.c
> 
> 
> Signed-off-by: Surya Prabhakar <surya.prabhakar@wipro.com>

Acked-by: Alan Cox <alan@redhat.com>

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

* [KJ] Re: drivers/net/tokenring/3c359.c
  2007-08-13 10:25 ` [KJ] drivers/net/tokenring/3c359.c Surya Prabhakar N
@ 2007-08-14  5:50   ` Jeff Garzik
  -1 siblings, 0 replies; 8+ messages in thread
From: Jeff Garzik @ 2007-08-14  5:50 UTC (permalink / raw)
  To: surya.prabhakar; +Cc: mikep, netdev, linux-tr, Linux Kernel, kernel-janitors

Surya Prabhakar N wrote:
> Hi,
>    Replacing kmalloc with kzalloc and cleaning up memset in 
> drivers/net/tokenring/3c359.c
> 
> 
> Signed-off-by: Surya Prabhakar <surya.prabhakar@wipro.com>

applied


_______________________________________________
REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon.
To resubscribe, send email to majordomo@vger.kernel.org with
&quot;subscribe kernel-janitors&quot; in message body and follow instructions.

Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

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

* Re: drivers/net/tokenring/3c359.c
@ 2007-08-14  5:50   ` Jeff Garzik
  0 siblings, 0 replies; 8+ messages in thread
From: Jeff Garzik @ 2007-08-14  5:50 UTC (permalink / raw)
  To: surya.prabhakar; +Cc: mikep, netdev, linux-tr, Linux Kernel, kernel-janitors

Surya Prabhakar N wrote:
> Hi,
>    Replacing kmalloc with kzalloc and cleaning up memset in 
> drivers/net/tokenring/3c359.c
> 
> 
> Signed-off-by: Surya Prabhakar <surya.prabhakar@wipro.com>

applied



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

* [KJ] RE: drivers/net/tokenring/3c359.c
  2007-08-14  5:50   ` drivers/net/tokenring/3c359.c Jeff Garzik
@ 2007-08-16  6:43     ` Sivakumar Subramani
  -1 siblings, 0 replies; 8+ messages in thread
From: Sivakumar Subramani @ 2007-08-16  6:43 UTC (permalink / raw)
  To: Jeff Garzik, surya.prabhakar
  Cc: mikep, netdev, linux-tr, Linux Kernel, kernel-janitors

What exactly the difference between kzalloc and kcalloc? From the
definition, I could see that kcalloc should be used for array
allocation. But I could see kzalloc is used for allocation arrays as in
the below patch.

Any coding standard (or) developers can use kzalloc and kcalloc as per
their coding practice??

Thanks,
~Siva
-----Original Message-----
From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org]
On Behalf Of Jeff Garzik
Sent: Tuesday, August 14, 2007 11:20 AM
To: surya.prabhakar@wipro.com
Cc: mikep@linuxtr.net; netdev@vger.kernel.org; linux-tr@linuxtr.net;
Linux Kernel; kernel-janitors
Subject: Re: drivers/net/tokenring/3c359.c

Surya Prabhakar N wrote:
> Hi,
>    Replacing kmalloc with kzalloc and cleaning up memset in 
> drivers/net/tokenring/3c359.c
> 
> 
> Signed-off-by: Surya Prabhakar <surya.prabhakar@wipro.com>

applied


-
To unsubscribe from this list: send the line "unsubscribe netdev" in the
body of a message to majordomo@vger.kernel.org More majordomo info at
http://vger.kernel.org/majordomo-info.html

_______________________________________________
REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon.
To resubscribe, send email to majordomo@vger.kernel.org with
&quot;subscribe kernel-janitors&quot; in message body and follow instructions.

Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

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

* RE: drivers/net/tokenring/3c359.c
@ 2007-08-16  6:43     ` Sivakumar Subramani
  0 siblings, 0 replies; 8+ messages in thread
From: Sivakumar Subramani @ 2007-08-16  6:43 UTC (permalink / raw)
  To: Jeff Garzik, surya.prabhakar
  Cc: mikep, netdev, linux-tr, Linux Kernel, kernel-janitors

What exactly the difference between kzalloc and kcalloc? From the
definition, I could see that kcalloc should be used for array
allocation. But I could see kzalloc is used for allocation arrays as in
the below patch.

Any coding standard (or) developers can use kzalloc and kcalloc as per
their coding practice??

Thanks,
~Siva
-----Original Message-----
From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org]
On Behalf Of Jeff Garzik
Sent: Tuesday, August 14, 2007 11:20 AM
To: surya.prabhakar@wipro.com
Cc: mikep@linuxtr.net; netdev@vger.kernel.org; linux-tr@linuxtr.net;
Linux Kernel; kernel-janitors
Subject: Re: drivers/net/tokenring/3c359.c

Surya Prabhakar N wrote:
> Hi,
>    Replacing kmalloc with kzalloc and cleaning up memset in 
> drivers/net/tokenring/3c359.c
> 
> 
> Signed-off-by: Surya Prabhakar <surya.prabhakar@wipro.com>

applied


-
To unsubscribe from this list: send the line "unsubscribe netdev" in the
body of a message to majordomo@vger.kernel.org More majordomo info at
http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2007-08-16  6:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-13 10:13 drivers/net/tokenring/3c359.c Surya Prabhakar N
2007-08-13 10:25 ` [KJ] drivers/net/tokenring/3c359.c Surya Prabhakar N
2007-08-13 13:59 ` [KJ] drivers/net/tokenring/3c359.c Alan Cox
2007-08-13 13:59   ` drivers/net/tokenring/3c359.c Alan Cox
2007-08-14  5:50 ` [KJ] drivers/net/tokenring/3c359.c Jeff Garzik
2007-08-14  5:50   ` drivers/net/tokenring/3c359.c Jeff Garzik
2007-08-16  6:43   ` [KJ] drivers/net/tokenring/3c359.c Sivakumar Subramani
2007-08-16  6:43     ` drivers/net/tokenring/3c359.c Sivakumar Subramani

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.