scripts: conftest: Fix test for __alloc_disk_node

The test to see if the function __alloc_disk_node() has the 'lkclass'
argument is not working as expected and so builds for Linux v5.18 and
Linux v5.19 are failing. The problem is that the type 'NULL' is not
defined and so the test always fails. Fix this by using the
'lock_class_key' type and including the appropriate headers.

Bug 4221847

Change-Id: I6b3d6987d0d3250f00c27c586d6a971a3dceac59
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2994321
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jon Hunter
2023-10-10 09:54:39 +01:00
committed by mobile promotions
parent 51d4ae99d9
commit e6fddfc5f6

View File

@@ -6339,10 +6339,11 @@ compile_test() {
# __alloc_disk_node() function.
#
CODE="
#include <linux/genhd.h>
#include <linux/blkdev.h>
#include <linux/lockdep_types.h>
struct gendisk *conftest___alloc_disk_node_has_lkclass_arg(
struct request_queue *q) {
return __alloc_disk_node(q, 0, NULL);
struct request_queue *q, struct lock_class_key *lkclass) {
return __alloc_disk_node(q, 0, lkclass);
}"
compile_check_conftest "$CODE" "NV___ALLOC_DISK_NODE_HAS_LKCLASS_ARG" "" "types"