netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Edward Cree <ecree.xilinx@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>, 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>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Shuah Khan <shuah@kernel.org>,
	Artem Chernyshev <artem.chernyshev@red-soft.ru>,
	Nam Cao <namcao@linutronix.de>,
	Frederic Weisbecker <frederic@kernel.org>
Subject: Re: [PATCH net-next v5 8/8] net: pktgen: use defines for the various dec/hex number parsing digits lengths
Date: Tue, 18 Feb 2025 12:32:56 +0000	[thread overview]
Message-ID: <bc58ecd7-4665-748c-c7ea-001be64e8b4a@gmail.com> (raw)
In-Reply-To: <20250214201145.2f824428@kernel.org>

On 15/02/2025 04:11, Jakub Kicinski wrote:
> On Thu, 13 Feb 2025 12:00:25 +0100 Peter Seiderer wrote:
>> Use defines for the various dec/hex number parsing digits lengths
>> (hex32_arg/num_arg calls).
> 
> I don't understand the value of this patch, TBH.
> 
> Example:
> 
> +#define HEX_2_DIGITS 2
> 
> -		len = hex32_arg(&user_buffer[i], 2, &tmp_value);
> +		len = hex32_arg(&user_buffer[i], HEX_2_DIGITS, &tmp_value);
> 
> The word hex is already there.
> There is still a two.
> I don't think the new define has any explanatory power?
Seems like the intent of the code is that the argument is one byte,
 which just happens to take two digits to represent in hex.
Perhaps that would help to come up with more meaningful names for
 these constants?  (Can't think of good ones off the top of my head)

      parent reply	other threads:[~2025-02-18 12:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-13 11:00 [PATCH net-next v5 0/8] Some pktgen fixes/improvments (part I) Peter Seiderer
2025-02-13 11:00 ` [PATCH net-next v5 1/8] net: pktgen: replace ENOTSUPP with EOPNOTSUPP Peter Seiderer
2025-02-13 11:00 ` [PATCH net-next v5 2/8] net: pktgen: enable 'param=value' parsing Peter Seiderer
2025-02-16  9:21   ` Simon Horman
2025-02-13 11:00 ` [PATCH net-next v5 3/8] net: pktgen: fix hex32_arg parsing for short reads Peter Seiderer
2025-02-13 11:00 ` [PATCH net-next v5 4/8] net: pktgen: fix 'rate 0' error handling (return -EINVAL) Peter Seiderer
2025-02-13 11:00 ` [PATCH net-next v5 5/8] net: pktgen: fix 'ratep " Peter Seiderer
2025-02-13 11:00 ` [PATCH net-next v5 6/8] net: pktgen: fix ctrl interface command parsing Peter Seiderer
2025-02-13 11:00 ` [PATCH net-next v5 7/8] net: pktgen: fix access outside of user given buffer in pktgen_thread_write() Peter Seiderer
2025-02-13 11:00 ` [PATCH net-next v5 8/8] net: pktgen: use defines for the various dec/hex number parsing digits lengths Peter Seiderer
2025-02-15  4:11   ` Jakub Kicinski
2025-02-16  9:17     ` Simon Horman
2025-02-17 17:47       ` Jakub Kicinski
2025-02-18 13:29         ` Simon Horman
2025-02-19  8:30           ` Peter Seiderer
2025-02-18 12:32     ` Edward Cree [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=bc58ecd7-4665-748c-c7ea-001be64e8b4a@gmail.com \
    --to=ecree.xilinx@gmail.com \
    --cc=artem.chernyshev@red-soft.ru \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=frederic@kernel.org \
    --cc=horms@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 \
    /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).