Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1897e8f3 authored by Daniel Vetter's avatar Daniel Vetter Committed by Jonathan Corbet
Browse files

doc: botching-up-ioctls: Make it clearer why structs must be padded



This came up in discussions when reviewing drm patches.

Reviewed-by: default avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent c9161088
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -73,7 +73,9 @@ will have a second iteration or at least an extension for any given interface.
   future extensions is going right down the gutters since someone will submit
   an ioctl struct with random stack garbage in the yet unused parts. Which
   then bakes in the ABI that those fields can never be used for anything else
   but garbage.
   but garbage. This is also the reason why you must explicitly pad all
   structures, even if you never use them in an array - the padding the compiler
   might insert could contain garbage.

 * Have simple testcases for all of the above.