drm/panel-edp: Add STA 116QHD024002
[drm/drm-misc.git] / include / kunit / visibility.h
blob7c34c8ffcf3b2378054db6e2148c2389b3d75111
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * KUnit API to allow symbols to be conditionally visible during KUnit
4 * testing
6 * Copyright (C) 2022, Google LLC.
7 * Author: Rae Moar <rmoar@google.com>
8 */
10 #ifndef _KUNIT_VISIBILITY_H
11 #define _KUNIT_VISIBILITY_H
13 #if IS_ENABLED(CONFIG_KUNIT)
14 /**
15 * VISIBLE_IF_KUNIT - A macro that sets symbols to be static if
16 * CONFIG_KUNIT is not enabled. Otherwise if CONFIG_KUNIT is enabled
17 * there is no change to the symbol definition.
19 #define VISIBLE_IF_KUNIT
20 /**
21 * EXPORT_SYMBOL_IF_KUNIT(symbol) - Exports symbol into
22 * EXPORTED_FOR_KUNIT_TESTING namespace only if CONFIG_KUNIT is
23 * enabled. Must use MODULE_IMPORT_NS("EXPORTED_FOR_KUNIT_TESTING")
24 * in test file in order to use symbols.
25 * @symbol: the symbol identifier to export
27 #define EXPORT_SYMBOL_IF_KUNIT(symbol) EXPORT_SYMBOL_NS(symbol, "EXPORTED_FOR_KUNIT_TESTING")
28 #else
29 #define VISIBLE_IF_KUNIT static
30 #define EXPORT_SYMBOL_IF_KUNIT(symbol)
31 #endif
33 #endif /* _KUNIT_VISIBILITY_H */