workflows.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] docs: netdev: Document guidance on inline functions
@ 2025-02-03 13:59 Simon Horman
  2025-02-03 15:00 ` Jonathan Corbet
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Simon Horman @ 2025-02-03 13:59 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Jonathan Corbet
  Cc: Alexandre Ferrieux, netdev, workflows, linux-doc

Document preference for non inline functions in .c files.
This has been the preference for as long as I can recall
and I was recently surprised to discover that it is undocumented.

Reported-by: Alexandre Ferrieux <alexandre.ferrieux@gmail.com>
Closes: https://lore.kernel.org/all/9662e6fe-cc91-4258-aba1-ab5b016a041a@orange.com/
Signed-off-by: Simon Horman <horms@kernel.org>
---
 Documentation/process/maintainer-netdev.rst | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Documentation/process/maintainer-netdev.rst b/Documentation/process/maintainer-netdev.rst
index e497729525d5..1fbb8178b8cd 100644
--- a/Documentation/process/maintainer-netdev.rst
+++ b/Documentation/process/maintainer-netdev.rst
@@ -408,6 +408,17 @@ at a greater cost than the value of such clean-ups.
 
 Conversely, spelling and grammar fixes are not discouraged.
 
+Inline functions
+----------------
+
+The use of static inline functions in .c file is strongly discouraged
+unless there is a demonstrable reason for them, usually performance
+related. Rather, it is preferred to omit the inline keyword and allow the
+compiler to inline them as it sees fit.
+
+This is a stricter requirement than that of the general Linux Kernel
+:ref:`Coding Style<codingstyle>`
+
 Resending after review
 ~~~~~~~~~~~~~~~~~~~~~~
 


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-02-04 22:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-03 13:59 [PATCH net] docs: netdev: Document guidance on inline functions Simon Horman
2025-02-03 15:00 ` Jonathan Corbet
2025-02-03 19:50   ` Mauro Carvalho Chehab
2025-02-03 19:53     ` Mauro Carvalho Chehab
2025-02-04 11:55       ` Simon Horman
2025-02-04 11:54     ` Simon Horman
2025-02-04 13:25       ` Andrew Lunn
2025-02-04 20:07         ` Simon Horman
2025-02-04 22:46   ` David Laight
2025-02-03 15:10 ` Andrew Lunn
2025-02-04  9:35   ` Simon Horman
2025-02-03 18:51 ` Randy Dunlap
2025-02-04 11:56   ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).