lkml.org 
[lkml]   [2014]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V2 bluetooth-next 2/6] bluetooth: Convert uses of __constant_<foo> to <foo>
From
Date
On Wed, 2014-03-12 at 11:11 -0700, Marcel Holtmann wrote:

> > /* Connection accept timeout ~20 secs */
> > - param = __constant_cpu_to_le16(0x7d00);
> > + param = cpu_to_le16(0x7d00);
> >
> > 0x7d00 is 32000, presumably that's 32 seconds.
>
> so it is 0x7d00 * 0.625 which results in 20 seconds.

Hi again Marcel.

Swell. No worries then.

Is this clocking divisor defined somewhere?
Is .625 or 5/8 as a magic number defined somewhere?
(I didn't see it in a brief scan)
Maybe it'd be better to use 20000 * 5 / 8 or
add some define like

#define msecs_to_bt_clocks(ms) ((ms) * 5 / 8)

> > and
> > /* 160 msec page scan interval */
> > - acp.interval = __constant_cpu_to_le16(0x0100);
> > + acp.interval = cpu_to_le16(0x0100);
> > 256 msecs?
>
> also here 0x0100 * 0.625 resulting in 160 msecs.

Same as above.

> patch has been applied to bluetooth-next tree.

cheers, Joe



\
 
 \ /
  Last update: 2014-03-12 21:21    [W:0.065 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site