public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: linux-s390@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH v7 11/22] s390: vfio-ap: sysfs interfaces to configure domains
Date: Mon, 30 Jul 2018 13:19:37 +0000	[thread overview]
Message-ID: <20180730151937.56e7c3f5.cohuck@redhat.com> (raw)
In-Reply-To: <20180726195429.31960-12-borntraeger@de.ibm.com>

On Thu, 26 Jul 2018 21:54:18 +0200
Christian Borntraeger <borntraeger@de.ibm.com> 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);

           reply	other threads:[~2018-07-30 13:19 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20180726195429.31960-12-borntraeger@de.ibm.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180730151937.56e7c3f5.cohuck@redhat.com \
    --to=cohuck@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox