diff mbox series

pwm: jz4740: Add trailing \n to error messages

Message ID 20231123083322.405390-1-u.kleine-koenig@pengutronix.de (mailing list archive)
State Handled Elsewhere
Headers show
Series pwm: jz4740: Add trailing \n to error messages | expand

Commit Message

Uwe Kleine-König Nov. 23, 2023, 8:33 a.m. UTC
Error messages are supposed to end in \n. Add the line terminator to the
two error messages that lack this.

Suggested-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

this was noticed by Paul in
https://lore.kernel.org/linux-pwm/ba21c20b20364a39d5ffff81dac8bd300a746dbb.camel@crapouillou.net.
Instead of sneaking this into a patch that probably won't get applied
quickly, make this explicit.

I based it on top of my PR that can be found at
https://lore.kernel.org/linux-pwm/20231121112029.gyv3gqirlycysyr4@pengutronix.de,
but applies just fine to v6.7-rc1.

If you want a fixes-line, that would be:

Fixes: 485b56f08f33 ("pwm: jz4740: Improve algorithm of clock calculation")

for the first hunk and

Fixes: ce1f9cece057 ("pwm: jz4740: Use clocks from TCU driver")

for the second. If this is backported to something before
v5.10-rc1~57^2~11, there is another instance with a missing \n.

Best regards
Uwe

 drivers/pwm/pwm-jz4740.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


base-commit: 869de350ff3834145273a6d39faedea878c6715a

Comments

Thierry Reding Nov. 24, 2023, 12:43 p.m. UTC | #1
On Thu, Nov 23, 2023 at 09:33:23AM +0100, Uwe Kleine-König wrote:
> Error messages are supposed to end in \n. Add the line terminator to the
> two error messages that lack this.
> 
> Suggested-by: Paul Cercueil <paul@crapouillou.net>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
> 
> this was noticed by Paul in
> https://lore.kernel.org/linux-pwm/ba21c20b20364a39d5ffff81dac8bd300a746dbb.camel@crapouillou.net.
> Instead of sneaking this into a patch that probably won't get applied
> quickly, make this explicit.
> 
> I based it on top of my PR that can be found at
> https://lore.kernel.org/linux-pwm/20231121112029.gyv3gqirlycysyr4@pengutronix.de,
> but applies just fine to v6.7-rc1.
> 
> If you want a fixes-line, that would be:
> 
> Fixes: 485b56f08f33 ("pwm: jz4740: Improve algorithm of clock calculation")
> 
> for the first hunk and
> 
> Fixes: ce1f9cece057 ("pwm: jz4740: Use clocks from TCU driver")
> 
> for the second. If this is backported to something before
> v5.10-rc1~57^2~11, there is another instance with a missing \n.
> 
> Best regards
> Uwe

My recollection is that the newlines aren't strictly required because
printk will typically insert them itself (unless KERN_CONT is involved
at some point). So I don't think this really fixes anything, but I'm
willing to pick this up for consistency.

Thierry
Thierry Reding Nov. 28, 2023, 4:59 p.m. UTC | #2
On Thu, 23 Nov 2023 09:33:23 +0100, Uwe Kleine-König wrote:
> Error messages are supposed to end in \n. Add the line terminator to the
> two error messages that lack this.
> 
> 

Applied, thanks!

[1/1] pwm: jz4740: Add trailing \n to error messages
      commit: 2d246fe011bbf5f17bcaa7e70484618aab0b975f

Best regards,
Uwe Kleine-König Dec. 4, 2023, 5:12 p.m. UTC | #3
Hello,

On Fri, Nov 24, 2023 at 01:43:01PM +0100, Thierry Reding wrote:
> On Thu, Nov 23, 2023 at 09:33:23AM +0100, Uwe Kleine-König wrote:
> > Error messages are supposed to end in \n. Add the line terminator to the
> > two error messages that lack this.
> > 
> > Suggested-by: Paul Cercueil <paul@crapouillou.net>
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > ---
> > Hello,
> > 
> > this was noticed by Paul in
> > https://lore.kernel.org/linux-pwm/ba21c20b20364a39d5ffff81dac8bd300a746dbb.camel@crapouillou.net.
> > Instead of sneaking this into a patch that probably won't get applied
> > quickly, make this explicit.
> > 
> > I based it on top of my PR that can be found at
> > https://lore.kernel.org/linux-pwm/20231121112029.gyv3gqirlycysyr4@pengutronix.de,
> > but applies just fine to v6.7-rc1.
> > 
> > If you want a fixes-line, that would be:
> > 
> > Fixes: 485b56f08f33 ("pwm: jz4740: Improve algorithm of clock calculation")
> > 
> > for the first hunk and
> > 
> > Fixes: ce1f9cece057 ("pwm: jz4740: Use clocks from TCU driver")
> > 
> > for the second. If this is backported to something before
> > v5.10-rc1~57^2~11, there is another instance with a missing \n.
> > 
> > Best regards
> > Uwe
> 
> My recollection is that the newlines aren't strictly required because
> printk will typically insert them itself (unless KERN_CONT is involved
> at some point). So I don't think this really fixes anything, but I'm
> willing to pick this up for consistency.

Well, they will behave if the next printk (on the same CPU?) doesn't use
KERN_CONT. So this change fixes a really unlikely race condition.

Best regards
Uwe
diff mbox series

Patch

diff --git a/drivers/pwm/pwm-jz4740.c b/drivers/pwm/pwm-jz4740.c
index e9375de60ad6..73f96cef1662 100644
--- a/drivers/pwm/pwm-jz4740.c
+++ b/drivers/pwm/pwm-jz4740.c
@@ -149,7 +149,7 @@  static int jz4740_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
 	 */
 	rate = clk_round_rate(clk, tmp);
 	if (rate < 0) {
-		dev_err(chip->dev, "Unable to round rate: %ld", rate);
+		dev_err(chip->dev, "Unable to round rate: %ld\n", rate);
 		return rate;
 	}
 
@@ -170,7 +170,7 @@  static int jz4740_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
 
 	err = clk_set_rate(clk, rate);
 	if (err) {
-		dev_err(chip->dev, "Unable to set rate: %d", err);
+		dev_err(chip->dev, "Unable to set rate: %d\n", err);
 		return err;
 	}