···17581758 /* Synchronize the kthread start. */17591759 lockdep_assert_console_list_lock_held();1760176017611761- /* The write_thread() callback is mandatory. */17621762- if (WARN_ON(!con->write_thread))17611761+ /* Check for mandatory nbcon callbacks. */17621762+ if (WARN_ON(!con->write_thread ||17631763+ !con->device_lock ||17641764+ !con->device_unlock)) {17631765 return false;17661766+ }1764176717651768 rcuwait_init(&con->rcuwait);17661769 init_irq_work(&con->irq_work, nbcon_irq_work);
+11-9
lib/tests/printf_kunit.c
···266266 KUNIT_EXPECT_MEMNEQ(kunittest, buf, PTR_STR, PTR_WIDTH);267267}268268269269-static void270270-test_hashed(struct kunit *kunittest, const char *fmt, const void *p)271271-{272272- char buf[PLAIN_BUF_SIZE];273273-274274- plain_hash_to_buffer(kunittest, p, buf, PLAIN_BUF_SIZE);275275-276276- test(buf, fmt, p);277277-}269269+/*270270+ * This is a macro so that the compiler can compare its arguments to the271271+ * __printf() attribute on __test(). This cannot be a function with a __printf()272272+ * attribute because GCC requires __printf() functions to be variadic.273273+ */274274+#define test_hashed(kunittest, fmt, p) \275275+ do { \276276+ char buf[PLAIN_BUF_SIZE]; \277277+ plain_hash_to_buffer(kunittest, p, buf, PLAIN_BUF_SIZE); \278278+ test(buf, fmt, p); \279279+ } while (0)278280279281/*280282 * NULL pointers aren't hashed.