Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/xe/pf: Simplify IS_SRIOV_PF macro

Instead of two having variants of the IS_SRIOV_PF macro, move the
CONFIG_PCI_IOV check to the xe_device_is_sriov_pf() function and
let the compiler optimize that. This will help us drop poor man's
type check of the macro parameter that fails on const xe pointer.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Shuicheng Lin <shuicheng.lin@intel.com>
Link: https://patch.msgid.link/20260128222714.3056-1-michal.wajdeczko@intel.com

+2 -5
+2 -5
drivers/gpu/drm/xe/xe_sriov.h
··· 28 28 29 29 static inline bool xe_device_is_sriov_pf(const struct xe_device *xe) 30 30 { 31 - return xe_device_sriov_mode(xe) == XE_SRIOV_MODE_PF; 31 + return IS_ENABLED(CONFIG_PCI_IOV) && 32 + xe_device_sriov_mode(xe) == XE_SRIOV_MODE_PF; 32 33 } 33 34 34 35 static inline bool xe_device_is_sriov_vf(const struct xe_device *xe) ··· 37 36 return xe_device_sriov_mode(xe) == XE_SRIOV_MODE_VF; 38 37 } 39 38 40 - #ifdef CONFIG_PCI_IOV 41 39 #define IS_SRIOV_PF(xe) xe_device_is_sriov_pf(xe) 42 - #else 43 - #define IS_SRIOV_PF(xe) (typecheck(struct xe_device *, (xe)) && false) 44 - #endif 45 40 #define IS_SRIOV_VF(xe) xe_device_is_sriov_vf(xe) 46 41 47 42 #define IS_SRIOV(xe) (IS_SRIOV_PF(xe) || IS_SRIOV_VF(xe))