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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20131122143047.51b4fbe7aa227b8e37908106@linux-foundation.org>
Date:	Fri, 22 Nov 2013 14:30:47 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Luiz Capitulino <lcapitulino@...hat.com>
Cc:	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	dave.hansen@...el.com
Subject: Re: [PATCH] mmzone.h: constify some zone access functions

On Fri, 22 Nov 2013 12:01:06 -0500 Luiz Capitulino <lcapitulino@...hat.com> wrote:

> Signed-off-by: Luiz capitulino <lcapitulino@...hat.com>
> ---
>  include/linux/mmzone.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index bd791e4..5e202d6 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -560,12 +560,12 @@ static inline bool zone_spans_pfn(const struct zone *zone, unsigned long pfn)
>  	return zone->zone_start_pfn <= pfn && pfn < zone_end_pfn(zone);
>  }
>  
> -static inline bool zone_is_initialized(struct zone *zone)
> +static inline bool zone_is_initialized(const struct zone *zone)
>  {
>  	return !!zone->wait_table;
>  }
>  
> -static inline bool zone_is_empty(struct zone *zone)
> +static inline bool zone_is_empty(const struct zone *zone)
>  {
>  	return zone->spanned_pages == 0;
>  }
> @@ -843,7 +843,7 @@ unsigned long __init node_memmap_size_bytes(int, unsigned long, unsigned long);
>   */
>  #define zone_idx(zone)		((zone) - (zone)->zone_pgdat->node_zones)
>  
> -static inline int populated_zone(struct zone *zone)
> +static inline int populated_zone(const struct zone *zone)
>  {
>  	return (!!zone->present_pages);
>  }

hm, why?  I counted ten similarly constifyable functions in mm.h and
stopped only 1/4 of the way through. What's so special about these three?

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ