Skip to contentSkip to conversation

drivers/staging/usbip/stub_rx.c: kmem_cache_alloc/memset -> kmem_cache_zalloc

PATCH Applied Wei Yongjun 2 participants 2 messages Feb 6, 2009 – Feb 7, 2009 Staging

lore
Share & tools
lore
#0 lore raw

Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: 7bit

Used kmem_cache_zalloc instead of kmem_cache_alloc/memset.

---
 drivers/staging/usbip/stub_rx.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/staging/usbip/stub_rx.c +1 -3
index 2eb6137..1c71062 100644
@@ -334,7 +334,7 @@ static struct stub_priv *stub_priv_alloc(struct stub_device *sdev,
 
 	spin_lock_irqsave(&sdev->priv_lock, flags);
 
-	priv = kmem_cache_alloc(stub_priv_cache, GFP_ATOMIC);
+	priv = kmem_cache_zalloc(stub_priv_cache, GFP_ATOMIC);
 	if (!priv) {
 		dev_err(&sdev->interface->dev, "alloc stub_priv\n");
 		spin_unlock_irqrestore(&sdev->priv_lock, flags);
@@ -342,8 +342,6 @@ static struct stub_priv *stub_priv_alloc(struct stub_device *sdev,
 		return NULL;
 	}
 
-	memset(priv, 0, sizeof(struct stub_priv));
-
 	priv->seqnum = pdu->base.seqnum;
 	priv->sdev = sdev;
 
Signature · 1 line
1.5.3.8
#1 lore raw

patch staging-usbip-kmem_cache_alloc-memset-kmem_cache_zalloc.patch added to gregkh-2.6 tree

This is a note to let you know that I've just added the patch titled

    Subject: Staging: usbip: kmem_cache_alloc/memset -> kmem_cache_zalloc

to my gregkh-2.6 tree. Its filename is

staging-usbip-kmem_cache_alloc-memset-kmem_cache_zalloc.patch

This tree can be found at
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/

Quoted 1 line

From [email protected] Fri Feb 6 15:53:31 2009

From: Wei Yongjun <[email protected]>
Date: Fri, 06 Feb 2009 11:08:58 +0800
Subject: Staging: usbip: kmem_cache_alloc/memset -> kmem_cache_zalloc
To: Greg Kroah-Hartman <[email protected]>, LKML <[email protected]>
Message-ID: <[email protected]>

Used kmem_cache_zalloc instead of kmem_cache_alloc/memset.

---
 drivers/staging/usbip/stub_rx.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/usbip/stub_rx.c +1 -3
@@ -334,7 +334,7 @@ static struct stub_priv *stub_priv_alloc
 
 	spin_lock_irqsave(&sdev->priv_lock, flags);
 
-	priv = kmem_cache_alloc(stub_priv_cache, GFP_ATOMIC);
+	priv = kmem_cache_zalloc(stub_priv_cache, GFP_ATOMIC);
 	if (!priv) {
 		dev_err(&sdev->interface->dev, "alloc stub_priv\n");
 		spin_unlock_irqrestore(&sdev->priv_lock, flags);
@@ -342,8 +342,6 @@ static struct stub_priv *stub_priv_alloc
 		return NULL;
 	}
 
-	memset(priv, 0, sizeof(struct stub_priv));
-
 	priv->seqnum = pdu->base.seqnum;
 	priv->sdev = sdev;
 

Patches currently in gregkh-2.6 which might be from [email protected] are

staging/staging-usbip-kmem_cache_alloc-memset-kmem_cache_zalloc.patch