netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] selftests: Introduce common min()/max() and apply them in net tests
@ 2023-08-19 19:50 Mahmoud Maatuq
  2023-08-19 19:50 ` [PATCH 1/2] selftests: Provide local define of min() and max() Mahmoud Maatuq
  2023-08-19 19:50 ` [PATCH 2/2] selftests/net: replace ternary operator with min()/max() Mahmoud Maatuq
  0 siblings, 2 replies; 11+ messages in thread
From: Mahmoud Maatuq @ 2023-08-19 19:50 UTC (permalink / raw)
  To: linux-kernel, linux-kselftest, kuba, netdev,
	willemdebruijn.kernel, davem, pabeni, edumazet, shuah
  Cc: linux-kernel-mentees, Mahmoud Maatuq

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-08-24  8:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-19 19:50 [PATCH 0/2] selftests: Introduce common min()/max() and apply them in net tests Mahmoud Maatuq
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

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).