lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1394648554.3915.22.camel@joe-AO722>
Date:	Wed, 12 Mar 2014 11:22:34 -0700
From:	Joe Perches <joe@...ches.com>
To:	Marcel Holtmann <marcel@...tmann.org>
Cc:	Network Development <netdev@...r.kernel.org>,
	"Gustavo F. Padovan" <gustavo@...ovan.org>,
	Johan Hedberg <johan.hedberg@...il.com>,
	"David S. Miller" <davem@...emloft.net>,
	"bluez mailin list (linux-bluetooth@...r.kernel.org)" 
	<linux-bluetooth@...r.kernel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2 bluetooth-next 2/6] bluetooth: Convert uses of
 __constant_<foo> to <foo>

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

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ