* [PATCH v2 1/2] extcon: max8997: use dev_err() instead of pr_err() @ 2013-03-19 5:30 Jingoo Han 2013-03-19 5:31 ` [PATCH v2 2/2] extcon: max8997: add missing const Jingoo Han 2013-03-19 9:36 ` [PATCH v2 1/2] extcon: max8997: use dev_err() instead of pr_err() Chanwoo Choi 0 siblings, 2 replies; 5+ messages in thread From: Jingoo Han @ 2013-03-19 5:30 UTC (permalink / raw) To: 'MyungJoo Ham' Cc: 'Chanwoo Choi', linux-kernel, 'Jingoo Han' dev_err() is more preferred than pr_err(). Signed-off-by: Jingoo Han <jg1.han@samsung.com> --- No Changes since v1: drivers/extcon/extcon-max8997.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c index 69641bc..20772ad 100644 --- a/drivers/extcon/extcon-max8997.c +++ b/drivers/extcon/extcon-max8997.c @@ -646,7 +646,7 @@ static void max8997_muic_detect_cable_wq(struct work_struct *work) ret = max8997_muic_detect_dev(info); if (ret < 0) - pr_err("failed to detect cable type\n"); + dev_err(info->dev, "failed to detect cable type\n"); } static int max8997_muic_probe(struct platform_device *pdev) -- 1.7.2.5 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] extcon: max8997: add missing const 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 2013-03-19 9:45 ` Chanwoo Choi 2013-03-19 9:36 ` [PATCH v2 1/2] extcon: max8997: use dev_err() instead of pr_err() Chanwoo Choi 1 sibling, 1 reply; 5+ messages in thread From: Jingoo Han @ 2013-03-19 5:31 UTC (permalink / raw) To: 'MyungJoo Ham' Cc: 'Chanwoo Choi', linux-kernel, 'Jingoo Han' 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 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 2/2] extcon: max8997: add missing const 2013-03-19 5:31 ` [PATCH v2 2/2] extcon: max8997: add missing const Jingoo Han @ 2013-03-19 9:45 ` Chanwoo Choi 2013-03-19 10:29 ` Jingoo Han 0 siblings, 1 reply; 5+ messages in thread From: Chanwoo Choi @ 2013-03-19 9:45 UTC (permalink / raw) To: Jingoo Han; +Cc: 'MyungJoo Ham', linux-kernel On 03/19/2013 02:31 PM, Jingoo Han wrote: > 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[] = { OK. > [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; I understand your intention to fix build warning. But, I don't agree this coding style. I think this coding style is not general method. Thanks, Chanwoo Choi ^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH v2 2/2] extcon: max8997: add missing const 2013-03-19 9:45 ` Chanwoo Choi @ 2013-03-19 10:29 ` Jingoo Han 0 siblings, 0 replies; 5+ messages in thread From: Jingoo Han @ 2013-03-19 10:29 UTC (permalink / raw) To: 'Chanwoo Choi' Cc: 'MyungJoo Ham', linux-kernel, 'Jingoo Han' On Tuesday, March 19, 2013 6:45 PM, Chanwoo Choi wrote: > > On 03/19/2013 02:31 PM, Jingoo Han wrote: > > 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[] = { > OK. > > [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; > I understand your intention to fix build warning. > But, I don't agree this coding style. I think this coding > style is not general method. Um, how about the following? In this case, there is no build warning and checkpatch warning. -static const char *max8997_extcon_cable[] = { +static char const *max8997_extcon_cable[] = { > > Thanks, > Chanwoo Choi > > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/2] extcon: max8997: use dev_err() instead of pr_err() 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 ` [PATCH v2 2/2] extcon: max8997: add missing const Jingoo Han @ 2013-03-19 9:36 ` Chanwoo Choi 1 sibling, 0 replies; 5+ messages in thread From: Chanwoo Choi @ 2013-03-19 9:36 UTC (permalink / raw) To: Jingoo Han; +Cc: 'MyungJoo Ham', linux-kernel On 03/19/2013 02:30 PM, Jingoo Han wrote: > dev_err() is more preferred than pr_err(). > > Signed-off-by: Jingoo Han <jg1.han@samsung.com> > --- > No Changes since v1: > > drivers/extcon/extcon-max8997.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c > index 69641bc..20772ad 100644 > --- a/drivers/extcon/extcon-max8997.c > +++ b/drivers/extcon/extcon-max8997.c > @@ -646,7 +646,7 @@ static void max8997_muic_detect_cable_wq(struct work_struct *work) > > ret = max8997_muic_detect_dev(info); > if (ret < 0) > - pr_err("failed to detect cable type\n"); > + dev_err(info->dev, "failed to detect cable type\n"); > } > > static int max8997_muic_probe(struct platform_device *pdev) Applied it. Thanks. Chanwoo Choi ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-03-19 10:29 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 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 ` [PATCH v2 2/2] extcon: max8997: add missing const Jingoo Han 2013-03-19 9:45 ` 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
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.