Re: [driver-core PATCH v5 5/9] driver core: Establish clear order of operations for deferred probe and remove

From: Bart Van Assche
Date: Thu Nov 08 2018 - 18:42:28 EST


On Tue, 2018-11-06 at 17:34 -0800, Joe Perches wrote:
+AD4 On Tue, 2018-11-06 at 15:48 -0800, Bart Van Assche wrote:
+AD4 +AD4 On Mon, 2018-11-05 at 13:12 -0800, Alexander Duyck wrote:
+AD4 +AD4 +AD4 One change I made in addition is I replaced the use of +ACI-bool X:1+ACI to define
+AD4 +AD4 +AD4 the bitfield to a +ACI-u8 X:1+ACI setup in order to resolve some checkpatch
+AD4 +AD4 +AD4 warnings.
+AD4 +AD4
+AD4 +AD4 Please use +ACI-bool X:1+ACI instead of +ACI-u8 X:1+ACI. I think it was a bad idea to make
+AD4 +AD4 checkpatch complain about +ACI-bool X:1+ACI since +ACI-bool X:1+ACI should only be avoided
+AD4 +AD4 in structures for which alignment must be architecture-independent. For struct
+AD4 +AD4 device it is fine if member alignment differs per architecture. Additionally,
+AD4 +AD4 changing +ACI-bool X:1+ACI into +ACI-u8 X:1+ACI will reduce performance on architectures that
+AD4 +AD4 cannot do byte addressing.
+AD4
+AD4 I generally agree. But the checkpatch warning +AF8-could+AF8
+AD4 be useful in those cases where alignment should be
+AD4 architecture-independent.
+AD4
+AD4 Any suggestion on how to improve the message?

It would be great if a heuristic could be developed that recognizes structs
for which the data layout must be architecture independent. If such a
heuristic could be developed it could be used to only display warn about
+ACI-bool X:n+ACI for such structures.

Bart.