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: <4EB3D8BE.7050600@linux.vnet.ibm.com>
Date:	Fri, 04 Nov 2011 17:51:18 +0530
From:	Deepthi Dharwar <deepthi@...ux.vnet.ibm.com>
To:	Robert Lee <rob.lee@...aro.org>
CC:	rjw@...k.pl, len.brown@...el.com, hpa@...ux.intel.com,
	daniel.lezcano@...aro.org, amit.kucheria@...aro.org,
	linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
	patches@...aro.org
Subject: Re: [PATCH] pm: remove useless array definition in cpuidle_structure

On Friday 04 November 2011 03:14 AM, Robert Lee wrote:
> From: Daniel Lezcano <daniel.lezcano@...aro.org>
> 
> All the modules name are ro-data, it is never copied to the array.
> 
> eg.
> 
> static struct cpuidle_driver intel_idle_driver = {
>         .name = "intel_idle",
>         .owner = THIS_MODULE,
> };
> 
> It safe to assign the pointer of this ro-data to a const char *.
> By this way we save 12 bytes.
> 
> Signed-off-by: Daniel Lezcano <daniel.lezcano@...aro.org>
> Signed-off-by: Robert Lee <rob.lee@...aro.org>
> ---
>  include/linux/cpuidle.h |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
> index b51629e..16f9dce 100644
> --- a/include/linux/cpuidle.h
> +++ b/include/linux/cpuidle.h
> @@ -117,8 +117,8 @@ static inline int cpuidle_get_last_residency(struct cpuidle_device *dev)
>   ****************************/
> 
>  struct cpuidle_driver {
> -	char			name[CPUIDLE_NAME_LEN];
> -	struct module 		*owner;
> +	const char    *name;
> +	struct module *owner;
>  };
> 
>  #ifdef CONFIG_CPU_IDLE

This looks good, and makes it fool-proof by  not allowing one to tamper the name of the driver.
Tested OK on x86 (both Intel idle and ACPI)

Tested-by: Deepthi Dharwar <deepthi@...ux.vnet.ibm.com>
Reviewed-by: Deepthi Dharwar <deepthi@...ux.vnet.ibm.com>

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