lkml.org 
[lkml]   [2017]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] usbip: fix off-by-one frame number calculation
From
Date
On 11/07/2017 04:21 AM, Krzysztof Opasiak wrote:
>
>
> On 11/07/2017 11:39 AM, Arnd Bergmann wrote:
>> vgadget_get_frame returns a frame number from 0 to 2046, which
>> may require an expensive division operation to wrap at one lower
>> than the usual number.
>>
>> I can't see any reason for this, and all other drivers wrap at
>> a power-of-two number. My best explanation is that it was a simple
>> typo, so I'm changing the % modulo operator into a cheaper bitmask
>> that the other drivers use, to make it wrap after 0x7ff rather than
>> before it.
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Looks good to me:
> Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
>

Acked-by: Shuah Khan <shuahkh@osg.samsung.com>

thanks,
-- Shuah

\
 
 \ /
  Last update: 2017-11-08 21:07    [W:0.037 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site