On Tue, Nov 6, 2018 at 8:58 AM Joe Perches <joe@xxxxxxxxxxx> wrote:Using pr_* code become more and more in kernel when i read code and then i ask
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).