Revision e8812acb5bf724f2fc23a500e590c776ebda7b0a authored by Rob Herring on 18 July 2023, 14:32:26 UTC, committed by Helge Deller on 20 July 2023, 05:56:30 UTC
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 9d5651a
Raw File
is_signed_type_kunit.c
// SPDX-License-Identifier: GPL-2.0 OR MIT
/*
 *	./tools/testing/kunit/kunit.py run is_signed_type [--raw_output]
 */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <kunit/test.h>
#include <linux/compiler.h>

enum unsigned_enum {
	constant_a = 3,
};

enum signed_enum {
	constant_b = -1,
	constant_c = 2,
};

static void is_signed_type_test(struct kunit *test)
{
	KUNIT_EXPECT_EQ(test, is_signed_type(bool), false);
	KUNIT_EXPECT_EQ(test, is_signed_type(signed char), true);
	KUNIT_EXPECT_EQ(test, is_signed_type(unsigned char), false);
	KUNIT_EXPECT_EQ(test, is_signed_type(char), false);
	KUNIT_EXPECT_EQ(test, is_signed_type(int), true);
	KUNIT_EXPECT_EQ(test, is_signed_type(unsigned int), false);
	KUNIT_EXPECT_EQ(test, is_signed_type(long), true);
	KUNIT_EXPECT_EQ(test, is_signed_type(unsigned long), false);
	KUNIT_EXPECT_EQ(test, is_signed_type(long long), true);
	KUNIT_EXPECT_EQ(test, is_signed_type(unsigned long long), false);
	KUNIT_EXPECT_EQ(test, is_signed_type(enum unsigned_enum), false);
	KUNIT_EXPECT_EQ(test, is_signed_type(enum signed_enum), true);
	KUNIT_EXPECT_EQ(test, is_signed_type(void *), false);
	KUNIT_EXPECT_EQ(test, is_signed_type(const char *), false);
}

static struct kunit_case is_signed_type_test_cases[] = {
	KUNIT_CASE(is_signed_type_test),
	{}
};

static struct kunit_suite is_signed_type_test_suite = {
	.name = "is_signed_type",
	.test_cases = is_signed_type_test_cases,
};

kunit_test_suite(is_signed_type_test_suite);

MODULE_LICENSE("Dual MIT/GPL");
back to top