Re: [PATCH] userfaultfd: selftests: make __{s,u}64 format specifiers portable

From: Miguel Ojeda
Date: Wed Dec 02 2020 - 19:10:14 EST


On Thu, Dec 3, 2020 at 12:55 AM Axel Rasmussen <axelrasmussen@xxxxxxxxxx> wrote:
>
> This is what clang-format yields. Are you thinking it would be better
> to line everything up with the ( in uffd_error( ?

Yeah, sometimes clang-format cannot do a good job with the 80 column
limit + 8 tabs.

You are definitely not forced to follow clang-format output by any
means. Subsystem maintainers decide what style they prefer anyway,
which could range from a manual approach to following clang-format
strictly. Clang-format implements the general kernel style as closely
as we could get it so far (it will improve more in the future when we
raise the minimum clang-format version required). See
Doc/process/clang-format.rst.

> Or, perhaps this case is a good reason to make uffd_error() a variadic
> macro so we can insert "-EEXIST" || "error" with a "%s".

...and indeed, sometimes it is a hint that simplifying things could help :-)

Cheers,
Miguel