Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1464959 > unrolled thread
| Started by | Felipe Balbi <balbi@kernel.org> |
|---|---|
| First post | 2016-08-18 09:20 +0200 |
| Last post | 2016-08-23 13:40 +0200 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH v4 08/10] usb: gadget: remove useless parameter in alloc_ep_req() Felipe Balbi <balbi@kernel.org> - 2016-08-18 09:20 +0200
Re: [PATCH v4 08/10] usb: gadget: remove useless parameter in alloc_ep_req() Felipe Ferreri Tonello <eu@felipetonello.com> - 2016-08-23 12:20 +0200
Re: [PATCH v4 08/10] usb: gadget: remove useless parameter in alloc_ep_req() Felipe Balbi <balbi@kernel.org> - 2016-08-23 13:10 +0200
Re: [PATCH v4 08/10] usb: gadget: remove useless parameter in alloc_ep_req() Felipe Ferreri Tonello <eu@felipetonello.com> - 2016-08-23 13:40 +0200
| From | Felipe Balbi <balbi@kernel.org> |
|---|---|
| Date | 2016-08-18 09:20 +0200 |
| Subject | Re: [PATCH v4 08/10] usb: gadget: remove useless parameter in alloc_ep_req() |
| Message-ID | <s7pMm-4SU-19@gated-at.bofh.it> |
[Multipart message — attachments visible in raw view] — view raw
Hi,
"Felipe F. Tonello" <eu@felipetonello.com> 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 <eu@felipetonello.com>
> ---
> 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/function/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 */
>
> -static inline struct usb_request *hidg_alloc_ep_req(struct usb_ep *ep,
> - unsigned length)
> -{
> - return alloc_ep_req(ep, length, length);
> -}
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 :-)
--
balbi
[toc] | [next] | [standalone]
| From | Felipe Ferreri Tonello <eu@felipetonello.com> |
|---|---|
| Date | 2016-08-23 12:20 +0200 |
| Subject | Re: [PATCH v4 08/10] usb: gadget: remove useless parameter in alloc_ep_req() |
| Message-ID | <s9gYi-2wu-23@gated-at.bofh.it> |
| In reply to | #1464959 |
[Multipart message — attachments visible in raw view] — view raw
Hi Blabi,
On 18/08/16 08:12, Felipe Balbi wrote:
>
> Hi,
>
> "Felipe F. Tonello" <eu@felipetonello.com> 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 <eu@felipetonello.com>
>> ---
>> 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/function/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 */
>>
>> -static inline struct usb_request *hidg_alloc_ep_req(struct usb_ep *ep,
>> - unsigned length)
>> -{
>> - return alloc_ep_req(ep, length, length);
>> -}
>
> 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 :-)
>
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.
--
Felipe
[toc] | [prev] | [next] | [standalone]
| From | Felipe Balbi <balbi@kernel.org> |
|---|---|
| Date | 2016-08-23 13:10 +0200 |
| Message-ID | <s9hKF-3bF-19@gated-at.bofh.it> |
| In reply to | #1468466 |
[Multipart message — attachments visible in raw view] — view raw
Hi,
Felipe Ferreri Tonello <eu@felipetonello.com> writes:
>> "Felipe F. Tonello" <eu@felipetonello.com> 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 <eu@felipetonello.com>
>>> ---
>>> 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/function/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 */
>>>
>>> -static inline struct usb_request *hidg_alloc_ep_req(struct usb_ep *ep,
>>> - unsigned length)
>>> -{
>>> - return alloc_ep_req(ep, length, length);
>>> -}
>>
>> 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 :-)
>>
>
> 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 ;-)
--
balbi
[toc] | [prev] | [next] | [standalone]
| From | Felipe Ferreri Tonello <eu@felipetonello.com> |
|---|---|
| Date | 2016-08-23 13:40 +0200 |
| Subject | Re: [PATCH v4 08/10] usb: gadget: remove useless parameter in alloc_ep_req() |
| Message-ID | <s9idI-3p3-19@gated-at.bofh.it> |
| In reply to | #1468482 |
[Multipart message — attachments visible in raw view] — view raw
Hi Balbi,
On 23/08/16 12:01, Felipe Balbi wrote:
>
> Hi,
>
> Felipe Ferreri Tonello <eu@felipetonello.com> writes:
>>> "Felipe F. Tonello" <eu@felipetonello.com> 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 <eu@felipetonello.com>
>>>> ---
>>>> 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/function/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 */
>>>>
>>>> -static inline struct usb_request *hidg_alloc_ep_req(struct usb_ep *ep,
>>>> - unsigned length)
>>>> -{
>>>> - return alloc_ep_req(ep, length, length);
>>>> -}
>>>
>>> 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 :-)
>>>
>>
>> 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 ;-)
Yes, sure. But why drop alloc_ep_req()?
So should I keep all these helper functions? If so, I actually still
need to fix them to use the newer alloc_ep_req() API.
--
Felipe
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web