> +The cast will cause truncation of large values, so this might be a nop.
> +If you really want to check, then something like:

> +     unsigned long evdev_id;
> +     char *endp;

> +     evdev_id = strtoul(list, &endp, 0);
> +     if (!*list || !*endp || evdev_id >= RTE_EVENT_MAX_DEVS) {
> +         fprintf(stderr, "Invalid eventdev id: %s\n", list);
> +         return -EINVAL;
> +     }

Thanks Stephen, you are right it will truncate large values, RTE_EVENT_MAX_DEVS 
is 16, so I thought
Uint8_t is enough to hold the id. I am not sure if we will have a large number 
of evdevs, so ids.

But your suggestion seems better I will change it.

Reply via email to