From patchwork Sat Sep 24 13:47:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9349177 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CBB94607F0 for ; Sat, 24 Sep 2016 13:47:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA35028F3A for ; Sat, 24 Sep 2016 13:47:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC705291A4; Sat, 24 Sep 2016 13:47:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28C4C28F3A for ; Sat, 24 Sep 2016 13:47:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757794AbcIXNru (ORCPT ); Sat, 24 Sep 2016 09:47:50 -0400 Received: from mout.web.de ([212.227.17.12]:56867 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751900AbcIXNrs (ORCPT ); Sat, 24 Sep 2016 09:47:48 -0400 Received: from [192.168.1.2] ([78.53.181.42]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0MSJKJ-1bPQeK0lZr-00TSmc; Sat, 24 Sep 2016 15:47:43 +0200 Subject: [PATCH 2/4] Input-gameport: Delete an error message for a failed memory allocation To: linux-input@vger.kernel.org, Dmitry Torokhov References: Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall , Wolfram Sang From: SF Markus Elfring Message-ID: <0b438906-0b64-7635-801d-8edfe5bcd8dd@users.sourceforge.net> Date: Sat, 24 Sep 2016 15:47:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:bjEqcn6WNUG37SOaAsZz5SkyPYGTmTRCh8qR4zcukrKisVqQ7yB 4R+M6E/zg4eRdUokLEKNqyocMlKOGdzFzopQ4zeItMu61RxRt2E8M4M+VU7TWr/AizjydfM p6OlugaUWQTrH15KbJbNgjPaQ2zWxGY+5Euho066Wv0GlvntINgcAzQ7t33K1r/F3Ickw4D IXxcDpoTJybKkanZ1CPdw== X-UI-Out-Filterresults: notjunk:1; V01:K0:/1xWCVWOy9s=:SGGPcKlkxtVIHCiEUCPupM 3RWjq+wGGZs/Z6sydosiprcPVaFAZW7ieGtF+RwI9l9uxvuUY4HwRz39bXig32I7FR6E/F+Dw JDwwHCWpBucrtQ2w6vpYUZ0vTDATZ0XFAc5CQc7z0vkMyj/OyJFfds9G09HGeFIXiwwfF+Afn ci09dQhfp6B3ILqSO0KKpaWKJZj/ziDPGe+QaFND1eMSo/FCPOybKiPX6Bajfg14mOy1JF/+j Q3xn2VtnshPSCZdDoZ2/fWWZ0/HTO0LWZUGkea5kR2rlkzE3xsrzK/JPKbre3gJqsD0uEZAvu LQ2Pu0mam6cgardlnLK6sW5hUz128gIhdZRBGwhIKJweOn9pMtupOZqNrHZ6vn7BnVIgBmNTV rzOc0yzhrGPYuko7ZyiFjDBn5vKEzYGwT7n62T/1Za3h1kZ2iChoeEPXi/OalHe+EF3NOeEzv 43bipECpsAXfhPu2H9jDxnUAlktchZWn8Y/jKsfEqSJfiKOjI75qNv4KEzvk/RLHCL4zAJ/aM w9vr2Mq8xS5j73gzsfn4B7oSnq+0HjW4L6Z1dDERJq2jMcB/2FlfGsbMEM9QTNK05PHxtWzu1 iOX4XdoSuLJje3Yhb15O/Kse4IBlhvm1priUFn/99dGENs1imxn+t3L2WoYoMhTsICPDReQPj hQWpVFo7bSBbrTY4L7a/02j8OMkd26zUT8GSouqr4P6o6s9l47hMgxV3MUD4RMtirlZHa/G9Q tOpe/IrubVlFp50t7cIKfQ5wimbO3L1y+wnzBrtIKKpam2zpnB56WdiDsUqcqc+VAyTcpVsX+ +1pkX2L Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 24 Sep 2016 14:18:48 +0200 Omit an extra message 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/input/joystick/joydump.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/input/joystick/joydump.c b/drivers/input/joystick/joydump.c index e515058..f9f6cbe 100644 --- a/drivers/input/joystick/joydump.c +++ b/drivers/input/joystick/joydump.c @@ -80,10 +80,9 @@ static int joydump_connect(struct gameport *gameport, struct gameport_driver *dr timeout = gameport_time(gameport, 10000); /* 10 ms */ buf = kmalloc_array(BUF_SIZE, sizeof(*buf), GFP_KERNEL); - if (!buf) { - printk(KERN_INFO "joydump: no memory for testing\n"); + if (!buf) goto jd_end; - } + dump = buf; t = 0; i = 1;