The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: linux-kernel@vger.kernel.org
Cc: Ben Hutchings <ben@decadent.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 3/3] firmware/dmi_scan: Constify strings
Date: Tue, 09 Jul 2013 17:43:54 +0200	[thread overview]
Message-ID: <1373384634.4391.10.camel@chaos.site> (raw)
In-Reply-To: <1373384438.4391.6.camel@chaos.site>

Add const to all DMI string pointers where this is possible. This
fixes a checkpatch warning.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 drivers/firmware/dmi_scan.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- linux-3.10-rc0.orig/drivers/firmware/dmi_scan.c	2013-05-04 11:20:48.321082162 +0200
+++ linux-3.10-rc0/drivers/firmware/dmi_scan.c	2013-05-04 11:20:52.808187924 +0200
@@ -14,7 +14,7 @@
  * of and an antecedent to, SMBIOS, which stands for System
  * Management BIOS.  See further: http://www.dmtf.org/standards
  */
-static char dmi_empty_string[] = "        ";
+static const char dmi_empty_string[] = "        ";
 
 static u16 __initdata dmi_ver;
 /*
@@ -49,7 +49,7 @@ static const char * __init dmi_string_no
 	return "";
 }
 
-static char * __init dmi_string(const struct dmi_header *dm, u8 s)
+static const char * __init dmi_string(const struct dmi_header *dm, u8 s)
 {
 	const char *bp = dmi_string_nosave(dm, s);
 	char *str;
@@ -133,7 +133,7 @@ static int __init dmi_checksum(const u8
 	return sum == 0;
 }
 
-static char *dmi_ident[DMI_STRING_MAX];
+static const char *dmi_ident[DMI_STRING_MAX];
 static LIST_HEAD(dmi_devices);
 int dmi_available;
 
@@ -144,7 +144,7 @@ static void __init dmi_save_ident(const
 		int string)
 {
 	const char *d = (const char *) dm;
-	char *p;
+	const char *p;
 
 	if (dmi_ident[slot])
 		return;
@@ -252,7 +252,7 @@ static void __init dmi_save_oem_strings_
 	struct dmi_device *dev;
 
 	for (i = 1; i <= count; i++) {
-		char *devname = dmi_string(dm, i);
+		const char *devname = dmi_string(dm, i);
 
 		if (devname == dmi_empty_string)
 			continue;


-- 
Jean Delvare
Suse L3


  parent reply	other threads:[~2013-07-09 15:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09 15:40 [PATCH 0/3] firmware/dmi_scan: Cleanups Jean Delvare
2013-07-09 15:41 ` [PATCH 1/3] firmware/dmi_scan: Drop obsolete comment Jean Delvare
2013-07-09 15:42 ` [PATCH 2/3] firmware/dmi_scan: Fix most checkpatch errors and warnings Jean Delvare
2013-07-09 16:19   ` Joe Perches
2013-07-09 17:13     ` ia64: dmi.h: Make dmi_alloc use kzalloc Joe Perches
2013-07-09 20:43       ` Tony Luck
2013-07-10 12:28     ` [PATCH 2/3] firmware/dmi_scan: Fix most checkpatch errors and warnings Jean Delvare
2013-07-10 14:59       ` Joe Perches
2013-07-09 15:43 ` Jean Delvare [this message]
2013-07-09 15:58   ` [PATCH 3/3] firmware/dmi_scan: Constify strings Joe Perches
2013-07-09 16:23     ` Jean Delvare

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=1373384634.4391.10.camel@chaos.site \
    --to=jdelvare@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=ben@decadent.org.uk \
    --cc=linux-kernel@vger.kernel.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