From: Mahmoud Maatuq <mahmoudmatook.mm@gmail.com>
To: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
kuba@kernel.org, netdev@vger.kernel.org,
willemdebruijn.kernel@gmail.com, davem@davemloft.net,
pabeni@redhat.com, edumazet@google.com, shuah@kernel.org
Cc: linux-kernel-mentees@lists.linuxfoundation.org,
Mahmoud Maatuq <mahmoudmatook.mm@gmail.com>
Subject: [PATCH 0/2] selftests: Introduce common min()/max() and apply them in net tests
Date: Sat, 19 Aug 2023 23:50:03 +0400 [thread overview]
Message-ID: <20230819195005.99387-1-mahmoudmatook.mm@gmail.com> (raw)
The first patch introduces a common definition of
the min() and max() macros for use in multiple files under selftests.
This avoids the redundancy of having scattered local definitions
and prepares the groundwork for other files to simply include kselftest.h.
The second patch then applies these new macros in the selftests/net files,
replacing the ternary operations. This directly addresses several
coccicheck warnings, making the code cleaner and more maintainable
Mahmoud Maatuq (2):
selftests: Provide local define of min() and max()
selftests/net: replace ternary operator with min()/max()
tools/testing/selftests/kselftest.h | 7 +++++++
tools/testing/selftests/net/Makefile | 2 ++
tools/testing/selftests/net/so_txtime.c | 7 ++++---
tools/testing/selftests/net/udpgso_bench_tx.c | 6 +++---
4 files changed, 16 insertions(+), 6 deletions(-)
--
2.34.1
next reply other threads:[~2023-08-20 0:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-19 19:50 Mahmoud Maatuq [this message]
2023-08-19 19:50 ` [PATCH 1/2] selftests: Provide local define of min() and max() Mahmoud Maatuq
2023-08-20 15:15 ` Willem de Bruijn
2023-08-21 13:04 ` David Laight
2023-08-22 14:34 ` Willem de Bruijn
2023-08-22 14:48 ` David Laight
2023-08-23 19:35 ` Mahmoud Matook
2023-08-24 8:53 ` David Laight
2023-08-19 19:50 ` [PATCH 2/2] selftests/net: replace ternary operator with min()/max() Mahmoud Maatuq
2023-08-20 15:10 ` Willem de Bruijn
2023-08-23 19:40 ` Mahmoud Matook
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=20230819195005.99387-1-mahmoudmatook.mm@gmail.com \
--to=mahmoudmatook.mm@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=willemdebruijn.kernel@gmail.com \
/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).