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 _______________________________________________ Virtualization mailing list Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linuxfoundation.org/mailman/listinfo/virtualization