diff mbox series

[liburing,v1,4/8] test/ring-leak: Remove a "break" statement in a "for loop"

Message ID 20221219155000.2412524-5-ammar.faizi@intel.com (mailing list archive)
State New
Headers show
Series liburing updates | expand

Commit Message

Ammar Faizi Dec. 19, 2022, 3:49 p.m. UTC
Clang says:

  ring-leak.c:235:21: warning: loop will run at most once \
  (loop increment never executed) [-Wunreachable-code-loop-increment]
          for (i = 0; i < 2; i++) {
                             ^~~

This "break" statement makes the "for loop" meaningless. Remove it. We
are supposed to run the test function with 2 different arguments using
this "for loop".

Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
---
 test/ring-leak.c | 1 -
 1 file changed, 1 deletion(-)
diff mbox series

Patch

diff --git a/test/ring-leak.c b/test/ring-leak.c
index f2ba74f..97b5a3f 100644
--- a/test/ring-leak.c
+++ b/test/ring-leak.c
@@ -234,21 +234,20 @@  int main(int argc, char *argv[])
 
 	for (i = 0; i < 2; i++) {
 		bool update = !!(i & 1);
 
 		ret = test_scm_cycles(update);
 		if (ret) {
 			fprintf(stderr, "test_scm_cycles() failed %i\n",
 				update);
 			return 1;
 		}
-		break;
 	}
 
 	if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sp) != 0) {
 		perror("Failed to create Unix-domain socket pair\n");
 		return 1;
 	}
 
 	ring_fd = get_ring_fd();
 	if (ring_fd < 0)
 		return 1;