Re: [PATCH v1 1/3] usb: typec: ucsi: Limit read size on v1.2

From: Abhishek Pandit-Subedi
Date: Thu Jan 25 2024 - 18:37:36 EST


On Thu, Jan 25, 2024 at 3:16 PM Greg Kroah-Hartman
<gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> On Wed, Jan 24, 2024 at 10:59:28AM -0800, Abhishek Pandit-Subedi wrote:
> > Ack. Will make dev_dbg on the next iteration.
> >
> > This seems like a good addition to the style guide too:
> > https://www.kernel.org/doc/html/v6.7/process/coding-style.html#printing-kernel-messages.
> > "When drivers are working properly, they are quiet. Prefer to use
> > DEBUG messages unless something is wrong."
> >
> > What do you think Greg?
>
> I think you need to stop top-posting :)
>
> But yes, that would be nice, hopefully people actually notice it there.
> Would you have read this and seen it?
>
> thanks,
>
> greg k-h

I blame gmail web-interface for the top-posting :)

Prashant also mentioned the dev_info when we were reviewing this so I
did a quick search for "kernel coding style" (to see if there was
guidance) before sending this up so I would definitely have noticed it
there.
In Bluetooth (where I've previously contributed), dev_info is used for
printing version info (example:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/bluetooth/btintel.c?h=v6.8-rc1#n337)
and it's very useful for debugging so I assumed it was acceptable.

The added benefit of this guidance being in the coding style guide is
it's a quick change to checkpatch.pl to add a warning for this (and
point to the coding style as the source). I'm fairly sure Chromium
actually has a lint that warns whenever you use LOG_INFO(...) for
similar reasons (too many INFO messages that should be DEBUG).

I will send up a patch with the change soon (both to coding style and
checkpatch.pl).

Thanks,
Abhishek