qemu-s390x
[Top][All Lists]
Advanced

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

Re: [qemu-s390x] [RFC 08/19] s390/zcrypt: support for assigning adapters


From: Cornelia Huck
Subject: Re: [qemu-s390x] [RFC 08/19] s390/zcrypt: support for assigning adapters to matrix mdev
Date: Fri, 17 Nov 2017 10:50:27 +0100

On Thu, 16 Nov 2017 18:53:07 -0500
Tony Krowiak <address@hidden> wrote:

> On 11/14/2017 08:22 AM, Cornelia Huck wrote:
> > On Fri, 13 Oct 2017 13:38:53 -0400
> > Tony Krowiak <address@hidden> wrote:

> >> +static ssize_t ap_matrix_adapters_assign(struct device *dev,
> >> +                                   struct device_attribute *attr,
> >> +                                   const char *buf, size_t count)
> >> +{
> >> +  int ret;
> >> +  unsigned int apid;
> >> +  struct mdev_device *mdev = mdev_from_dev(dev);
> >> +  struct ap_matrix_mdev *matrix_mdev = mdev_get_drvdata(mdev);
> >> +
> >> +  ret = ap_matrix_parse_id(buf, &apid);  
> I'm going to replace this with a call to kstrtouint (buf, 0, &apid). This
> will allow the user to enter the adapter ID string using conventional
> semantics - e.g., 71 or  0x47 - and the function will determine if the
> value is valid.

Using an existing interface sounds good.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]