[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <778b1eb5-3f46-2489-4de8-17fda15d3dd5@gmail.com>
Date: Fri, 3 Dec 2021 10:01:46 -0700
From: David Ahern <dsahern@...il.com>
To: Parav Pandit <parav@...dia.com>, stephen@...workplumber.org,
netdev@...r.kernel.org
Cc: virtualization@...ts.linux-foundation.org, mst@...hat.com,
jasowang@...hat.com
Subject: Re: [iproute2-next 4/4] vdpa: Enable user to set mtu of the vdpa
device
On 12/1/21 9:22 PM, Parav Pandit wrote:
> @@ -154,6 +156,31 @@ static int vdpa_argv_mac(struct vdpa *vdpa, int argc, char **argv, char *mac)
> return 0;
> }
>
> +static int strtouint16_t(const char *str, uint16_t *p_val)
> +{
> + char *endptr;
> + unsigned long int val;
> +
> + val = strtoul(str, &endptr, 10);
> + if (endptr == str || *endptr != '\0')
> + return -EINVAL;
> + if (val > USHRT_MAX)
> + return -ERANGE;
> + *p_val = val;
> + return 0;
> +}
duplicates get_u16
Powered by blists - more mailing lists