diff options
author | Daniel Latypov <dlatypov@google.com> | 2022-09-30 17:26:35 -0700 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2022-10-07 10:16:38 -0600 |
commit | a8495ad8e973cb6aabbe855d3dfb66ec4c9b281a (patch) | |
tree | 01df61328151879a83ecef8445c4dd4f0be0413a /lib/siphash.c | |
parent | 3c4fc7bf4c9e66fe71abcbf93f62f4ddb89b7f15 (diff) | |
download | linux-a8495ad8e973cb6aabbe855d3dfb66ec4c9b281a.tar.gz |
kunit: remove format func from struct kunit_assert, get it to 0 bytes
Each calll to a KUNIT_EXPECT_*() macro creates a local variable which
contains a struct kunit_assert.
Normally, we'd hope the compiler would be able to optimize this away,
but we've seen cases where it hasn't, see
https://groups.google.com/g/kunit-dev/c/i3fZXgvBrfA/m/GbrMNej2BAAJ.
In changes like commit 21957f90b28f ("kunit: split out part of
kunit_assert into a static const"), we've moved more and more parts out
of struct kunit_assert and its children types (kunit_binary_assert).
This patch removes the final field and gets us to:
sizeof(struct kunit_assert) == 0
sizeof(struct kunit_binary_assert) == 24 (on UML x86_64).
This also reduces the amount of macro plumbing going on at the cost of
passing in one more arg to the base KUNIT_ASSERTION macro and
kunit_do_failed_assertion().
Signed-off-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'lib/siphash.c')
0 files changed, 0 insertions, 0 deletions