From: "Ye, MingjinX" <mingjinx.ye@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [RFC] net/ice: add devargs to control link update
Date: Wed, 23 Oct 2024 07:17:43 +0000 [thread overview]
Message-ID: <LV3PR11MB8601B1999EA88A183DBCC979E54D2@LV3PR11MB8601.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20241022082322.44e0004b@hermes.local>
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Tuesday, October 22, 2024 11:23 PM
> To: Ye, MingjinX <mingjinx.ye@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [RFC] net/ice: add devargs to control link update
>
> On Tue, 22 Oct 2024 06:20:43 +0000
> Mingjin Ye <mingjinx.ye@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.
Thank you. Good suggestion.
prev parent reply other threads:[~2024-10-23 7:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-22 6:20 Mingjin Ye
2024-10-22 6:38 ` [RFC v2] " Mingjin Ye
2024-10-22 15:23 ` [RFC] " Stephen Hemminger
2024-10-23 7:17 ` Ye, MingjinX [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=LV3PR11MB8601B1999EA88A183DBCC979E54D2@LV3PR11MB8601.namprd11.prod.outlook.com \
--to=mingjinx.ye@intel.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).