Skip to content

Commit e157f0f

Browse files
committed
drm/xe: Fix build without CONFIG_FAULT_INJECTION
Ideally this header could be included without the CONFIG_FAULT_INJECTION and it would take care itself for the includes it needs. So, let's temporary workaround this by moving this below and including only when CONFIG_FAULT_INJECTION is selected to avoid build breakages. Another solution would be us including the linux/types.h as well, but this creates unnecessary cases. Reference: https://lore.kernel.org/all/20230816134748.979231-1-himal.prasad.ghimiray@intel.com/ Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Cc: Oded Gabbay <ogabbay@kernel.org> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
1 parent d9e4117 commit e157f0f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/gpu/drm/xe/xe_debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
#include "xe_debugfs.h"
77

8-
#include <linux/fault-inject.h>
98
#include <linux/string_helpers.h>
109

1110
#include <drm/drm_debugfs.h>
@@ -22,6 +21,7 @@
2221
#endif
2322

2423
#ifdef CONFIG_FAULT_INJECTION
24+
#include <linux/fault-inject.h> /* XXX: fault-inject.h is broken */
2525
DECLARE_FAULT_ATTR(gt_reset_failure);
2626
#endif
2727

drivers/gpu/drm/xe/xe_gt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#define _XE_GT_H_
88

99
#include <drm/drm_util.h>
10-
#include <linux/fault-inject.h>
1110

1211
#include "xe_device_types.h"
1312
#include "xe_hw_engine.h"
@@ -20,6 +19,7 @@
2019
#define CCS_MASK(gt) (((gt)->info.engine_mask & XE_HW_ENGINE_CCS_MASK) >> XE_HW_ENGINE_CCS0)
2120

2221
#ifdef CONFIG_FAULT_INJECTION
22+
#include <linux/fault-inject.h> /* XXX: fault-inject.h is broken */
2323
extern struct fault_attr gt_reset_failure;
2424
static inline bool xe_fault_inject_gt_reset(void)
2525
{

0 commit comments

Comments
 (0)