From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757696AbcHWLDm (ORCPT ); Tue, 23 Aug 2016 07:03:42 -0400 Received: from mga14.intel.com ([192.55.52.115]:1079 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756161AbcHWLDl (ORCPT ); Tue, 23 Aug 2016 07:03:41 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,565,1464678000"; d="asc'?scan'208";a="159757238" From: Felipe Balbi To: Felipe Ferreri Tonello , linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Michal Nazarewicz Subject: Re: [PATCH v4 08/10] usb: gadget: remove useless parameter in alloc_ep_req() In-Reply-To: <55c2d393-0157-384c-0b93-dec8eaaf1c6d@felipetonello.com> References: <20160808203013.19283-1-eu@felipetonello.com> <20160808203013.19283-9-eu@felipetonello.com> <87oa4q5z4q.fsf@linux.intel.com> <55c2d393-0157-384c-0b93-dec8eaaf1c6d@felipetonello.com> User-Agent: Notmuch/0.22.1+63~g994277e (https://notmuchmail.org) Emacs/25.1.1 (x86_64-pc-linux-gnu) Date: Tue, 23 Aug 2016 14:01:01 +0300 Message-ID: <871t1fiwb6.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Felipe Ferreri Tonello writes: >> "Felipe F. Tonello" writes: >>> The default_length parameter of alloc_ep_req was not really necessary >>> and gadget drivers would almost always create an inline function to pass >>> the same value to len and default_len. >>> >>> So this patch also removes duplicate code from few drivers. >>> >>> Signed-off-by: Felipe F. Tonello >>> --- >>> drivers/usb/gadget/function/f_hid.c | 10 ++-------- >>> drivers/usb/gadget/function/f_loopback.c | 9 +-------- >>> drivers/usb/gadget/function/f_midi.c | 10 ++-------- >>> drivers/usb/gadget/function/f_sourcesink.c | 11 ++--------- >>> drivers/usb/gadget/u_f.c | 7 +++---- >>> drivers/usb/gadget/u_f.h | 3 +-- >>> 6 files changed, 11 insertions(+), 39 deletions(-) >>> >>> diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/f= unction/f_hid.c >>> index 51980c50546d..e82a7468252e 100644 >>> --- a/drivers/usb/gadget/function/f_hid.c >>> +++ b/drivers/usb/gadget/function/f_hid.c >>> @@ -362,12 +362,6 @@ static int f_hidg_open(struct inode *inode, struct= file *fd) >>> /*--------------------------------------------------------------------= -----*/ >>> /* usb_function = */ >>>=20=20 >>> -static inline struct usb_request *hidg_alloc_ep_req(struct usb_ep *ep, >>> - unsigned length) >>> -{ >>> - return alloc_ep_req(ep, length, length); >>> -} >>=20 >> actually, I prefer to keep these little helpers. I was recently playing >> with adding SG list support to g_zero (I should have patches soon) and >> it was actually very nice to have the sourcesink helper as I could just >> ditch alloc_ep_req(). The change to the driver was local to >> ss_alloc_ep_req() and nothing else changed :-) >>=20 > > Right, but then it is worth to have the helper function. In this > particular case, I am removing a useless helper functions, especially > that the previous patch removes the need for the optional parameter in > alloc_ep_req. it's a static inline :-) It won't do any bad to keep it. And, as I said, if we want to ditch aloc_ep_req() eventually, then we have just one place to patch ;-) =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJXvCztAAoJEIaOsuA1yqREyF0P/A1zYP/cpfJzZ8XKprrcybkf zbwvBKK9YtOtFoZHuI4WCi0EPjOAvE4eAM3djaPV1tMcKZDBhiVYG9JwOiDc8peu skL+qUDTLG/s7xiu18uxvk/YkVl+aeSQC6zQ0m1Pw7+ad77eF8Vkg7mKAgRcsGMz RcZetrTTLTd+QDtP0Vh/h5pWOCqNSjW7GwPYkPmg2XhLbFYAXlOWyjk9KDWyY/iY HO2FP7bbNvk9jsY+iDXVyLy+sIjJlEcKQyPirrkiXi1O8CmDt9IgkIjN0tu0AJRV PNhbO9VgduEnQUmSs03bxsiitptJDXLSaToWYn0aZKQ/f3cnaQ+LQpiK2zD3NY+G m5L6FWLoLIGyhsJZmpmZU1jioUbcP9F4dUeGSlxRCKOLp1M/JsxsjM9zKDwOfQEP ilhv7LzhuUAB+HZaqAnkxsyRP8UjjRv9A2MX8dWOLKnKjAUhIWRPNJR/hs6ao/qm k0FLO6uWB+0rib01pPU2icJFcMfpW5YQPuMpa4fk/CSagwc/1/ahnUwXdYWu6IrV fT8Ee4tDUNAyQnNXE8tG9O7/L+/WKy7W13Au6ITCfYZT+UOj9jjeD2o+u5vgnU+s 2S8ar1lMk5B52jbM6cPG4aoXJSDoohclY/R20M1YLs0nQGWsoYvi9i2Vr0pgyQ4b AsN0TcA8J6K1RAdasR9K =VWoF -----END PGP SIGNATURE----- --=-=-=--