Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1379054

Re: [PATCH] usb: renesas_usbhs: fix signed-unsigned return

From Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] usb: renesas_usbhs: fix signed-unsigned return
Date 2016-04-14 18:00 +0200
Message-ID <rnRQu-4b1-11@gated-at.bofh.it> (permalink)
References <rlGcP-5Mb-25@gated-at.bofh.it> <rnNaa-mN-7@gated-at.bofh.it> <rnNaa-mN-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thursday 14 April 2016 04:25 PM, Felipe Balbi wrote:
>
> Hi,
>
> Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> 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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] usb: renesas_usbhs: fix signed-unsigned return Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-04-08 17:10 +0200
  RE: [PATCH] usb: renesas_usbhs: fix signed-unsigned return Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> - 2016-04-14 13:00 +0200
    RE: [PATCH] usb: renesas_usbhs: fix signed-unsigned return Felipe Balbi <balbi@kernel.org> - 2016-04-14 13:00 +0200
      Re: [PATCH] usb: renesas_usbhs: fix signed-unsigned return Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-04-14 18:00 +0200

csiph-web