Search Linux Wireless

Re: [v2 05/11] rsi: Remove unnecessary buffer allocation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 12, 2017 at 1:58 PM, Arend van Spriel
<arend.vanspriel@xxxxxxxxxxxx> wrote:
> On 5/11/2017 8:28 PM, Kalle Valo wrote:
>>
>> Amitkumar Karwar <amitkarwar@xxxxxxxxx> writes:
>>
>>> From: Prameela Rani Garnepudi <prameela.j04cs@xxxxxxxxx>
>>>
>>> In functions usb read register and usb write register, dynamic allocation
>>> of 4 bytes is used. This is removed as it is unncessary for local
>>> variable
>>> and for such small data.
>>>
>>> Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@xxxxxxxxx>
>>> Signed-off-by: Amitkumar Karwar <amit.karwar@xxxxxxxxxxxxxxxxxx>
>>> ---
>>>   drivers/net/wireless/rsi/rsi_91x_usb.c | 18 ++++--------------
>>>   1 file changed, 4 insertions(+), 14 deletions(-)
>>>
>>> diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c
>>> b/drivers/net/wireless/rsi/rsi_91x_usb.c
>>> index 73b01a8..8eb7407 100644
>>> --- a/drivers/net/wireless/rsi/rsi_91x_usb.c
>>> +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c
>>> @@ -157,12 +157,8 @@ static int rsi_usb_reg_read(struct usb_device
>>> *usbdev,
>>>                             u16 *value,
>>>                             u16 len)
>>>   {
>>> -       u8 *buf;
>>> -       int status = -ENOMEM;
>>> -
>>> -       buf  = kmalloc(0x04, GFP_KERNEL);
>>> -       if (!buf)
>>> -               return status;
>>> +       u8 buf[4];
>>> +       int status;
>>>         status = usb_control_msg(usbdev,
>>>                                  usb_rcvctrlpipe(usbdev, 0),
>>
>>
>> Recently I got a patch to orinoco_usb which did exactly the opposite
>> (unless I'm missing something):
>>
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?id=2f6ae79cb04bb7f9b4be3f1c32b6fda35bf976bc
>>
>> The documentation for usb_control_msg() does not mention anything if
>> it's possible to use stack memory, but AFAIU it's not possible to use
>> stack memory with DMA. Can anyone clarify?
>
>
> After private message I sent to Kalle here my public response :-p
> According to Greg this has been a USB core requirement for a long, long time
> (see below).
>

Thanks Arend.
I have dropped this patch in V3 series.

Regards,
Amitkumar Karwar



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux