google / kernel-sanitizers

Linux Kernel Sanitizers, fast bug-detectors for the Linux kernel
https://google.github.io/kernel-sanitizers/
437 stars 87 forks source link

kfence: Various cleanups #45

Closed melver closed 4 years ago

melver commented 4 years ago

Signed-off-by: Marco Elver elver@google.com

ramosian-glider commented 4 years ago

LGTM, thank you! By the way, how do you run clang-format on the kernel source?

melver commented 4 years ago

LGTM, thank you! By the way, how do you run clang-format on the kernel source?

The kernel already has a .clang-format file, so it should just be a matter of running clang-format -i . I'm also using an editor plugin (vim), so I can run it on the buffer I'm editing as well as select individual lines to format. I found that clang-format isn't necessarily the source-of-truth for formatting, but works as a good first approximation while some piece of code is in development; later I go and change some things (e.g. remote 80-char restriction when it makes things more readable as was suggested by maintainers for initial KCSAN PR).