All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Américo Wang" <xiyou.wangcong@gmail.com>
To: Jean Delvare <khali@linux-fr.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Greg KH <greg@kroah.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: resource_size doesn't change the resource
Date: Wed, 11 Nov 2009 22:20:54 +0800	[thread overview]
Message-ID: <20091111142054.GA2448@hack> (raw)
In-Reply-To: <20091111150424.37d56849@hyperion.delvare>

On Wed, Nov 11, 2009 at 03:04:24PM +0100, Jean Delvare wrote:
>The resource_size function doesn't change the resource it operates on,
>so the res parameter can be marked const. Same for the resource_type
>function.
>
>Signed-off-by: Jean Delvare <khali@linux-fr.org>

Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>


>---
> include/linux/ioport.h |    4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>--- linux-2.6.32-rc6.orig/include/linux/ioport.h	2009-09-28 10:29:17.000000000 +0200
>+++ linux-2.6.32-rc6/include/linux/ioport.h	2009-11-11 13:22:27.000000000 +0100
>@@ -126,11 +126,11 @@ extern int allocate_resource(struct reso
> 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;
> }
>
>
>-- 
>Jean Delvare
>--
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/

-- 
Live like a child, think like the god.
 

      reply	other threads:[~2009-11-11 14:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-11 14:04 resource_size doesn't change the resource Jean Delvare
2009-11-11 14:20 ` Américo Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091111142054.GA2448@hack \
    --to=xiyou.wangcong@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=greg@kroah.com \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.