Re: [PATCH 1/4] iio: accel: bmc150: convert to guard(mutex)
From: Waqar Hameed
Date: Mon Mar 09 2026 - 12:57:07 EST
On Mon, Mar 09, 2026 at 18:26 +0200 Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:
> On Mon, Mar 09, 2026 at 03:35:58PM +0100, Waqar Hameed wrote:
[...]
>> Why? Think about traceability (bisect etc.).
>
> It's all about maintenance and development. Easy to see where need to put
> a new header if it's not present (also easier to find this at a glance).
Totally agree (see below).
>
>> This comment applies to all other patches in the series as well. I'll
>> just state it here and wait for V2 before taking a deeper look.
>
>> To be honest, I'm not even sure if sorting the headers is a "valid"
>> patch. It's just cosmetics (and there seems to be no such code style
>> guidelines)...
>
> It's valid when in a series (not as just for the sake of sorting). Here
> it would make sense to have it as a precursor to find the best place for
> a new header inclusion to place.
>
> Guidelines here are still missing maintainer preferences for IIO subsystem.
Yeah, I guess that's kind of the issue here (or in general for kernel
developing). Every sub-system have their preference. You just have to
carefully navigate through all of this :)
Moreover, I always tend to sort the include header when creating a _new_
file (for the reason you stated above). `clang-format` does that
automatically for me, though you have to modify the
`.clang-format`-file:
diff --git a/.clang-format b/.clang-format
index 1cc151e2adcc5..f6631d03bd3f3 100644
--- a/.clang-format
+++ b/.clang-format
@@ -784,7 +784,7 @@ PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: false
-SortIncludes: false
+SortIncludes: true
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
The reason for the `false` value can be read in the last section "Extra
features/option" in `Documentation/dev-tools/clang-format.rst`.