lkml.org 
[lkml]   [2014]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v2] USB: ehci-pci: USB host controller support for Intel Quark X1000
Date


> -----Original Message-----
> From: David Laight [mailto:David.Laight@ACULAB.COM]
> Sent: Friday, June 27, 2014 4:08 PM
> ...
> > /* The maximal threshold value is 0x80, which means 512 bytes */
> > #define EHCI_THRESHOLD_512BYTES 0x80
> > #define EHCI_THRESHOLD_508BYTES 0x79
>
> It would be better to define these using expressions. So:
> #define EHCI_THRESHOLD_512BYTES (512u / 8u)
> #define EHCI_THRESHOLD_508BYTES (508u / 8u)
>
Just to clarify, the threshold value set to register is in dword, so '0x80' means 0x80 dwords (512 bytes), and 508 bytes is not 0x79, it is 0x7F.

> Then you might decide to use:
> #define EHCI_THRESHOLD(size) ((size) / 8u)
>
> Then realise that the names are not generic EHCI, so need some driver-specific
> prefix (for namespace reasons).
>
How about the following?
#define INTEL_QUARK_X1000_EHCI_THRESHOLD(size) ((size) / 4u) /* threshold value is in dword*/

> And that the defines are probably limit values, and should be named as such.
>
> David
>
>



\
 
 \ /
  Last update: 2014-06-27 11:01    [W:0.071 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site