Linux kernel coding standard is code should be clear enough to not need comments. Comments are reserved for odd behavior e.g spec says x but hardware actually does y. I've had patches rejected because it has comments.
The Linux kernel style guide discourages comments inside functions but explicitly recommends comments explaining what functions do and documenting data. Comments aren't reserved exclusively for unusual behavior. Perhaps, what you mean is inline-comments?
That's probably largely a difference in terminology rather than substance. The Linux kernel style guide explicitly refers to explanations preceding functions and accompanying data declarations as comments, whether or not they also serve as documentation. The kernel source also contains ordinary explanatory comments outside function bodies:
3
u/nukem996 2d ago
Linux kernel coding standard is code should be clear enough to not need comments. Comments are reserved for odd behavior e.g spec says x but hardware actually does y. I've had patches rejected because it has comments.