From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753246AbcIAWKS (ORCPT ); Thu, 1 Sep 2016 18:10:18 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:36829 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750771AbcIAWKQ (ORCPT ); Thu, 1 Sep 2016 18:10:16 -0400 Message-ID: <57C86C29.1070807@gmail.com> Date: Thu, 01 Sep 2016 23:28:01 +0530 From: Sudip Mukherjee User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Jiri Kosina CC: Benjamin Tissoires , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-input@vger.kernel.org Subject: Re: [PATCH] HID: usbkbd: return proper error code References: <1472660901-1912-1-git-send-email-sudipm.mukherjee@gmail.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 01 September 2016 04:51 PM, Jiri Kosina wrote: > On Wed, 31 Aug 2016, Sudip Mukherjee wrote: > >> Use proper error code instead of using -1 on failure to allocate >> memory. We may use the error code later in the caller. > > But we don't. usb_kbd_probe() returns -ENOMEM in case usb_kbd_alloc_mem() > fails anyway, so I fail to see the point of the change really. > Well, yes, we don't as of now. When I was reading the code for something related to my day job I was a bit confused with -1 instead of a proper error code. I am sure there will be many others like me. Its fine if you think the change is not needed. regards sudip