Skip to contentSkip to conversation

selftests/timers: remove unused irqcount variable

PATCH In review John Hubbard 4 participants 4 messages Jul 4, 2024 – Jul 5, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 selftests/timers: remove unused irqcount variable

When building with clang, via:

make LLVM=1 -C tools/testing/selftest

...clang warns about an unused irqcount variable. clang is correct: the variable is incremented and then ignored.

Fix this by deleting the irqcount variable.

---

Changes since v2:

1) Rebased onto Linux 6.10-rc6+

Changes since the first version:

1) Rebased onto Linux 6.10-rc1

thanks,
John Hubbard

 tools/testing/selftests/timers/rtcpie.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/testing/selftests/timers/rtcpie.c +1 -2
index 4ef2184f1558..7c07edd0d450 100644
@@ -29,7 +29,7 @@ static const char default_rtc[] = "/dev/rtc0";
 
 int main(int argc, char **argv)
 {
-	int i, fd, retval, irqcount = 0;
+	int i, fd, retval;
 	unsigned long tmp, data, old_pie_rate;
 	const char *rtc = default_rtc;
 	struct timeval start, end, diff;
@@ -120,7 +120,6 @@ int main(int argc, char **argv)
 
 			fprintf(stderr, " %d",i);
 			fflush(stderr);
-			irqcount++;
 		}
 
 		/* Disable periodic interrupts */

base-commit: 8a9c6c40432e265600232b864f97d7c675e8be52

Signature · 1 line
2.45.2
maintainer
#2 lore raw
Quoted 6 lines · John Stultz
Quoted 5 lines · John Hubbard

When building with clang, via:

make LLVM=1 -C tools/testing/selftest

Quoted 8 lines
Quoted 6 lines

...clang warns about an unused irqcount variable. clang is correct: the variable is incremented and then ignored.

Fix this by deleting the irqcount variable.

Thank you all.

Applied to linux_kselftest next for Linux 6.11-rc1.

thanks,
-- Shuah

Reviewed-by on v3 1/1
#3 lore raw
In reply to John Hubbard
Quoted 10 lines · John Hubbard

When building with clang, via:

make LLVM=1 -C tools/testing/selftest

...clang warns about an unused irqcount variable. clang is correct: the variable is incremented and then ignored.

Fix this by deleting the irqcount variable.

Quoted 39 lines

---

Changes since v2:

1) Rebased onto Linux 6.10-rc6+

Changes since the first version:

1) Rebased onto Linux 6.10-rc1

thanks,
John Hubbard

 tools/testing/selftests/timers/rtcpie.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/testing/selftests/timers/rtcpie.c +1 -2
index 4ef2184f1558..7c07edd0d450 100644
@@ -29,7 +29,7 @@ static const char default_rtc[] = "/dev/rtc0";
 
 int main(int argc, char **argv)
 {
-	int i, fd, retval, irqcount = 0;
+	int i, fd, retval;
 	unsigned long tmp, data, old_pie_rate;
 	const char *rtc = default_rtc;
 	struct timeval start, end, diff;
@@ -120,7 +120,6 @@ int main(int argc, char **argv)
 
 			fprintf(stderr, " %d",i);
 			fflush(stderr);
-			irqcount++;
 		}
 
 		/* Disable periodic interrupts */

base-commit: 8a9c6c40432e265600232b864f97d7c675e8be52

Signature · 2 lines
BR,
Muhammad Usama Anjum