提交 f65380c0 编写于 作者: J Jean Delvare 提交者: Linus Torvalds

resource: constify arg to resource_size() and resource_type()

resource_size() doesn't change the resource it operates on, so the res
parameter can be marked const.  Same for resource_type().
Signed-off-by: NJean Delvare <khali@linux-fr.org>
Reviewed-by: NWANG Cong <xiyou.wangcong@gmail.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 76148df1
...@@ -126,11 +126,11 @@ extern int allocate_resource(struct resource *root, struct resource *new, ...@@ -126,11 +126,11 @@ extern int allocate_resource(struct resource *root, struct resource *new,
int adjust_resource(struct resource *res, resource_size_t start, int adjust_resource(struct resource *res, resource_size_t start,
resource_size_t size); resource_size_t size);
resource_size_t resource_alignment(struct resource *res); resource_size_t resource_alignment(struct resource *res);
static inline resource_size_t resource_size(struct resource *res) static inline resource_size_t resource_size(const struct resource *res)
{ {
return res->end - res->start + 1; return res->end - res->start + 1;
} }
static inline unsigned long resource_type(struct resource *res) static inline unsigned long resource_type(const struct resource *res)
{ {
return res->flags & IORESOURCE_TYPE_BITS; return res->flags & IORESOURCE_TYPE_BITS;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册