mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: len.brown@intel.com, Arjan van de Ven <arjan@linux.intel.com>
Cc: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>,
	Robert Lee <rob.lee@linaro.org>,
	hpa@linux.intel.com, daniel.lezcano@linaro.org,
	amit.kucheria@linaro.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, patches@linaro.org
Subject: Re: [PATCH] pm: remove useless array definition in cpuidle_structure
Date: Fri, 4 Nov 2011 23:28:43 +0100	[thread overview]
Message-ID: <201111042328.43358.rjw@sisk.pl> (raw)
In-Reply-To: <4EB3D8BE.7050600@linux.vnet.ibm.com>

Len, Arjan,

On Friday, November 04, 2011, Deepthi Dharwar wrote:
> On Friday 04 November 2011 03:14 AM, Robert Lee wrote:
> > From: Daniel Lezcano <daniel.lezcano@linaro.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@linaro.org>
> > Signed-off-by: Robert Lee <rob.lee@linaro.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@linux.vnet.ibm.com>
> Reviewed-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>

This is simple enough for me to push it for 3.2, but I woulnd't like to
step on anyone's toes.  Please let me know what you think.

Rafael

  reply	other threads:[~2011-11-04 22:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-03 21:44 Robert Lee
2011-11-04 12:21 ` Deepthi Dharwar
2011-11-04 22:28   ` Rafael J. Wysocki [this message]
2011-11-07 18:59     ` Daniel Lezcano

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=201111042328.43358.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=amit.kucheria@linaro.org \
    --cc=arjan@linux.intel.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=deepthi@linux.vnet.ibm.com \
    --cc=hpa@linux.intel.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=rob.lee@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome