Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754584AbcDNK6A (ORCPT ); Thu, 14 Apr 2016 06:58:00 -0400 Received: from mga01.intel.com ([192.55.52.88]:13408 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752357AbcDNK57 (ORCPT ); Thu, 14 Apr 2016 06:57:59 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,484,1455004800"; d="asc'?scan'208";a="784746720" From: Felipe Balbi To: Yoshihiro Shimoda , Sudip Mukherjee , Greg Kroah-Hartman Cc: "linux-kernel\@vger.kernel.org" , "linux-usb\@vger.kernel.org" Subject: RE: [PATCH] usb: renesas_usbhs: fix signed-unsigned return In-Reply-To: References: <1460127918-27400-1-git-send-email-sudipm.mukherjee@gmail.com> User-Agent: Notmuch/0.21+96~g9bbc54b (http://notmuchmail.org) Emacs/25.0.90.3 (x86_64-pc-linux-gnu) Date: Thu, 14 Apr 2016 13:55:59 +0300 Message-ID: <87potsjw74.fsf@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1853 Lines: 55 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Yoshihiro Shimoda writes: >> From: Sudip Mukherjee >> Sent: Saturday, April 09, 2016 12:05 AM >>=20 >> 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 c= orrect variable type. > > However, I would like to avoid to use ERR_PTR and kmalloc() somehow becau= se > I feel this patch is complex a little. > How about the usbhsp_setup_pipecfg() prototype is changed like the follow= ing? > > static int usbhsp_setup_pipecfg(struct usbhs_pipe *pipe, > int is_host, int dir_in, u16 *pipecfg); IMO, this makes much more sense. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXD3dAAAoJEIaOsuA1yqRER40P/2uvJ0LslSRCWfVwG60sZ/SS k+HaCRjI1GHhctvxU4yzjLUUJVzX2dPaLVjZZ1MZD3ndO5HncH7b9Rv+ZHPjEq5X 5StH7jBM7eVA1yHitEHOpvhckVTbvvBcBGveSWcJgwGljLAsbmHeZ4Qj51KigyiM HZ6cHGGGAxMMRUIk/AO5jThR9f91UcZb5KyHAIFU21IBOoN7i+FY3ySMNKeeagsW YJR2Ku6K/i9GPKJStG+7S45imguYxn3RtGyzKpE/T9zRy/R0LvR9mv/7QWe3Wh2u Gx/cvkhMo2IhPpmkckG8PwpBl6qbQ0d/Am7qxAIh2UGRdDK4OKJxxepLt1ZQKrnD raJ/vr7inb+zfKWLR9RLjxhQ1UkS2IxFR8h5lKw9M7YbE0vNJSqpgKo73E2zAQl7 Rj6Vmhh1EpEe+BbSu+vj7xilaZ2ydI/W1v0w/g1miJGKmctcFRc3+LB1vC7BbQx3 lpYq/M2CMz4Bd+o+4fRpuOPKNlX9Q63towEhoblYE2Rlc1szqqCACNZ766p3uFaE cRSzvU5jkdCjldPI4YgDMOXgVni7tl/97CltqhBEGGFO8C1qqdCwXFA/XFOwhzyJ j6qg7DHhvOeS6XUNtFOJU7jOvqr5gpbZfRVIJRlsWlsojOqeAPiAzIGX3IG/PZH7 6qSm+aBsyAOHyxYWQETJ =jzDk -----END PGP SIGNATURE----- --=-=-=--