linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vitor Massaru Iha <vitor@massaru.org>
To: sfr@canb.auug.org.au, skhan@linuxfoundation.org,
	brendanhiggins@google.com, kunit-dev@googlegroups.com,
	johannes@sipsolutions.net
Cc: linux-kernel@vger.kernel.org, linux-next@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH] lib: kunit: Fix compilation test when using TEST_BIT_FIELD_COMPILE
Date: Thu, 15 Oct 2020 09:08:51 -0300	[thread overview]
Message-ID: <20201015120851.229242-1-vitor@massaru.org> (raw)

A build condition was missing around a compilation test, this compilation
test comes from the original test_bitfield code.

And removed unnecessary code for this test.

Fixes: d2585f5164c2 ("lib: kunit: add bitfield test conversion to KUnit")
Signed-off-by: Vitor Massaru Iha <vitor@massaru.org>
Link: https://lore.kernel.org/linux-next/20201015163056.56fcc835@canb.auug.org.au/
---
 lib/bitfield_kunit.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/bitfield_kunit.c b/lib/bitfield_kunit.c
index d63a2be5aff8..1473d8b4bf0f 100644
--- a/lib/bitfield_kunit.c
+++ b/lib/bitfield_kunit.c
@@ -125,7 +125,7 @@ static void __init test_bitfields_variables(struct kunit *context)
 	CHECK(u64, 0x0000001f8000000ull);
 }
 
-
+#ifdef TEST_BITFIELD_COMPILE
 static void __init test_bitfields_compile(struct kunit *context)
 {
 	/* these should fail compilation */
@@ -135,13 +135,11 @@ static void __init test_bitfields_compile(struct kunit *context)
 	/* this should at least give a warning */
 	u16_encode_bits(0, 0x60000);
 }
+#endif
 
 static struct kunit_case __refdata bitfields_test_cases[] = {
 	KUNIT_CASE(test_bitfields_constants),
 	KUNIT_CASE(test_bitfields_variables),
-#ifdef TEST_BITFIELD_COMPILE
-	KUNIT_CASE(test_bitfields_compile),
-#endif
 	{}
 };
 

base-commit: d2585f5164c298aaaed14c2c8d313cbe7bd5b253
-- 
2.26.2


             reply	other threads:[~2020-10-15 12:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15 12:08 Vitor Massaru Iha [this message]
2020-10-16 18:42 ` [PATCH] lib: kunit: Fix compilation test when using TEST_BIT_FIELD_COMPILE Brendan Higgins
2020-10-16 19:31   ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201015120851.229242-1-vitor@massaru.org \
    --to=vitor@massaru.org \
    --cc=brendanhiggins@google.com \
    --cc=johannes@sipsolutions.net \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).