drm/xe/xe_late_bind_fw: Fix and simplify parsing user input

Code was wrongly passing sizeof(uval) as the number base to use,
and unlike other debugfs entries that represent bool data, it
wasn't using the dedicated function to parse user input as bool.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Badal Nilawar <badal.nilawar@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Link: https://lore.kernel.org/r/20251002192736.203186-1-michal.wajdeczko@intel.com
This commit is contained in:
Michal Wajdeczko 2025-10-02 21:27:36 +02:00
parent 869580c415
commit 71f1939e0d

View File

@ -349,17 +349,14 @@ static ssize_t disable_late_binding_set(struct file *f, const char __user *ubuf,
{
struct xe_device *xe = file_inode(f)->i_private;
struct xe_late_bind *late_bind = &xe->late_bind;
u32 uval;
ssize_t ret;
bool val;
int ret;
ret = kstrtouint_from_user(ubuf, size, sizeof(uval), &uval);
ret = kstrtobool_from_user(ubuf, size, &val);
if (ret)
return ret;
if (uval > 1)
return -EINVAL;
late_bind->disable = !!uval;
late_bind->disable = val;
return size;
}