Re: [PATCH 1/2] staging/nokia_h4p: replace short sleep using msleep with usleep_range

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

 



>From this page (https://www.kernel.org/doc/Documentation/timers/timers-howto.txt):
"msleep(1~20) may not do what the caller intends, and will often sleep
longer (~20 ms actual sleep for any value given in the 1~20ms range).
In many cases this is not the desired behavior."

The call to msleep in this code may cause a much longer sleep.

On Thu, Aug 14, 2014 at 12:36 PM, Pavel Machek <pavel@xxxxxx> wrote:
>
>>
>> Signed-off-by: Son Le <sonle.hut@xxxxxxxxx>
>> ---
>>  drivers/staging/nokia_h4p/nokia_core.c   |    2 +-
>>  drivers/staging/nokia_h4p/nokia_fw-csr.c |    2 +-
>>  drivers/staging/nokia_h4p/nokia_uart.c   |    2 +-
>>  3 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/staging/nokia_h4p/nokia_core.c b/drivers/staging/nokia_h4p/nokia_core.c
>> index 775e1d0..bab01e9 100644
>> --- a/drivers/staging/nokia_h4p/nokia_core.c
>> +++ b/drivers/staging/nokia_h4p/nokia_core.c
>> @@ -724,7 +724,7 @@ static int hci_h4p_reset(struct hci_h4p_info *info)
>>
>>       gpio_set_value(info->reset_gpio, 0);
>>       gpio_set_value(info->bt_wakeup_gpio, 1);
>> -     msleep(10);
>> +     usleep_range(10000, 10500);
>>
>
> I don't see how new code is superior to the old one. If checkpatch
> warns about this, perhaps checkpatch should be fixed?
>
>                                                                         Pavel
> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux