Re: [PATCH] x86/amd_nb: Fix warnings in amd_nb.h
From: Randy Dunlap
Date: Wed Jul 12 2023 - 11:02:26 EST
On 7/12/23 06:02, huzhi001@xxxxxxxxxx wrote:
> The following checkpatch warnings are removed:
> WARNING: function definition argument 'int' should also-
> -have an identifier name
> WARNING: function definition argument 'int' should also-
> -have an identifier name
It appears that checkpatch should be modified to say that function
definition arguments should have a meaningful or useful name,
not just an identifier name.
> WARNING: function definition argument 'unsigned long'-
> -should also have an identifier name
> WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
>
> Signed-off-by: ZhiHu <huzhi001@xxxxxxxxxx>
> ---
> arch/x86/include/asm/amd_nb.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/include/asm/amd_nb.h b/arch/x86/include/asm/amd_nb.h
> index ed0eaf65c437..73a70daa919d 100644
> --- a/arch/x86/include/asm/amd_nb.h
> +++ b/arch/x86/include/asm/amd_nb.h
> @@ -18,14 +18,14 @@ extern bool early_is_amd_nb(u32 value);
> extern struct resource *amd_get_mmconfig_range(struct resource *res);
> extern void amd_flush_garts(void);
> extern int amd_numa_init(void);
> -extern int amd_get_subcaches(int);
> -extern int amd_set_subcaches(int, unsigned long);
> +extern int amd_get_subcaches(int value1);
> +extern int amd_set_subcaches(int value2, unsigned long value3);
>
> extern int amd_smn_read(u16 node, u32 address, u32 *value);
> extern int amd_smn_write(u16 node, u32 address, u32 value);
>
> struct amd_l3_cache {
> - unsigned indices;
> + unsigned int indices;
> u8 subcaches[4];
> };
--
~Randy