From: Kalle Valo <hidden> Date: 2021-10-05 06:12:58
Pali Rohár [off-list ref] writes:
On Friday 01 October 2021 17:17:52 Jérôme Pouiller wrote:
quoted
On Friday 1 October 2021 11:55:33 CEST Kalle Valo wrote:
quoted
CAUTION: This email originated from outside of the organization.
Do not click links or open attachments unless you recognize the
sender and know the content is safe.
Jerome Pouiller [off-list ref] writes:
I didn't know it was mandatory to prefix all the functions with the
same prefix.
I don't know either if this is mandatory or not, for example I do not
have any recollection what Linus and other maintainers think of this. I
just personally think it's good practise to use driver prefix ("wfx_")
in all non-static functions.
Any opinions from others? Greg?
quoted
With the rule of 80-columns, I think I will have to change a bunch of
code :( .
I think that new drivers can use 100 characters per line.
On Tue, Oct 05, 2021 at 09:12:27AM +0300, Kalle Valo wrote:
Pali Rohár [off-list ref] writes:
quoted
On Friday 01 October 2021 17:17:52 Jérôme Pouiller wrote:
quoted
On Friday 1 October 2021 11:55:33 CEST Kalle Valo wrote:
quoted
CAUTION: This email originated from outside of the organization.
Do not click links or open attachments unless you recognize the
sender and know the content is safe.
Jerome Pouiller [off-list ref] writes:
I didn't know it was mandatory to prefix all the functions with the
same prefix.
I don't know either if this is mandatory or not, for example I do not
have any recollection what Linus and other maintainers think of this. I
just personally think it's good practise to use driver prefix ("wfx_")
in all non-static functions.
Any opinions from others? Greg?
For static functions, pick what you want.
For global functions, like this, use a common prefix that indicates the
driver as you are now playing in the global namespace of a 30 million
line project.
quoted
quoted
With the rule of 80-columns, I think I will have to change a bunch of
code :( .
I think that new drivers can use 100 characters per line.
I didn't know it was mandatory to prefix all the functions with the
same prefix.
I don't know either if this is mandatory or not, for example I do not
have any recollection what Linus and other maintainers think of this. I
just personally think it's good practise to use driver prefix ("wfx_")
in all non-static functions.
What about structs (especially all the structs from hif_api.*.h)? Do you
think I should also prefix them with wfx_?
quoted
quoted
With the rule of 80-columns, I think I will have to change a bunch of
code :( .
I think that new drivers can use 100 characters per line.
I didn't know it was mandatory to prefix all the functions with the
same prefix.
I don't know either if this is mandatory or not, for example I do not
have any recollection what Linus and other maintainers think of this. I
just personally think it's good practise to use driver prefix ("wfx_")
in all non-static functions.
What about structs (especially all the structs from hif_api.*.h)? Do you
think I should also prefix them with wfx_?
Why would they _not_ have wfx_ as a prefix if they only pertain to this
driver?
thanks,
greg k-h
I didn't know it was mandatory to prefix all the functions with the
same prefix.
I don't know either if this is mandatory or not, for example I do not
have any recollection what Linus and other maintainers think of this. I
just personally think it's good practise to use driver prefix ("wfx_")
in all non-static functions.
What about structs (especially all the structs from hif_api.*.h)? Do you
think I should also prefix them with wfx_?
Why would they _not_ have wfx_ as a prefix if they only pertain to this
driver?
hmmm... to keep identifiers small and readable? I find
"wfx_hif_set_tx_rate_retry_policy" a bit long.
Don't worry, I don't want to debate the rules. I am going to apply them.
--
Jérôme Pouiller
From: Jakub Kicinski <kuba@kernel.org> Date: 2021-10-05 14:02:51
On Tue, 05 Oct 2021 09:12:27 +0300 Kalle Valo wrote:
quoted
quoted
I didn't know it was mandatory to prefix all the functions with the
same prefix.
I don't know either if this is mandatory or not, for example I do not
have any recollection what Linus and other maintainers think of this. I
just personally think it's good practise to use driver prefix ("wfx_")
in all non-static functions.
I'd even say all functions. The prefixes are usually 3 chars, it's no
hassle to add and makes reading the code and looking at stack traces
much more intuitive for people who are not intimately familiar with
the code.