This is the style we have ever since. Spell it out. With the difference
that now single line statements may have braces.
Recently we were already sloppy about allowing curly braces for single line
statements. Maybe there was a point in that. Imagine you start with:
if (condition)
call(some, parameter);
Afterwards you change the code so that the line becomes too long and
clang-format wraps the line (requiring you to add braces):
if (condition) {
call(some,
call_another_function(hey));
}
The problem now is that this diff is larger than it would have been, if
you added curly braces from the start. Also, it means you have to go
back and forth to add/remove these braces, as clang-format reformats the
code.
Also, if you have if-else-if blocks, then mixing multi line statements
with single line statements is also cumbersome, because when something
needs to change, the diff is may be larger (and the change more
cumbersome).
So it might be convenient to just always add the braces, and the
documented style now allows for that.
We have a copy of a few linux user space headers in `src/linux-headers`.
The idea is that we want to use recent kernel API, and not depend on the
kernel UAPI headers installed on the build system (and not need to
workaround that).
However, we may not be able to simply compile them, because they too
have dependencies. For example,
../src/linux-headers/ethtool.h:1389:2: error: implicit declaration of function '__KERNEL_DIV_ROUND_UP' [-Werror=implicit-function-declaration]
__u32 queue_mask[__KERNEL_DIV_ROUND_UP(MAX_NUM_QUEUE, 32)];
^
As workaround, don't include headers from "linux-headers" directly,
but only include the new "libnm-std-aux/nm-linux-compat.h" adapter
header, which tries to solve these incompatibilities.
Fixes: 34d48d2596 ('platform: clear all BASE types when setting advertised modes for ethernet autoneg')
We should write our CONTRIBUTING files in markdown syntax, because
it's nice to read a plain text and gets nicely rendered.
However, if the file doesn't have a ".md" extension, gitlab's
web interface shows it as plain text file.
Rename the file.
This possibly breaks links like [1], but referring to a branch name
(and not a commit ID or a tag) is anyway fragile. Hence, I don't try
to fix that by adding a symlink or similar, because I think that just
makes it more confusing.
[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/master/CONTRIBUTING