Re: [PATCH v7 11/22] s390: vfio-ap: sysfs interfaces to configure domains

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 26 Jul 2018 21:54:18 +0200
Christian Borntraeger <borntraeger@xxxxxxxxxx> wrote:


> +static ssize_t assign_domain_store(struct device *dev,
> +				   struct device_attribute *attr,
> +				   const char *buf, size_t count)
> +{
> +	int ret;
> +	unsigned long apqi;
> +	struct mdev_device *mdev = mdev_from_dev(dev);
> +	struct ap_matrix_mdev *matrix_mdev = mdev_get_drvdata(mdev);
> +	unsigned long max_apqi = matrix_mdev->matrix.aqm_max;
> +
> +	ret = kstrtoul(buf, 0, &apqi);
> +	if (ret || (apqi > max_apqi)) {
> +		pr_warn("%s: %s: domain id '%s' not a value from 0 to %02lu(%#04lx)\n",
> +		       VFIO_AP_MODULE_NAME, __func__, buf, max_apqi, max_apqi);

I have the same comments regarding messages and checking as for the
previous patch.

> +
> +		if (!ret)
> +			ret = -EINVAL;
> +
> +		return ret;
> +	}
> +
> +	/* Set the bit in the AQM (bitmask) corresponding to the AP domain
> +	 * number (APQI). The bits in the mask, from most significant to least
> +	 * significant, correspond to numbers 0-255.
> +	 */
> +	mutex_lock(&matrix_dev.lock);
> +	set_bit_inv(apqi, matrix_mdev->matrix.aqm);
> +	ret = count;
> +
> +	mutex_unlock(&matrix_dev.lock);
> +
> +	return ret;
> +}
> +DEVICE_ATTR_WO(assign_domain);
--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux