drm/amdkfd: Fix the shift-out-of-bounds warning
PATCH v2 1/1 drm/amdkfd: Fix the shift-out-of-bounds warning
There is shift-out-of-bounds warning following if ecode=0.
"shift exponent 4294967295 is too large for 64-bit type 'long long unsigned int'"
Signed-off-by Ma Jun <[email protected]>
Suggested-by Felix Kuehling <[email protected]>
--- include/uapi/linux/kfd_ioctl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/kfd_ioctl.h +1 -1
@@ -1004,7 +1004,7 @@ enum kfd_dbg_trap_exception_code { };/* Mask generated by ecode in kfd_dbg_trap_exception_code */ -#define KFD_EC_MASK (ecode) (1ULL << (ecode - 1)) +#define KFD_EC_MASK (ecode) ((ecode) ? 1ULL << (ecode - 1) : 0ULL)/* Masks for exception code type checks below */ #define KFD_EC_MASK_QUEUE (KFD_EC_MASK(EC_QUEUE_WAVE_ABORT) | \
Signature · 1 line
2.34.1