/* Check that the effect_id is a valid effect and whether the user is the owner  */
static int check_effect_access(struct ff_device *ff, int effect_id, struct file *file)
/* Check that the effect_id is a valid effect and whether the user is the owner  */
static int check_effect_access(struct ff_device *ff, int effect_id, struct file *file)
{
	if (effect_id < 0 || effect_id >= ff->max_effects ||
	    !ff->effect_owners[effect_id])
		return -EINVAL;
	if (file && ff->effect_owners[effect_id] != file)
		return -EACCES;
	return 0;
}