public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@kernel.org>
To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-usb\@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: RE: [PATCH] usb: renesas_usbhs: fix signed-unsigned return
Date: Thu, 14 Apr 2016 13:55:59 +0300	[thread overview]
Message-ID: <87potsjw74.fsf@intel.com> (raw)
In-Reply-To: <SG2PR06MB0919683D1A847AD697F6E725D8970@SG2PR06MB0919.apcprd06.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 888 bytes --]


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.

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

  reply	other threads:[~2016-04-14 10:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-08 15:05 [PATCH] usb: renesas_usbhs: fix signed-unsigned return Sudip Mukherjee
2016-04-14 10:52 ` Yoshihiro Shimoda
2016-04-14 10:55   ` Felipe Balbi [this message]
2016-04-14 15:50     ` Sudip Mukherjee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87potsjw74.fsf@intel.com \
    --to=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sudipm.mukherjee@gmail.com \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox