Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1080b38d authored by Juergen Gross's avatar Juergen Gross
Browse files

xen: make use of xenbus_read_unsigned() in xen-scsifront



Use xenbus_read_unsigned() instead of xenbus_scanf() when possible.

Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
Acked-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
parent 58faf07b
Loading
Loading
Loading
Loading
+1 −5
Original line number Original line Diff line number Diff line
@@ -1060,13 +1060,9 @@ static void scsifront_read_backend_params(struct xenbus_device *dev,
					  struct vscsifrnt_info *info)
					  struct vscsifrnt_info *info)
{
{
	unsigned int sg_grant, nr_segs;
	unsigned int sg_grant, nr_segs;
	int ret;
	struct Scsi_Host *host = info->host;
	struct Scsi_Host *host = info->host;


	ret = xenbus_scanf(XBT_NIL, dev->otherend, "feature-sg-grant", "%u",
	sg_grant = xenbus_read_unsigned(dev->otherend, "feature-sg-grant", 0);
			   &sg_grant);
	if (ret != 1)
		sg_grant = 0;
	nr_segs = min_t(unsigned int, sg_grant, SG_ALL);
	nr_segs = min_t(unsigned int, sg_grant, SG_ALL);
	nr_segs = max_t(unsigned int, nr_segs, VSCSIIF_SG_TABLESIZE);
	nr_segs = max_t(unsigned int, nr_segs, VSCSIIF_SG_TABLESIZE);
	nr_segs = min_t(unsigned int, nr_segs,
	nr_segs = min_t(unsigned int, nr_segs,