Re: [PATCH net] docs: netdev: Document guidance on inline functions

2025-02-04 Thread David Laight
... > > +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

Re: [PATCH net] docs: netdev: Document guidance on inline functions

2025-02-04 Thread Simon Horman
On Tue, Feb 04, 2025 at 02:25:07PM +0100, Andrew Lunn wrote: > > Thanks, perhaps something like this would help: > > > > Using inline in .h files is fine and is encouraged in place of macros > > [reference section 12]. > > The other major use of them in headers is for stub functions when an >

Re: [PATCH net] docs: netdev: Document guidance on inline functions

2025-02-04 Thread Andrew Lunn
> Thanks, perhaps something like this would help: > > Using inline in .h files is fine and is encouraged in place of macros > [reference section 12]. The other major use of them in headers is for stub functions when an API implementation has a Kconfig option. The question is, do we really wan

Re: [PATCH net] docs: netdev: Document guidance on inline functions

2025-02-04 Thread Simon Horman
On Mon, Feb 03, 2025 at 10:51:49AM -0800, Randy Dunlap wrote: > Hi Simon, > > Another nit: > > On 2/3/25 5:59 AM, Simon Horman wrote: > > 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 disc

Re: [PATCH net] docs: netdev: Document guidance on inline functions

2025-02-04 Thread Simon Horman
On Mon, Feb 03, 2025 at 08:53:12PM +0100, Mauro Carvalho Chehab wrote: > Em Mon, 3 Feb 2025 20:50:39 +0100 > Mauro Carvalho Chehab escreveu: > > > Em Mon, 03 Feb 2025 08:00:56 -0700 > > Jonathan Corbet escreveu: > > > > > Simon Horman writes: > > > > > > > Document preference for non inline f

Re: [PATCH net] docs: netdev: Document guidance on inline functions

2025-02-04 Thread Simon Horman
On Mon, Feb 03, 2025 at 08:50:39PM +0100, Mauro Carvalho Chehab wrote: > Em Mon, 03 Feb 2025 08:00:56 -0700 > Jonathan Corbet escreveu: > > > Simon Horman writes: > > > > > Document preference for non inline functions in .c files. > > > This has been the preference for as long as I can recall >

Re: [PATCH net] docs: netdev: Document guidance on inline functions

2025-02-04 Thread Simon Horman
On Mon, Feb 03, 2025 at 04:10:24PM +0100, Andrew Lunn wrote: > > Conversely, spelling and grammar fixes are not discouraged. > > > > +Inline functions > > + > > + > > +The use of static inline functions in .c file is strongly discouraged > > I don't think 'static' is relevant he

Re: [PATCH net] docs: netdev: Document guidance on inline functions

2025-02-03 Thread Mauro Carvalho Chehab
Em Mon, 3 Feb 2025 20:50:39 +0100 Mauro Carvalho Chehab escreveu: > Em Mon, 03 Feb 2025 08:00:56 -0700 > Jonathan Corbet escreveu: > > > Simon Horman writes: > > > > > Document preference for non inline functions in .c files. > > > This has been the preference for as long as I can recall > >

Re: [PATCH net] docs: netdev: Document guidance on inline functions

2025-02-03 Thread Mauro Carvalho Chehab
Em Mon, 03 Feb 2025 08:00:56 -0700 Jonathan Corbet escreveu: > Simon Horman writes: > > > 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

Re: [PATCH net] docs: netdev: Document guidance on inline functions

2025-02-03 Thread Randy Dunlap
Hi Simon, Another nit: On 2/3/25 5:59 AM, Simon Horman wrote: > 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 > Closes:

Re: [PATCH net] docs: netdev: Document guidance on inline functions

2025-02-03 Thread Andrew Lunn
> Conversely, spelling and grammar fixes are not discouraged. > > +Inline functions > + > + > +The use of static inline functions in .c file is strongly discouraged I don't think 'static' is relevant here. They probably are static, if they are inline, and to avoid warnings about

Re: [PATCH net] docs: netdev: Document guidance on inline functions

2025-02-03 Thread Jonathan Corbet
Simon Horman writes: > 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 > Closes: > https://lore.kernel.org/all/9662e6fe-cc

[PATCH net] docs: netdev: Document guidance on inline functions

2025-02-03 Thread Simon Horman
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 Closes: https://lore.kernel.org/all/9662e6fe-cc91-4258-aba1-ab5b016a0...@orange.com