diff options
| author | Jason Ekstrand <[email protected]> | 2021-07-08 10:48:25 -0500 |
|---|---|---|
| committer | Daniel Vetter <[email protected]> | 2021-07-08 19:47:31 +0200 |
| commit | def25b7bc342d7eb6643408300127404608d3df2 (patch) | |
| tree | c40539b36ea38f63267adea0f58152e54ac3b23e /tools/perf/scripts/python/exported-sql-viewer.py | |
| parent | bc2ceb7a08758357ed2ff1d876dc9d60bdefb080 (diff) | |
drm/i915/gem: Make an alignment check more sensible
What we really want to check is that size of the engines array, i.e.
args->size - sizeof(*user) is divisible by the element size, i.e.
sizeof(*user->engines) because that's what's required for computing the
array length right below the check. However, we're currently not doing
this and instead doing a compile-time check that sizeof(*user) is
divisible by sizeof(*user->engines) and avoiding the subtraction. As
far as I can tell, the only reason for the more confusing pair of checks
is to avoid a single subtraction of a constant.
The other thing the BUILD_BUG_ON might be trying to implicitly check is
that offsetof(user->engines) == sizeof(*user) and we don't have any
weird padding throwing us off. However, that's not the check it's doing
and it's not even a reliable way to do that check.
Signed-off-by: Jason Ekstrand <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions