From: Jean Delvare Date: Wed, 16 Dec 2009 00:48:21 +0000 (-0800) Subject: resource: constify arg to resource_size() and resource_type() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f65380c07b64b0e45ad5c7d70ca54a9cde1c00db;p=openwrt%2Fstaging%2Fblogic.git 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: Jean Delvare Reviewed-by: WANG Cong Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 83aa81297ea3..7129504e053d 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -126,11 +126,11 @@ extern int allocate_resource(struct resource *root, struct resource *new, int adjust_resource(struct resource *res, resource_size_t start, resource_size_t size); 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; } -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; }