lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 11 Nov 2009 22:20:54 +0800
From:	Américo Wang <xiyou.wangcong@...il.com>
To:	Jean Delvare <khali@...ux-fr.org>
Cc:	LKML <linux-kernel@...r.kernel.org>, Greg KH <greg@...ah.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: resource_size doesn't change the resource

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@...ux-fr.org>

Reviewed-by: WANG Cong <xiyou.wangcong@...il.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@...r.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.
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists