From: Simon Horman <horms@kernel.org>
To: Peter Seiderer <ps.report@gmx.net>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Shuah Khan <shuah@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Artem Chernyshev <artem.chernyshev@red-soft.ru>,
Nam Cao <namcao@linutronix.de>,
Frederic Weisbecker <frederic@kernel.org>
Subject: Re: [PATCH net-next v5 1/8] net: pktgen: fix mix of int/long
Date: Sun, 16 Feb 2025 13:57:48 +0000 [thread overview]
Message-ID: <20250216135748.GD1615191@kernel.org> (raw)
In-Reply-To: <20250213111920.1439021-2-ps.report@gmx.net>
On Thu, Feb 13, 2025 at 12:19:13PM +0100, Peter Seiderer wrote:
> Fix mix of int/long (and multiple conversion from/to) by using consequently
> size_t for i and max and ssize_t for len and adjust function signatures
> of hex32_arg(), count_trail_chars(), num_arg() and strn_len() accordingly.
>
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
> Changes v4 -> v5
> - split up patchset into part i/ii (suggested by Simon Horman)
> - instead of align to most common pattern (int) adjust all usages to
> size_t for i and max and ssize_t for len and adjust function signatures
> of hex32_arg(), count_trail_chars(), num_arg() and strn_len() accordingly
> - respect reverse xmas tree order for local variable declarations (where
> possible without too much code churn)
> - update subject line and patch description
> - fix checkpatch warning '"foo * bar" should be "foo *bar"' for
> count_trail_chars() and strn_len()
>
> Changes v3 -> v4
> - new patch (factored out of patch 'net: pktgen: fix access outside of user
> given buffer in pktgen_if_write()')
Thanks Peter,
A minor nit below, but this looks good to me.
Reviewed-by: Simon Horman <horms@kernel.org>
...
> @@ -777,10 +778,10 @@ static int hex32_arg(const char __user *user_buffer, unsigned long maxlen,
> return i;
> }
>
> -static int count_trail_chars(const char __user * user_buffer,
> - unsigned int maxlen)
> +static ssize_t count_trail_chars(const char __user *user_buffer,
> + size_t maxlen)
nit. as there will be a v2 anyway: the above can fit on one line.
> {
> - int i;
> + size_t i;
>
> for (i = 0; i < maxlen; i++) {
> char c;
next prev parent reply other threads:[~2025-02-16 13:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 11:19 [PATCH net-next v5 0/8] Some pktgen fixes/improvments (part II) Peter Seiderer
2025-02-13 11:19 ` [PATCH net-next v5 1/8] net: pktgen: fix mix of int/long Peter Seiderer
2025-02-16 13:57 ` Simon Horman [this message]
2025-02-13 11:19 ` [PATCH net-next v5 2/8] net: pktgen: remove extra tmp variable (re-use len instead) Peter Seiderer
2025-02-13 11:19 ` [PATCH net-next v5 3/8] net: pktgen: remove some superfluous variable initializing Peter Seiderer
2025-02-13 11:19 ` [PATCH net-next v5 4/8] net: pktgen: fix mpls maximum labels list parsing Peter Seiderer
2025-02-16 13:58 ` Simon Horman
2025-02-13 11:19 ` [PATCH net-next v5 5/8] net: pktgen: fix access outside of user given buffer in pktgen_if_write() Peter Seiderer
2025-02-13 11:19 ` [PATCH net-next v5 6/8] net: pktgen: fix mpls reset parsing Peter Seiderer
2025-02-13 11:19 ` [PATCH net-next v5 7/8] net: pktgen: remove all superfluous index assignements Peter Seiderer
2025-02-16 14:15 ` Simon Horman
2025-02-13 11:19 ` [PATCH net-next v5 8/8] selftest: net: add proc_net_pktgen Peter Seiderer
2025-02-13 15:42 ` [PATCH net-next v5 0/8] Some pktgen fixes/improvments (part II) Jakub Kicinski
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=20250216135748.GD1615191@kernel.org \
--to=horms@kernel.org \
--cc=artem.chernyshev@red-soft.ru \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=frederic@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=namcao@linutronix.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ps.report@gmx.net \
--cc=shuah@kernel.org \
--cc=tglx@linutronix.de \
/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