lkml.org 
[lkml]   [2009]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 61/7] x86/pci: add cap_4g
    H. Peter Anvin wrote:
    > On 12/11/2009 06:11 PM, Yinghai Lu wrote:
    >>
    >> +static inline u64 cap_4g(u64 val)
    >> +{
    >> + if (sizeof(resource_size_t) >= sizeof(u64))
    >> + return val;
    >> +
    >> + if (val < 1ULL)
    >> + return val;
    >> +
    >> + return 0xffffffff;
    >> +}
    >> #endif
    >
    > How about:
    >
    > static inline resource_size_t cap_resource(u64 val)
    > {
    > if (val > ~(resource_size_t)0)
    > return ~(resource_size_t)0;
    > else
    > return val;
    > }

    ok


    \
     
     \ /
      Last update: 2009-12-12 03:23    [W:0.021 / U:90.080 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site