mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jingoo Han <jg1.han@samsung.com>
To: "'MyungJoo Ham'" <myungjoo.ham@samsung.com>
Cc: "'Chanwoo Choi'" <cw00.choi@samsung.com>,
	linux-kernel@vger.kernel.org,
	"'Jingoo Han'" <jg1.han@samsung.com>
Subject: [PATCH v2 2/2] extcon: max8997: add missing const
Date: Tue, 19 Mar 2013 14:31:36 +0900	[thread overview]
Message-ID: <000201ce2463$06750e60$135f2b20$%han@samsung.com> (raw)
In-Reply-To: <000101ce2462$e31b5fa0$a9521ee0$%han@samsung.com>

Fixed the checkpatch warning as below:

  WARNING: static const char * array should probably be static const char * const
  #163: FILE: drivers/extcon/extcon-max8997.c:163:
  +static const char *max8997_extcon_cable[] = {

Also, const is added to variable 'supported_cable' to prevent
build warning as below:

  drivers/extcon/extcon-max8997.c: In function 'max8997_muic_probe':
  drivers/extcon/extcon-max8997.c:708:30: warning: assignment discards 'const' qualifier from pointer target type [enabled by
default]

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
Changes since v1:
- Added const to variable 'supported_cable'

 drivers/extcon/extcon-max8997.c |    2 +-
 include/linux/extcon.h          |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
index 20772ad..b82a591 100644
--- a/drivers/extcon/extcon-max8997.c
+++ b/drivers/extcon/extcon-max8997.c
@@ -160,7 +160,7 @@ enum {
 	_EXTCON_CABLE_NUM,
 };
 
-static const char *max8997_extcon_cable[] = {
+static const char * const max8997_extcon_cable[] = {
 	[EXTCON_CABLE_USB]			= "USB",
 	[EXTCON_CABLE_USB_HOST]			= "USB-Host",
 	[EXTCON_CABLE_TA]			= "TA",
diff --git a/include/linux/extcon.h b/include/linux/extcon.h
index fcb51c8..741a491 100644
--- a/include/linux/extcon.h
+++ b/include/linux/extcon.h
@@ -113,7 +113,7 @@ struct extcon_cable;
 struct extcon_dev {
 	/* --- Optional user initializing data --- */
 	const char	*name;
-	const char **supported_cable;
+	const char * const *supported_cable;
 	const u32	*mutually_exclusive;
 
 	/* --- Optional callbacks to override class functions --- */
-- 
1.7.2.5



  reply	other threads:[~2013-03-19  5:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-19  5:30 [PATCH v2 1/2] extcon: max8997: use dev_err() instead of pr_err() Jingoo Han
2013-03-19  5:31 ` Jingoo Han [this message]
2013-03-19  9:45   ` [PATCH v2 2/2] extcon: max8997: add missing const Chanwoo Choi
2013-03-19 10:29     ` Jingoo Han
2013-03-19  9:36 ` [PATCH v2 1/2] extcon: max8997: use dev_err() instead of pr_err() Chanwoo Choi

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='000201ce2463$06750e60$135f2b20$%han@samsung.com' \
    --to=jg1.han@samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    /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

all inboxes | Powered by JetHome®