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
{
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;
}