lkml.org 
[lkml]   [2011]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 0/2] Fix resource size miscalculations
    From
    Date
    On Wed, 2011-03-23 at 12:55 -0700, Joe Perches wrote:
    > Use resource_size a few places

    Perhaps this relatively common error is too common.
    It seems to be poor style. A possible better style for
    struct resource uses could be inline function(s) like:

    static inline void __iomem *resource_ioremap(struct resource *r)
    {
    return ioremap(r->start, resource_size(r));
    }

    and maybe

    static inline struct resource *
    resource_request_region(struct resource *r, const char *name)
    {
    return __request_region(&ioport_resource, r->start, resource_size(r), name, 0);
    }




    \
     
     \ /
      Last update: 2011-03-24 23:51    [W:4.098 / U:0.304 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site