diff mbox

[23/35] drivers/mfd: Convert remaining uses of pr_warning to pr_warn

Message ID a6c827c14d0b9f4be42e549ec4c629245516e979.1487314667.git.joe@perches.com (mailing list archive)
State New, archived
Headers show

Commit Message

Joe Perches Feb. 17, 2017, 7:11 a.m. UTC
To enable eventual removal of pr_warning

This makes pr_warn use consistent for drivers/mfd

Prior to this patch, there were 4 uses of pr_warning and
9 uses of pr_warn in drivers/mfd

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/mfd/db8500-prcmu.c  | 2 +-
 drivers/mfd/sta2x11-mfd.c   | 4 ++--
 drivers/mfd/twl4030-power.c | 7 ++-----
 3 files changed, 5 insertions(+), 8 deletions(-)

Comments

Lee Jones March 14, 2017, 2:04 p.m. UTC | #1
On Thu, 16 Feb 2017, Joe Perches wrote:

> To enable eventual removal of pr_warning
> 
> This makes pr_warn use consistent for drivers/mfd
> 
> Prior to this patch, there were 4 uses of pr_warning and
> 9 uses of pr_warn in drivers/mfd
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/mfd/db8500-prcmu.c  | 2 +-
>  drivers/mfd/sta2x11-mfd.c   | 4 ++--
>  drivers/mfd/twl4030-power.c | 7 ++-----
>  3 files changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
> index ca38a6a14110..5c739ac752e8 100644
> --- a/drivers/mfd/db8500-prcmu.c
> +++ b/drivers/mfd/db8500-prcmu.c
> @@ -2377,7 +2377,7 @@ static void ack_dbb_wakeup(void)
>  
>  static inline void print_unknown_header_warning(u8 n, u8 header)
>  {
> -	pr_warning("prcmu: Unknown message header (%d) in mailbox %d.\n",
> +	pr_warn("prcmu: Unknown message header (%d) in mailbox %d\n",
>  		header, n);
>  }
>  
> diff --git a/drivers/mfd/sta2x11-mfd.c b/drivers/mfd/sta2x11-mfd.c
> index 9292202039ee..3aeafa228baf 100644
> --- a/drivers/mfd/sta2x11-mfd.c
> +++ b/drivers/mfd/sta2x11-mfd.c
> @@ -60,8 +60,8 @@ static struct sta2x11_mfd *sta2x11_mfd_find(struct pci_dev *pdev)
>  	struct sta2x11_mfd *mfd;
>  
>  	if (!pdev && !list_empty(&sta2x11_mfd_list)) {
> -		pr_warning("%s: Unspecified device, "
> -			    "using first instance\n", __func__);
> +		pr_warn("%s: Unspecified device, using first instance\n",
> +			__func__);
>  		return list_entry(sta2x11_mfd_list.next,
>  				  struct sta2x11_mfd, list);
>  	}
> diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
> index 1beb722f6080..8be023ba8e3e 100644
> --- a/drivers/mfd/twl4030-power.c
> +++ b/drivers/mfd/twl4030-power.c
> @@ -502,9 +502,7 @@ static int load_twl4030_script(const struct twl4030_power_data *pdata,
>  	}
>  	if (tscript->flags & TWL4030_SLEEP_SCRIPT) {
>  		if (!order)
> -			pr_warning("TWL4030: Bad order of scripts (sleep "\
> -					"script before wakeup) Leads to boot"\
> -					"failure on some boards\n");
> +			pr_warn("TWL4030: Bad order of scripts (sleep script before wakeup) Leads to boot failure on some boards\n");

Is 80 chars considered the lessor sin?

>  		err = twl4030_config_sleep_sequence(address);
>  	}
>  out:
> @@ -929,8 +927,7 @@ static int twl4030_power_probe(struct platform_device *pdev)
>  		err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &val,
>  				      TWL4030_PM_MASTER_CFG_P123_TRANSITION);
>  		if (err) {
> -			pr_warning("TWL4030 Unable to read registers\n");
> -
> +			pr_warn("TWL4030 Unable to read registers\n");
>  		} else if (!(val & SEQ_OFFSYNC)) {
>  			val |= SEQ_OFFSYNC;
>  			err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, val,
Joe Perches March 14, 2017, 5:17 p.m. UTC | #2
On Tue, 2017-03-14 at 14:04 +0000, Lee Jones wrote:
> On Thu, 16 Feb 2017, Joe Perches wrote:
> > To enable eventual removal of pr_warning
[]
> > diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
[]
> > @@ -502,9 +502,7 @@ static int load_twl4030_script(const struct twl4030_power_data *pdata,
> >  	}
> >  	if (tscript->flags & TWL4030_SLEEP_SCRIPT) {
> >  		if (!order)
> > -			pr_warning("TWL4030: Bad order of scripts (sleep "\
> > -					"script before wakeup) Leads to boot"\
> > -					"failure on some boards\n");
> > +			pr_warn("TWL4030: Bad order of scripts (sleep script before wakeup) Leads to boot failure on some boards\n");
> 
> Is 80 chars considered the lessor sin?

Splitting logging messages into multiple lines is non preferred.

Documentation/process/coding-style.rst:

Breaking long lines and strings:

never break user-visible strings such as
printk messages, because that breaks the ability to grep for them.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lee Jones March 15, 2017, 12:23 p.m. UTC | #3
On Tue, 14 Mar 2017, Joe Perches wrote:

> On Tue, 2017-03-14 at 14:04 +0000, Lee Jones wrote:
> > On Thu, 16 Feb 2017, Joe Perches wrote:
> > > To enable eventual removal of pr_warning
> []
> > > diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
> []
> > > @@ -502,9 +502,7 @@ static int load_twl4030_script(const struct twl4030_power_data *pdata,
> > >  	}
> > >  	if (tscript->flags & TWL4030_SLEEP_SCRIPT) {
> > >  		if (!order)
> > > -			pr_warning("TWL4030: Bad order of scripts (sleep "\
> > > -					"script before wakeup) Leads to boot"\
> > > -					"failure on some boards\n");
> > > +			pr_warn("TWL4030: Bad order of scripts (sleep script before wakeup) Leads to boot failure on some boards\n");
> > 
> > Is 80 chars considered the lessor sin?
> 
> Splitting logging messages into multiple lines is non preferred.
> 
> Documentation/process/coding-style.rst:
> 
> Breaking long lines and strings:
> 
> never break user-visible strings such as
> printk messages, because that breaks the ability to grep for them.

Right, I'm aware of this.  I'm also aware of the other rule we have
where lines are not to exceed 80 chars.  Hence my question; "is the 80
chars rule the lessor sin of the two".

Rock <=> hard place

Actually I would say that the error message sub-optimal and could, in
fact be edited to be more succinct, thus not breaking any rules.
Joe Perches March 15, 2017, 2:17 p.m. UTC | #4
On Wed, 2017-03-15 at 12:23 +0000, Lee Jones wrote:
> On Tue, 14 Mar 2017, Joe Perches wrote:
[]
> > never break user-visible strings such as
> > printk messages, because that breaks the ability to grep for them.
> 
> Right, I'm aware of this.  I'm also aware of the other rule we have
> where lines are not to exceed 80 chars.  Hence my question; "is the 80
> chars rule the lessor sin of the two".
> 
> Rock <=> hard place
> 
> Actually I would say that the error message sub-optimal and could, in
> fact be edited to be more succinct, thus not breaking any rules. 

It's not a 'sin' at all.

The rule is to exceed 80 columns when the logging
message format is long.

I didn't even look at the format content.
Change it if you wish.

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lee Jones March 23, 2017, 10:52 a.m. UTC | #5
> To enable eventual removal of pr_warning
> 
> This makes pr_warn use consistent for drivers/mfd
> 
> Prior to this patch, there were 4 uses of pr_warning and
> 9 uses of pr_warn in drivers/mfd
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/mfd/db8500-prcmu.c  | 2 +-
>  drivers/mfd/sta2x11-mfd.c   | 4 ++--
>  drivers/mfd/twl4030-power.c | 7 ++-----
>  3 files changed, 5 insertions(+), 8 deletions(-)

Applied.

(... and I corrected the $SUBJECT line on your behalf)

> diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
> index ca38a6a14110..5c739ac752e8 100644
> --- a/drivers/mfd/db8500-prcmu.c
> +++ b/drivers/mfd/db8500-prcmu.c
> @@ -2377,7 +2377,7 @@ static void ack_dbb_wakeup(void)
>  
>  static inline void print_unknown_header_warning(u8 n, u8 header)
>  {
> -	pr_warning("prcmu: Unknown message header (%d) in mailbox %d.\n",
> +	pr_warn("prcmu: Unknown message header (%d) in mailbox %d\n",
>  		header, n);
>  }
>  
> diff --git a/drivers/mfd/sta2x11-mfd.c b/drivers/mfd/sta2x11-mfd.c
> index 9292202039ee..3aeafa228baf 100644
> --- a/drivers/mfd/sta2x11-mfd.c
> +++ b/drivers/mfd/sta2x11-mfd.c
> @@ -60,8 +60,8 @@ static struct sta2x11_mfd *sta2x11_mfd_find(struct pci_dev *pdev)
>  	struct sta2x11_mfd *mfd;
>  
>  	if (!pdev && !list_empty(&sta2x11_mfd_list)) {
> -		pr_warning("%s: Unspecified device, "
> -			    "using first instance\n", __func__);
> +		pr_warn("%s: Unspecified device, using first instance\n",
> +			__func__);
>  		return list_entry(sta2x11_mfd_list.next,
>  				  struct sta2x11_mfd, list);
>  	}
> diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
> index 1beb722f6080..8be023ba8e3e 100644
> --- a/drivers/mfd/twl4030-power.c
> +++ b/drivers/mfd/twl4030-power.c
> @@ -502,9 +502,7 @@ static int load_twl4030_script(const struct twl4030_power_data *pdata,
>  	}
>  	if (tscript->flags & TWL4030_SLEEP_SCRIPT) {
>  		if (!order)
> -			pr_warning("TWL4030: Bad order of scripts (sleep "\
> -					"script before wakeup) Leads to boot"\
> -					"failure on some boards\n");
> +			pr_warn("TWL4030: Bad order of scripts (sleep script before wakeup) Leads to boot failure on some boards\n");
>  		err = twl4030_config_sleep_sequence(address);
>  	}
>  out:
> @@ -929,8 +927,7 @@ static int twl4030_power_probe(struct platform_device *pdev)
>  		err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &val,
>  				      TWL4030_PM_MASTER_CFG_P123_TRANSITION);
>  		if (err) {
> -			pr_warning("TWL4030 Unable to read registers\n");
> -
> +			pr_warn("TWL4030 Unable to read registers\n");
>  		} else if (!(val & SEQ_OFFSYNC)) {
>  			val |= SEQ_OFFSYNC;
>  			err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, val,
diff mbox

Patch

diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index ca38a6a14110..5c739ac752e8 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -2377,7 +2377,7 @@  static void ack_dbb_wakeup(void)
 
 static inline void print_unknown_header_warning(u8 n, u8 header)
 {
-	pr_warning("prcmu: Unknown message header (%d) in mailbox %d.\n",
+	pr_warn("prcmu: Unknown message header (%d) in mailbox %d\n",
 		header, n);
 }
 
diff --git a/drivers/mfd/sta2x11-mfd.c b/drivers/mfd/sta2x11-mfd.c
index 9292202039ee..3aeafa228baf 100644
--- a/drivers/mfd/sta2x11-mfd.c
+++ b/drivers/mfd/sta2x11-mfd.c
@@ -60,8 +60,8 @@  static struct sta2x11_mfd *sta2x11_mfd_find(struct pci_dev *pdev)
 	struct sta2x11_mfd *mfd;
 
 	if (!pdev && !list_empty(&sta2x11_mfd_list)) {
-		pr_warning("%s: Unspecified device, "
-			    "using first instance\n", __func__);
+		pr_warn("%s: Unspecified device, using first instance\n",
+			__func__);
 		return list_entry(sta2x11_mfd_list.next,
 				  struct sta2x11_mfd, list);
 	}
diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
index 1beb722f6080..8be023ba8e3e 100644
--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -502,9 +502,7 @@  static int load_twl4030_script(const struct twl4030_power_data *pdata,
 	}
 	if (tscript->flags & TWL4030_SLEEP_SCRIPT) {
 		if (!order)
-			pr_warning("TWL4030: Bad order of scripts (sleep "\
-					"script before wakeup) Leads to boot"\
-					"failure on some boards\n");
+			pr_warn("TWL4030: Bad order of scripts (sleep script before wakeup) Leads to boot failure on some boards\n");
 		err = twl4030_config_sleep_sequence(address);
 	}
 out:
@@ -929,8 +927,7 @@  static int twl4030_power_probe(struct platform_device *pdev)
 		err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &val,
 				      TWL4030_PM_MASTER_CFG_P123_TRANSITION);
 		if (err) {
-			pr_warning("TWL4030 Unable to read registers\n");
-
+			pr_warn("TWL4030 Unable to read registers\n");
 		} else if (!(val & SEQ_OFFSYNC)) {
 			val |= SEQ_OFFSYNC;
 			err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, val,