mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Burman Yan" <yan_952@hotmail.com>
To: linux-kernel@vger.kernel.org
Cc: trivial@kernel.org, dbrownell@users.sourceforge.net
Subject: [PATCH 2.6.19-rc5] USB gadget: replace kmalloc+memset with kzalloc
Date: Wed, 22 Nov 2006 20:49:58 +0200	[thread overview]
Message-ID: <BAY20-F2362B2DCA3C310D64DB2BD8E30@phx.gbl> (raw)

[-- Attachment #1: Type: text/plain, Size: 313 bytes --]

Hi.

This trivial patch replaces kmalloc+memset with kzalloc in the usb gadget 
sources.

Regards
Yan Buman

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

[-- Attachment #2: kzalloc_usb_gadget.patch --]
[-- Type: application/octet-stream, Size: 1637 bytes --]

Replace kmalloc+memset with kzalloc

Signed-off-by: Yan Burman <yan_952@hotmail.com>

diff -rubp linux-2.6.19-rc6_orig/drivers/usb/gadget/goku_udc.c linux-2.6.19-rc6/drivers/usb/gadget/goku_udc.c
--- linux-2.6.19-rc6_orig/drivers/usb/gadget/goku_udc.c	2006-11-22 20:29:31.000000000 +0200
+++ linux-2.6.19-rc6/drivers/usb/gadget/goku_udc.c	2006-11-22 20:33:23.000000000 +0200
@@ -1864,14 +1864,13 @@ static int goku_probe(struct pci_dev *pd
 	}
 
 	/* alloc, and start init */
-	dev = kmalloc (sizeof *dev, SLAB_KERNEL);
+	dev = kzalloc (sizeof *dev, SLAB_KERNEL);
 	if (dev == NULL){
 		pr_debug("enomem %s\n", pci_name(pdev));
 		retval = -ENOMEM;
 		goto done;
 	}
 
-	memset(dev, 0, sizeof *dev);
 	spin_lock_init(&dev->lock);
 	dev->pdev = pdev;
 	dev->gadget.ops = &goku_ops;
diff -rubp linux-2.6.19-rc6_orig/drivers/usb/gadget/serial.c linux-2.6.19-rc6/drivers/usb/gadget/serial.c
--- linux-2.6.19-rc6_orig/drivers/usb/gadget/serial.c	2006-11-22 20:29:31.000000000 +0200
+++ linux-2.6.19-rc6/drivers/usb/gadget/serial.c	2006-11-22 20:33:23.000000000 +0200
@@ -1429,7 +1429,7 @@ static int __init gs_bind(struct usb_gad
 		gs_acm_config_desc.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
 	}
 
-	gs_device = dev = kmalloc(sizeof(struct gs_dev), GFP_KERNEL);
+	gs_device = dev = kzalloc(sizeof(struct gs_dev), GFP_KERNEL);
 	if (dev == NULL)
 		return -ENOMEM;
 
@@ -1437,7 +1437,6 @@ static int __init gs_bind(struct usb_gad
 		init_utsname()->sysname, init_utsname()->release,
 		gadget->name);
 
-	memset(dev, 0, sizeof(struct gs_dev));
 	dev->dev_gadget = gadget;
 	spin_lock_init(&dev->dev_lock);
 	INIT_LIST_HEAD(&dev->dev_req_list);

                 reply	other threads:[~2006-11-22 18:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BAY20-F2362B2DCA3C310D64DB2BD8E30@phx.gbl \
    --to=yan_952@hotmail.com \
    --cc=dbrownell@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trivial@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®