Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965628AbcJXVBC (ORCPT ); Mon, 24 Oct 2016 17:01:02 -0400 Received: from mout.web.de ([212.227.15.14]:62311 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965100AbcJXVBA (ORCPT ); Mon, 24 Oct 2016 17:01:00 -0400 Subject: [PATCH 2/3] [media] au0828-video: Delete three error messages for a failed memory allocation To: linux-media@vger.kernel.org, Hans Verkuil , Laurent Pinchart , Mauro Carvalho Chehab , =?UTF-8?Q?Rafael_Louren=c3=a7o_de_Lima_Chehab?= , Shuah Khan , Wolfram Sang References: Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: <4bd439b2-731d-4b81-eb65-1efdc20cd231@users.sourceforge.net> Date: Mon, 24 Oct 2016 23:00:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:4z/8Q4Xy1Un2McwfsKWHMT8z5YQoCxnLFBbhTmvPi1JxEW3ScEI ZmWeOiigsFfo/9qGyuze0lj4fVk+AnYKWYudQWEUjft9TP3ypzAmHKR7DJNjtcWD1L/hfJo FXpB61aV/ayGahn9EKBe/9llZ37V5VWp/QNqo1ofYiCarotuiJw0elZLMxvTXk4xKNGln2O F00cHjIjpIE+np0fl61/Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:ksvPGaY56gY=:F8yj+B3bvvWL2wautS57iF TdinOJHnrelMLneGrXaX8GCqMNJzHXY6rS46pwZNJUXIjmSp6DsK8A4LoY+ETmIbaWY4OFm7C 9t2uXcQTvdth8X1gAHCH3eITNsmakDSHOz/0Q5qJVaSGE3Uz90DLyAoI8/9nk2B3M11UprNHb etG53NFe0FcBw/tUl2mpTVse/hkkN0ZtsesdX41LqbMVQ8mA8HMbil6oVsft4zGolb+Ed+89/ OSAtLDq+yP5+nb7n477y/AD4SxrlBI82gvHnCjKarwumQc7lHwMYLTH1iaL+49qxEh5xbiUU1 CW3EfbR4wvuXIlQONHTWRUpwijEV8n0O+O9wNhLhWawraRcTUyfhYnil4dZiFNe/nFqMNQgpN GM6eLZehxxIsyZoBz0n3/PjyTQol7Sexwsf6q+ZQFTNS31T+Kr44ZXczUCcXj9s54kGLqnRHM HcRL5qMzzFXuGa/7jrteQR0ODkyPRYnSLiad4x246mDbNju6rx8u5+M+z/1pK5C2ASRQPw8N3 J2CEup6ak32QLhrd/h5i99ZD7LFI7l5sPNE6/h5jUThi4U6MwhuiVYDQ4jTs5Uyinw0z4k2/a M1mnWs7ewS49BnEmGfGDaD/6l0IIOKG/A6DruwkyycxglL3KoLODHBzNYYj6+4ew8VEXs34WE YMX7KH8ISvZ3A6BZzM02G1B1IlSLjC0mhqDYCXoCXrJRFczATjJlthp1u1UyPQ863cHTeADHn vVYCKrYZbqsVbGfHRoCxmGQOKBOkkyV4g0q0oFhgbt31gEhof4mR8hOph05E3Pu7Bi9gP5JdT PJcIHdG Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1727 Lines: 47 From: Markus Elfring Date: Mon, 24 Oct 2016 22:28:03 +0200 Omit extra messages for a memory allocation failure in this function. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring --- drivers/media/usb/au0828/au0828-video.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c index 85b13c1..b5c88a7 100644 --- a/drivers/media/usb/au0828/au0828-video.c +++ b/drivers/media/usb/au0828/au0828-video.c @@ -224,17 +224,14 @@ static int au0828_init_isoc(struct au0828_dev *dev, int max_packets, dev->isoc_ctl.urb = kcalloc(num_bufs, sizeof(*dev->isoc_ctl.urb), GFP_KERNEL); - if (!dev->isoc_ctl.urb) { - au0828_isocdbg("cannot alloc memory for usb buffers\n"); + if (!dev->isoc_ctl.urb) return -ENOMEM; - } dev->isoc_ctl.transfer_buffer = kcalloc(num_bufs, sizeof(*dev->isoc_ctl .transfer_buffer), GFP_KERNEL); if (!dev->isoc_ctl.transfer_buffer) { - au0828_isocdbg("cannot allocate memory for usb transfer\n"); kfree(dev->isoc_ctl.urb); return -ENOMEM; } @@ -256,10 +253,6 @@ static int au0828_init_isoc(struct au0828_dev *dev, int max_packets, dev->isoc_ctl.transfer_buffer[i] = usb_alloc_coherent(dev->usbdev, sb_size, GFP_KERNEL, &urb->transfer_dma); if (!dev->isoc_ctl.transfer_buffer[i]) { - printk("unable to allocate %i bytes for transfer" - " buffer %i%s\n", - sb_size, i, - in_interrupt() ? " while in int" : ""); au0828_uninit_isoc(dev); return -ENOMEM; } -- 2.10.1