From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754866AbcAORmr (ORCPT ); Fri, 15 Jan 2016 12:42:47 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:44879 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751788AbcAORmH (ORCPT ); Fri, 15 Jan 2016 12:42:07 -0500 From: Peter Senna Tschudin 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 Subject: [PATCH V2 6/7] usb-misc: sisusbvga: Remove memory allocation logs Date: Fri, 15 Jan 2016 18:41:33 +0100 Message-Id: <1452879694-21206-7-git-send-email-peter.senna@collabora.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1452879694-21206-1-git-send-email-peter.senna@collabora.com> References: <1452879694-21206-1-git-send-email-peter.senna@collabora.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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