aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ioport.h
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2009-12-15 19:48:21 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-16 10:20:17 -0500
commitf65380c07b64b0e45ad5c7d70ca54a9cde1c00db (patch)
treef0ea736f2c3b21af00dbc085ea53d47847f9632f /include/linux/ioport.h
parent76148df19cbd5437dc5358408a58c7cc6366ecf4 (diff)
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 <khali@linux-fr.org> Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/ioport.h')
-rw-r--r--include/linux/ioport.h4
1 files changed, 2 insertions, 2 deletions
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,
126int adjust_resource(struct resource *res, resource_size_t start, 126int adjust_resource(struct resource *res, resource_size_t start,
127 resource_size_t size); 127 resource_size_t size);
128resource_size_t resource_alignment(struct resource *res); 128resource_size_t resource_alignment(struct resource *res);
129static inline resource_size_t resource_size(struct resource *res) 129static inline resource_size_t resource_size(const struct resource *res)
130{ 130{
131 return res->end - res->start + 1; 131 return res->end - res->start + 1;
132} 132}
133static inline unsigned long resource_type(struct resource *res) 133static inline unsigned long resource_type(const struct resource *res)
134{ 134{
135 return res->flags & IORESOURCE_TYPE_BITS; 135 return res->flags & IORESOURCE_TYPE_BITS;
136} 136}