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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Fri, 13 Dec 2024, ende.tan@xxxxxxxxxxxxxxxx wrote:

> From: Tan En De <ende.tan@xxxxxxxxxxxxxxxx>
> 
> Mark unused parameters with `__attribute__((unused))`.

You were probably trying to be consistent with the rest of the programs in 
rt-tests, however, according to checkpatch, 

WARNING: __always_unused or __maybe_unused is preferred over 
__attribute__((__unused__))

__always_unused is slightly shorter, shall we try that instead?

John

> 
> Signed-off-by: Tan En De <ende.tan@xxxxxxxxxxxxxxxx>
> ---
>  src/cyclictest/cyclictest.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> 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;
>  }
> -- 
> 2.34.1
> 
> 
> 





[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux