From: Jakub Kicinski <kuba@kernel•org>
To: David Wei <dw@davidwei•uk>
Cc: netdev@vger•kernel.org, "David S. Miller" <davem@davemloft•net>,
Eric Dumazet <edumazet@google•com>,
Paolo Abeni <pabeni@redhat•com>
Subject: Re: [PATCH net-next 1/3] netdevsim: allow two netdevsim ports to be
Date: Fri, 8 Dec 2023 09:58:17 -0800 [thread overview]
Message-ID: <20231208095817.5aa69755@kernel.org> (raw)
In-Reply-To: <20231207172117.3671183-2-dw@davidwei.uk>
On Thu, 7 Dec 2023 09:21:15 -0800 David Wei wrote:
> + ret = copy_from_user(buf, data, count);
> + if (ret)
> + return -EFAULT;
> + buf[count] = '\0';
> +
> + cur = buf;
> + token = strsep(&cur, " ");
> + if (!token)
> + return -EINVAL;
> + ret = kstrtouint(token, 10, &id);
> + if (ret)
> + return ret;
> +
> + token = strsep(&cur, " ");
> + if (!token)
> + return -EINVAL;
> + ret = kstrtouint(token, 10, &port);
> + if (ret)
> + return ret;
> +
> + /* too many args */
> + if (strsep(&cur, " "))
> + return -E2BIG;
What's wrong with scanf?
next prev parent reply other threads:[~2023-12-08 17:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-07 17:21 [PATCH net-next 0/3] netdevsim: link and forward skbs between David Wei
2023-12-07 17:21 ` [PATCH net-next 1/3] netdevsim: allow two netdevsim ports to be David Wei
2023-12-08 10:59 ` Jiri Pirko
2023-12-08 21:57 ` David Wei
2023-12-09 10:46 ` Jiri Pirko
2023-12-08 17:58 ` Jakub Kicinski [this message]
2023-12-08 22:04 ` David Wei
2023-12-07 17:21 ` [PATCH net-next 2/3] netdevsim: forward skbs from one connected David Wei
2023-12-08 11:01 ` Jiri Pirko
2023-12-08 21:58 ` David Wei
2023-12-07 17:21 ` [PATCH net-next 3/3] selftest: netdevsim: add selftest for David Wei
2023-12-08 10:13 ` [PATCH net-next 0/3] netdevsim: link and forward skbs between Jiri Pirko
2023-12-08 21:45 ` David Wei
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=20231208095817.5aa69755@kernel.org \
--to=kuba@kernel$(echo .)org \
--cc=davem@davemloft$(echo .)net \
--cc=dw@davidwei$(echo .)uk \
--cc=edumazet@google$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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