diff mbox series

[1/1] rt-tests: cyclictest: Suppress unused parameter warnings

Message ID 20241212162453.2618945-1-ende.tan@starfivetech.com
State New
Headers show
Series [1/1] rt-tests: cyclictest: Suppress unused parameter warnings | expand

Commit Message

EnDe Tan Dec. 12, 2024, 4:24 p.m. UTC
From: Tan En De <ende.tan@starfivetech.com>

Mark unused parameters with `__attribute__((unused))`.

Signed-off-by: Tan En De <ende.tan@starfivetech.com>
---
 src/cyclictest/cyclictest.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Crystal Wood Dec. 13, 2024, 6:35 a.m. UTC | #1
On Fri, 2024-12-13 at 00:24 +0800, ende.tan@starfivetech.com wrote:
> From: Tan En De <ende.tan@starfivetech.com>
> 
> Mark unused parameters with `__attribute__((unused))`.
> 
> Signed-off-by: Tan En De <ende.tan@starfivetech.com>
> ---
>  src/cyclictest/cyclictest.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Can we just turn off this warning?  Unused parameters are entirely
normal in functions used as callbacks as well as with ifdefs, and it
seems like a low value warning to begin with (there's a reason it's not
in -Wall).


-Crystal
diff mbox series

Patch

diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index b1f8420..f2db5e4 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -603,12 +603,12 @@  static int has_smi_counter(void)
 	return 1;
 }
 #else
-static int open_msr_file(int cpu)
+static int open_msr_file(int cpu __attribute__((unused)))
 {
 	return -1;
 }
 
-static int get_smi_counter(int fd, unsigned long *counter)
+static int get_smi_counter(int fd __attribute__((unused)), unsigned long *counter __attribute__((unused)))
 {
 	return 1;
 }