[RFC] net/ice: add devargs to control link update
Stephen Hemminger
stephen at networkplumber.org
Tue Oct 22 17:23:22 CEST 2024
On Tue, 22 Oct 2024 06:20:43 +0000
Mingjin Ye <mingjinx.ye at intel.com> wrote:
> +static int
> +ice_parse_clean_subtask_period(__rte_unused const char *key,
> + const char *value, void *args)
> +{
> + int *num = (int *)args;
Cast of void * unnecessary in C.
You probably want period to be unsigned not signed.
> + int tmp;
> +
> + errno = 0;
> + tmp = atoi(value);
> + if (tmp < 0) {
> + PMD_DRV_LOG(WARNING, "%s: \"%s\" is not greater than or equal to zero",
> + key, value);
> + return -1;
> + }
> +
> + *num = tmp;
> +
> + return 0;
> +}
Prefer strtoul() when parsing values, it allows for better error handling.
More information about the dev
mailing list