[PATCH 0/2] selftests: Introduce common min()/max() and apply them in net tests

Mahmoud Maatuq posted 2 patches 2 years, 3 months ago
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(-)
[PATCH 0/2] selftests: Introduce common min()/max() and apply them in net tests
Posted by Mahmoud Maatuq 2 years, 3 months ago
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