Commit 71f1939e authored by Michal Wajdeczko's avatar Michal Wajdeczko
Browse files

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: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Badal Nilawar <badal.nilawar@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: default avatarJonathan Cavitt <jonathan.cavitt@intel.com>
Link: https://lore.kernel.org/r/20251002192736.203186-1-michal.wajdeczko@intel.com
parent 869580c4
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -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;
}