[29/33] Run igt_min_max.cocci

Submitted by Lyude Paul on June 7, 2019, 11:08 p.m.

Details

Message ID 20190607230821.4488-29-lyude@redhat.com
State New
Headers show
Series "Series without cover letter" ( rev: 2 1 ) in IGT - Trybot

Not browsing as part of any series.

Commit Message

Lyude Paul June 7, 2019, 11:08 p.m.
From: Lyude Paul <lyude@redhat.com>

And replace various open-coded min()/max() instances with their
respective macros.

Signed-off-by: Lyude Paul <lyude@redhat.com>
---
 lib/igt_alsa.c              | 2 +-
 tests/i915/gem_exec_reuse.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/lib/igt_alsa.c b/lib/igt_alsa.c
index 268cf4ad..7f412227 100644
--- a/lib/igt_alsa.c
+++ b/lib/igt_alsa.c
@@ -462,7 +462,7 @@  int alsa_run(struct alsa *alsa, int duration_ms)
 						output_counts[i];
 					avail = snd_pcm_avail(handle);
 
-					count = avail < count ? avail : count;
+					count = min(avail, count);
 
 					ret = snd_pcm_writei(handle,
 							     &output_buffer[index * bytes_per_sample],
diff --git a/tests/i915/gem_exec_reuse.c b/tests/i915/gem_exec_reuse.c
index 935bfa9a..16a81e68 100644
--- a/tests/i915/gem_exec_reuse.c
+++ b/tests/i915/gem_exec_reuse.c
@@ -73,7 +73,7 @@  static unsigned int max_nfd(void)
 {
 	uint64_t vfs = vfs_file_max();
 	uint64_t fd = max_open_files();
-	uint64_t min = fd < vfs ? fd : vfs;
+	uint64_t min = min(fd, vfs);
 	if (min > INT_MAX)
 		min = INT_MAX;
 	return min;