From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932773AbcDNPvI (ORCPT ); Thu, 14 Apr 2016 11:51:08 -0400 Received: from mail-pf0-f181.google.com ([209.85.192.181]:35833 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932710AbcDNPvE (ORCPT ); Thu, 14 Apr 2016 11:51:04 -0400 Message-ID: <570FBC50.1000603@gmail.com> Date: Thu, 14 Apr 2016 21:20:40 +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: Felipe Balbi , Yoshihiro Shimoda , Greg Kroah-Hartman CC: "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" Subject: Re: [PATCH] usb: renesas_usbhs: fix signed-unsigned return References: <1460127918-27400-1-git-send-email-sudipm.mukherjee@gmail.com> <87potsjw74.fsf@intel.com> In-Reply-To: <87potsjw74.fsf@intel.com> 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 14 April 2016 04:25 PM, Felipe Balbi wrote: > > Hi, > > Yoshihiro Shimoda writes: >>> From: Sudip Mukherjee >>> Sent: Saturday, April 09, 2016 12:05 AM >>> >>> The return type of usbhsp_setup_pipecfg() was u16 but it was returning >>> a negative value (-EINVAL). Instead lets return a pointer to u16 which >>> will hold the value to be returned or in case of error, return the >>> error code in ERR_PTR. >> >> Thank you for the patch! >> I also think this usbhsp_setup_pipecfg() should return error code using correct variable type. >> >> However, I would like to avoid to use ERR_PTR and kmalloc() somehow because >> I feel this patch is complex a little. >> How about the usbhsp_setup_pipecfg() prototype is changed like the following? >> >> static int usbhsp_setup_pipecfg(struct usbhs_pipe *pipe, >> int is_host, int dir_in, u16 *pipecfg); > > IMO, this makes much more sense. Infact, I thought about both these ways while making the patch but somehow I thought this one is a better but ofcourse the other way is much simpler. I will post v2. regards sudip