From: Joe Perches <joe@perches.com>
To: Greg KH <greg@kroah.com>
Cc: Matthew Garrett <mjg@redhat.com>,
Randy Dunlap <rdunlap@xenotime.net>,
linux-kernel@vger.kernel.org,
platform-driver-x86@vger.kernel.org
Subject: [PATCH] platform: Constify samsung-laptop.c
Date: Fri, 25 Feb 2011 15:57:36 -0800 [thread overview]
Message-ID: <1298678256.4002.6.camel@Joe-Laptop> (raw)
In-Reply-To: <20110225224705.GA5706@kroah.com>
Change sabi_config to const.
Reduces data, increases text ~200 bytes.
$ size drivers/platform/x86/samsung-laptop.o*
text data bss dec hex filename
6933 5084 1560 13577 3509 drivers/platform/x86/samsung-laptop.o.new
6765 5252 1560 13577 3509 drivers/platform/x86/samsung-laptop.o.old
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/platform/x86/samsung-laptop.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c
index a8e82b8..720c9eb 100644
--- a/drivers/platform/x86/samsung-laptop.c
+++ b/drivers/platform/x86/samsung-laptop.c
@@ -108,12 +108,12 @@ struct sabi_performance_level {
struct sabi_config {
const char *test_string;
u16 main_function;
- struct sabi_header_offsets header_offsets;
- struct sabi_commands commands;
- struct sabi_performance_level performance_levels[4];
+ const struct sabi_header_offsets header_offsets;
+ const struct sabi_commands commands;
+ const struct sabi_performance_level performance_levels[4];
};
-static struct sabi_config sabi_configs[] = {
+static const struct sabi_config sabi_configs[] = {
{
.test_string = "SECLINUX",
@@ -211,7 +211,7 @@ static struct sabi_config sabi_configs[] = {
{ },
};
-static struct sabi_config *sabi_config;
+static const struct sabi_config *sabi_config;
static void __iomem *sabi;
static void __iomem *sabi_iface;
@@ -467,7 +467,7 @@ static ssize_t set_performance_level(struct device *dev,
if (count >= 1) {
int i;
for (i = 0; sabi_config->performance_levels[i].name; ++i) {
- struct sabi_performance_level *level =
+ const struct sabi_performance_level *level =
&sabi_config->performance_levels[i];
if (!strncasecmp(level->name, buf, strlen(level->name))) {
sabi_set_command(sabi_config->commands.set_performance_level,
--
1.7.4.2.g597a6.dirty
prev parent reply other threads:[~2011-02-25 23:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-25 22:47 [PATCH] Platform: add Samsung Laptop platform driver Greg KH
2011-02-25 23:57 ` Joe Perches [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=1298678256.4002.6.camel@Joe-Laptop \
--to=joe@perches.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg@redhat.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rdunlap@xenotime.net \
/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.