linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* drivers/staging/usbip/stub_rx.c: kmem_cache_alloc/memset -> kmem_cache_zalloc
@ 2009-02-06  3:08 Wei Yongjun
  2009-02-07  1:11 ` patch staging-usbip-kmem_cache_alloc-memset-kmem_cache_zalloc.patch added to gregkh-2.6 tree gregkh
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2009-02-06  3:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman, LKML

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

Used kmem_cache_zalloc instead of kmem_cache_alloc/memset.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 drivers/staging/usbip/stub_rx.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/usbip/stub_rx.c b/drivers/staging/usbip/stub_rx.c
index 2eb6137..1c71062 100644
--- a/drivers/staging/usbip/stub_rx.c
+++ b/drivers/staging/usbip/stub_rx.c
@@ -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;
 
-- 
1.5.3.8




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

* patch staging-usbip-kmem_cache_alloc-memset-kmem_cache_zalloc.patch added to gregkh-2.6 tree
  2009-02-06  3:08 drivers/staging/usbip/stub_rx.c: kmem_cache_alloc/memset -> kmem_cache_zalloc Wei Yongjun
@ 2009-02-07  1:11 ` gregkh
  0 siblings, 0 replies; 2+ messages in thread
From: gregkh @ 2009-02-07  1:11 UTC (permalink / raw)
  To: yjwei, gregkh, linux-kernel


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/


>From yjwei@cn.fujitsu.com  Fri Feb  6 15:53:31 2009
From: Wei Yongjun <yjwei@cn.fujitsu.com>
Date: Fri, 06 Feb 2009 11:08:58 +0800
Subject: Staging: usbip: kmem_cache_alloc/memset -> kmem_cache_zalloc
To: Greg Kroah-Hartman <gregkh@suse.de>, LKML <linux-kernel@vger.kernel.org>
Message-ID: <498BA9CA.7060700@cn.fujitsu.com>


Used kmem_cache_zalloc instead of kmem_cache_alloc/memset.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/staging/usbip/stub_rx.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/drivers/staging/usbip/stub_rx.c
+++ b/drivers/staging/usbip/stub_rx.c
@@ -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 yjwei@cn.fujitsu.com are

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

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

end of thread, other threads:[~2009-02-07  1:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-06  3:08 drivers/staging/usbip/stub_rx.c: kmem_cache_alloc/memset -> kmem_cache_zalloc Wei Yongjun
2009-02-07  1:11 ` patch staging-usbip-kmem_cache_alloc-memset-kmem_cache_zalloc.patch added to gregkh-2.6 tree gregkh

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).