drm/xe: Fix compilation without CONFIG_KUNIT
Subsystems (2)
PATCH 1/1 drm/xe: Fix compilation without CONFIG_KUNIT
It looks that declaration of kunit_get_current_test() was available in xe_guc_relay.c only with CONFIG_KUNIT enabled. If CONFIG_KUNIT is disabled we fail with:
In file included from ../include/linux/build_bug.h:5,
from ../include/linux/bitfield.h:10,
from ../drivers/gpu/drm/xe/xe_guc_relay.c:6:
../drivers/gpu/drm/xe/xe_guc_relay.c: In function ‘xe_guc_relay_process_guc2vf’:
../drivers/gpu/drm/xe/xe_guc_relay.c:863:52: error: implicit declaration of function ‘kunit_get_current_test’ [-Werror=implicit-function-declaration]
863 | if (unlikely(!IS_SRIOV_VF(relay_to_xe(relay)) && !kunit_get_current_test()))
| ^~~~~~~~~~~~~~~~~~~~~~../include/linux/compiler.h:77:42: note: in definition of macro ‘unlikely’
77 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
--- drivers/gpu/drm/xe/xe_guc_relay.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/xe/xe_guc_relay.c +1 -0
@@ -9,6 +9,7 @@#include <drm/drm_managed.h> #include <kunit/static_stub.h> +#include <kunit/test-bug.h> #include "abi/guc_actions_sriov_abi.h" #include "abi/guc_relay_actions_abi.h"
Signature · 1 line
2.25.1
Quoted 11 lines · Michal Wajdeczko
It looks that declaration of
kunit_get_current_test()was available inxe_guc_relay.conly withCONFIG_KUNITenabled. IfCONFIG_KUNITis disabled we fail with:In file included from
../include/linux/build_bug.h:5,from ../include/linux/bitfield.h:10, from ../drivers/gpu/drm/xe/xe_guc_relay.c:6: ../drivers/gpu/drm/xe/xe_guc_relay.c: In function ‘xe_guc_relay_process_guc2vf’: ../drivers/gpu/drm/xe/xe_guc_relay.c:863:52: error: implicit declaration of function ‘kunit_get_current_test’ [-Werror=implicit-function-declaration] 863 | if (unlikely(!IS_SRIOV_VF(relay_to_xe(relay)) && !kunit_get_current_test())) | ^~~~~~~~~~~~~~~~~~~~~~
Quoted 4 lines
../include/linux/compiler.h:77:42: note: in definition of macro ‘unlikely’
77 | # define unlikely(x)__builtin_expect(!!(x), 0)
| ^
Quoted 19 lines
Reported-by Mika Kuoppala <[email protected]>Fixes 9a2c2ecb1b77 ("drm/xe/guc: Introduce Relay Communication for SR-IOV")Signed-off-by Michal Wajdeczko <[email protected]>--- drivers/gpu/drm/xe/xe_guc_relay.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/xe/xe_guc_relay.c +1
-0@@ -9,6 +9,7 @@#include <drm/drm_managed.h> #include <kunit/static_stub.h> +#include <kunit/test-bug.h> #include "abi/guc_actions_sriov_abi.h" #include "abi/guc_relay_actions_abi.h"
Quoted 27 lines · Michal Wajdeczko
It looks that declaration of
kunit_get_current_test()was available inxe_guc_relay.conly withCONFIG_KUNITenabled. IfCONFIG_KUNITis disabled we fail with:In file included from
../include/linux/build_bug.h:5,from ../include/linux/bitfield.h:10, from ../drivers/gpu/drm/xe/xe_guc_relay.c:6: ../drivers/gpu/drm/xe/xe_guc_relay.c: In function ‘xe_guc_relay_process_guc2vf’: ../drivers/gpu/drm/xe/xe_guc_relay.c:863:52: error: implicit declaration of function ‘kunit_get_current_test’ [-Werror=implicit-function-declaration] 863 | if (unlikely(!IS_SRIOV_VF(relay_to_xe(relay)) && !kunit_get_current_test())) | ^~~~~~~~~~~~~~~~~~~~~~ ../include/linux/compiler.h:77:42: note: in definition of macro ‘unlikely’ 77 | # define unlikely(x) __builtin_expect(!!(x), 0) | ^Reported-by Mika Kuoppala <[email protected]>Fixes 9a2c2ecb1b77 ("drm/xe/guc: Introduce Relay Communication for SR-IOV")Signed-off-by Michal Wajdeczko <[email protected]>--- drivers/gpu/drm/xe/xe_guc_relay.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/xe/xe_guc_relay.c +0
-0
drivers/gpu/drm/xe/xe_guc_relay.c line 12
Quoted 4 lines
drivers/gpu/drm/xe/xe_guc_relay.c +1
-0@@ -9,6 +9,7 @@#include <drm/drm_managed.h> #include <kunit/static_stub.h> +#include <kunit/test-bug.h>
Compile works with this fix-
Quoted 3 lines
drivers/gpu/drm/xe/xe_guc_relay.c +0
-0#include "abi/guc_actions_sriov_abi.h" #include "abi/guc_relay_actions_abi.h"
Patchwork
CI✗ CI.Patch_applied: failure for drm/xe: Fix compilation without CONFIG_KUNIT
In reply to Michal Wajdeczko== Series Details ==
== Series Details ==
Series: drm/xe: Fix compilation without CONFIG_KUNIT
URL : https://patchwork.freedesktop.org/series/128273/
State : failure
== Summary ==
=== Applying kernel patches on branch 'drm-xe-next' with base: === Base commit: cca0607b6 drm/xe: Fix compilation without CONFIG_KUNIT === git am output follows ===
error: patch failed: drivers/gpu/drm/xe/xe_guc_relay.c:9
error: drivers/gpu/drm/xe/xe_guc_relay.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch
Applying: drm/xe: Fix compilation without CONFIG_KUNIT
Patch failed at 0001 drm/xe: Fix compilation without CONFIG_KUNIT When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".
Patchwork
CI✗ CI.Patch_applied: failure for drm/xe: Fix compilation without CONFIG_KUNIT
In reply to Michal Wajdeczko== Series Details ==
== Series Details ==
Series: drm/xe: Fix compilation without CONFIG_KUNIT
URL : https://patchwork.freedesktop.org/series/128273/
State : failure
== Summary ==
=== Applying kernel patches on branch 'drm-xe-next' with base: === Base commit: cca0607b6 drm/xe: Fix compilation without CONFIG_KUNIT === git am output follows ===
error: patch failed: drivers/gpu/drm/xe/xe_guc_relay.c:9
error: drivers/gpu/drm/xe/xe_guc_relay.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch
Applying: drm/xe: Fix compilation without CONFIG_KUNIT
Patch failed at 0001 drm/xe: Fix compilation without CONFIG_KUNIT When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".
Quoted 11 lines · Michal Wajdeczko
It looks that declaration of
kunit_get_current_test()was available inxe_guc_relay.conly withCONFIG_KUNITenabled. IfCONFIG_KUNITis disabled we fail with:In file included from
../include/linux/build_bug.h:5,from ../include/linux/bitfield.h:10, from ../drivers/gpu/drm/xe/xe_guc_relay.c:6: ../drivers/gpu/drm/xe/xe_guc_relay.c: In function ‘xe_guc_relay_process_guc2vf’: ../drivers/gpu/drm/xe/xe_guc_relay.c:863:52: error: implicit declaration of function ‘kunit_get_current_test’ [-Werror=implicit-function-declaration] 863 | if (unlikely(!IS_SRIOV_VF(relay_to_xe(relay)) && !kunit_get_current_test())) | ^~~~~~~~~~~~~~~~~~~~~~
Quoted 6 lines
../include/linux/compiler.h:77:42: note: in definition of macro ‘unlikely’
77 | # define unlikely(x)__builtin_expect(!!(x), 0)
| ^Reported-by Mika Kuoppala <[email protected]>Fixes 9a2c2ecb1b77 ("drm/xe/guc: Introduce Relay Communication for SR-IOV")
kernel test robot says problem was introduces by other patch, so it should rather be:
and since it's already merged, also for the record:
Closes:
https://lore.kernel.org/oe-kbuild-all/[email protected]/
Quoted 17 lines
Signed-off-by Michal Wajdeczko <[email protected]>--- drivers/gpu/drm/xe/xe_guc_relay.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/xe/xe_guc_relay.c +1
-0@@ -9,6 +9,7 @@#include <drm/drm_managed.h> #include <kunit/static_stub.h> +#include <kunit/test-bug.h> #include "abi/guc_actions_sriov_abi.h" #include "abi/guc_relay_actions_abi.h"