From: Peter Senna Tschudin <peter.senna@collabora.com>
To: thomas@winischhofer.net, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
joe@perches.com, sergei.shtylyov@cogentembedded.com
Cc: Peter Senna Tschudin <peter.senna@collabora.com>
Subject: [PATCH V2 6/7] usb-misc: sisusbvga: Remove memory allocation logs
Date: Fri, 15 Jan 2016 18:41:33 +0100 [thread overview]
Message-ID: <1452879694-21206-7-git-send-email-peter.senna@collabora.com> (raw)
In-Reply-To: <1452879694-21206-1-git-send-email-peter.senna@collabora.com>
This patch remove three calls to dev_err() from sisusb_probe() as
reporting memory allocation failures is redundant:
- Remove a call to dev_err() that was reporting unsuccesful call to
kzalloc().
- Remove two calls to dev_err() that were reporting unsuccesful calls
to kmalloc().
One call to dev_err() reporting memory allocation is left unchanged as
the last patch of the series removes it.
Signed-off-by: Peter Senna Tschudin <peter.senna@collabora.com>
---
Changes from V1:
- This patch contains only cleanups.
- The bug fix was moved to another patch.
Tested by compilation only.
drivers/usb/misc/sisusbvga/sisusb.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c
index bea6d88..b3713d5 100644
--- a/drivers/usb/misc/sisusbvga/sisusb.c
+++ b/drivers/usb/misc/sisusbvga/sisusb.c
@@ -3036,10 +3036,9 @@ static int sisusb_probe(struct usb_interface *intf,
/* Allocate memory for our private */
sisusb = kzalloc(sizeof(*sisusb), GFP_KERNEL);
- if (!sisusb) {
- dev_err(&dev->dev, "Failed to allocate memory for private data\n");
+ if (!sisusb)
return -ENOMEM;
- }
+
kref_init(&sisusb->kref);
mutex_init(&(sisusb->lock));
@@ -3066,7 +3065,6 @@ static int sisusb_probe(struct usb_interface *intf,
sisusb->ibufsize = SISUSB_IBUF_SIZE;
sisusb->ibuf = kmalloc(SISUSB_IBUF_SIZE, GFP_KERNEL);
if (!sisusb->ibuf) {
- dev_err(&sisusb->sisusb_dev->dev, "Failed to allocate memory for input buffer");
retval = -ENOMEM;
goto error_2;
}
@@ -3077,7 +3075,6 @@ static int sisusb_probe(struct usb_interface *intf,
sisusb->obuf[i] = kmalloc(SISUSB_OBUF_SIZE, GFP_KERNEL);
if (!sisusb->obuf[i]) {
if (i == 0) {
- dev_err(&sisusb->sisusb_dev->dev, "Failed to allocate memory for output buffer\n");
retval = -ENOMEM;
goto error_3;
}
--
2.5.0
next prev parent reply other threads:[~2016-01-15 17:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-15 17:41 [PATCH V2 0/7] usb-misc: sisusbvga: cleanup and bug fix Peter Senna Tschudin
2016-01-15 17:41 ` [PATCH V2 1/7] usb-misc: sisusbvga: Fix coding style: horizontal whitespace changes Peter Senna Tschudin
2016-01-15 17:56 ` Joe Perches
2016-01-15 18:09 ` Peter Senna
2016-01-15 18:21 ` Alan Stern
2016-01-15 17:41 ` [PATCH V2 2/7] usb-misc: sisusbvga: Fix coding style: vertical " Peter Senna Tschudin
2016-01-15 17:41 ` [PATCH V2 3/7] usb-misc: sisusbvga: Fix coding style: braces, parenthesis, comment Peter Senna Tschudin
2016-01-15 17:41 ` [PATCH V2 4/7] usb-misc: sisusbvga: Fix coding style: remove assignment from if tests Peter Senna Tschudin
2016-01-15 17:41 ` [PATCH V2 5/7] usb-misc: sisusbvga: Remove null test before calls to kfree() Peter Senna Tschudin
2016-01-15 17:41 ` Peter Senna Tschudin [this message]
2016-01-15 17:41 ` [PATCH V2 7/7] usb-misc: sisusbvga: fix error path Peter Senna Tschudin
2016-01-15 17:51 ` [PATCH V2 0/7] usb-misc: sisusbvga: cleanup and bug fix Joe Perches
2016-01-15 18:07 ` Jason Cooper
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=1452879694-21206-7-git-send-email-peter.senna@collabora.com \
--to=peter.senna@collabora.com \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=thomas@winischhofer.net \
/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