Re: [PATCH v2] kobject: to use pr_warn replace KERN_WARNING

From: YU Bo
Date: Tue Nov 06 2018 - 06:36:09 EST


On Tue, Nov 06, 2018 at 09:09:15AM +0100, Rafael J. Wysocki wrote:
On Tue, Nov 6, 2018 at 8:58 AM Joe Perches <joe@xxxxxxxxxxx> wrote:

On Tue, 2018-11-06 at 08:49 +0100, Rafael J. Wysocki wrote:
> On Tue, Nov 6, 2018 at 3:42 AM Bo YU <tsu.yubo@xxxxxxxxx> wrote:
> > Fix warning form checkpatch, use pr_warn replace KERN_WARNING
> >
> > Signed-off-by: Bo YU <tsu.yubo@xxxxxxxxx>
>
> First off, IMO, you should not change the existing code just in order
> to make checkpatch happy about it. That alone is not a good enough
> reason for modifying it.
>
> If the checkpatch warning indicates an issue like broken white space
> (and I mean really broken and not lines longer than 80 chars etc),
> then that may be a reason to modify the existing code, depending.

Existing code is slightly broken.
There is currently a missing terminating newline in the
non-switch case match, when msg == NULL;

OK, so this should be explained in the patch changelog.

Saying "I do this to make checkpatch happy" in the changelog is just
not enough IMO (if not outright misleading).
Using pr_* code become more and more in kernel when i read code and then i ask
for help from checkpatch. In commit log i just copy the what to to but not my
explations that why to do such.
I will send V3, thanks.