aboutsummaryrefslogtreecommitdiffstats
path: root/lib/notifier-error-inject.c
diff options
context:
space:
mode:
authorDaniel Latypov <dlatypov@google.com>2022-09-30 17:26:35 -0700
committerShuah Khan <skhan@linuxfoundation.org>2022-10-07 10:16:38 -0600
commita8495ad8e973cb6aabbe855d3dfb66ec4c9b281a (patch)
tree01df61328151879a83ecef8445c4dd4f0be0413a /lib/notifier-error-inject.c
parent3c4fc7bf4c9e66fe71abcbf93f62f4ddb89b7f15 (diff)
downloadlinux-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/notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions