Re: [PATCH] pwm: Add missing '\n' in log messages

From: Christophe JAILLET
Date: Tue Apr 14 2020 - 14:30:19 EST


Le 14/04/2020 à 15:58, Thierry Reding a écrit :
On Sat, Apr 11, 2020 at 05:35:28PM +0200, Christophe JAILLET wrote:
Message logged by 'dev_xxx()' or 'pr_xxx()' should end with a '\n'.

Fixes: 3ad1f3a33286 ("pwm: Implement some checks for lowlevel drivers")
Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
---
drivers/pwm/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 9973c442b455..bca04965bfe6 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -537,7 +537,7 @@ static void pwm_apply_state_debug(struct pwm_device *pwm,
if (!state->enabled && s2.enabled && s2.duty_cycle > 0)
dev_warn(chip->dev,
- "requested disabled, but yielded enabled with duty > 0");
+ "requested disabled, but yielded enabled with duty > 0\n");
/* reapply the state that the driver reported being configured. */
err = chip->ops->apply(chip, pwm, &s1);
I don't think this is strictly necessary any longer since the logging
functions are supposed to add these themselves nowadays. But I like the
consistency of this, so I'll apply this anyway.

Thanks,
Thierry

Hi Thierry,

I've sent more or less 10 similar patches against files updated recently, that is to say against files which are actively maintained.

I've done it to get feedback on the acceptances rate of such proposals.
The goal is not to flood everyone with such patches, but rather to see if adding a new kind of test to checkpatch.pl makes sense.

Being able to detect early missing trailing '\n' would help maintainers and patch providers.

You are the 2nd person (I've added Paul Cercueil in copy of my reply) who reports that he is thinking that it is no more required to add a '\n'.


If you have any pointer about it, it would be much appreciated.

It would mean, that either this additional checkpatch test is useless, or maybe that it should be reversed and spot *un*needed '\n'.

CJ