lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a1978090-b2d6-5176-808c-6aa1561a8926@xen0n.name>
Date:   Fri, 22 Jul 2022 16:12:55 +0800
From:   WANG Xuerui <kernel@...0n.name>
To:     Bibo Mao <maobibo@...ngson.cn>, Huacai Chen <chenhuacai@...nel.org>
Cc:     WANG Xuerui <kernel@...0n.name>,
        Jiaxun Yang <jiaxun.yang@...goat.com>,
        loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] LoongArch: Remove unused variable


On 2022/7/20 15:21, Bibo Mao wrote:
> There are some variables never used or referenced, this patch
> removes these varaibles and make the code cleaner.
>
> Signed-off-by: Bibo Mao <maobibo@...ngson.cn>
> ---
>   arch/loongarch/include/asm/loongson.h | 12 ------------
>   arch/loongarch/kernel/env.c           | 20 --------------------
>   2 files changed, 32 deletions(-)
>
> diff --git a/arch/loongarch/include/asm/loongson.h b/arch/loongarch/include/asm/loongson.h
> index 6a8038725ba7..2df649e73371 100644
> --- a/arch/loongarch/include/asm/loongson.h
> +++ b/arch/loongarch/include/asm/loongson.h
> @@ -39,18 +39,6 @@ extern const struct plat_smp_ops loongson3_smp_ops;
>   
>   #define MAX_PACKAGES 16
>   
> -/* Chip Config register of each physical cpu package */
> -extern u64 loongson_chipcfg[MAX_PACKAGES];
> -#define LOONGSON_CHIPCFG(id) (*(volatile u32 *)(loongson_chipcfg[id]))
> -
> -/* Chip Temperature register of each physical cpu package */
> -extern u64 loongson_chiptemp[MAX_PACKAGES];
> -#define LOONGSON_CHIPTEMP(id) (*(volatile u32 *)(loongson_chiptemp[id]))
> -
> -/* Freq Control register of each physical cpu package */
> -extern u64 loongson_freqctrl[MAX_PACKAGES];
> -#define LOONGSON_FREQCTRL(id) (*(volatile u32 *)(loongson_freqctrl[id]))
> -
>   #define xconf_readl(addr) readl(addr)
>   #define xconf_readq(addr) readq(addr)
>   
> diff --git a/arch/loongarch/kernel/env.c b/arch/loongarch/kernel/env.c
> index 467946ecf451..82b478a5c665 100644
> --- a/arch/loongarch/kernel/env.c
> +++ b/arch/loongarch/kernel/env.c
> @@ -17,21 +17,6 @@ u64 efi_system_table;
>   struct loongson_system_configuration loongson_sysconf;
>   EXPORT_SYMBOL(loongson_sysconf);
>   
> -u64 loongson_chipcfg[MAX_PACKAGES];
> -u64 loongson_chiptemp[MAX_PACKAGES];
> -u64 loongson_freqctrl[MAX_PACKAGES];
> -unsigned long long smp_group[MAX_PACKAGES];
> -
> -static void __init register_addrs_set(u64 *registers, const u64 addr, int num)
> -{
> -	u64 i;
> -
> -	for (i = 0; i < num; i++) {
> -		*registers = (i << 44) | addr;
> -		registers++;
> -	}
> -}
> -
>   void __init init_environ(void)
>   {
>   	int efi_boot = fw_arg0;
> @@ -50,11 +35,6 @@ void __init init_environ(void)
>   	efi_memmap_init_early(&data);
>   	memblock_reserve(data.phys_map & PAGE_MASK,
>   			 PAGE_ALIGN(data.size + (data.phys_map & ~PAGE_MASK)));
> -
> -	register_addrs_set(smp_group, TO_UNCACHE(0x1fe01000), 16);
> -	register_addrs_set(loongson_chipcfg, TO_UNCACHE(0x1fe00180), 16);
> -	register_addrs_set(loongson_chiptemp, TO_UNCACHE(0x1fe0019c), 16);
> -	register_addrs_set(loongson_freqctrl, TO_UNCACHE(0x1fe001d0), 16);
>   }
>   
>   static int __init init_cpu_fullname(void)

These information, although removed here, are actually available in the 
official docs repo [1], so no harm in cleaning the code. Thanks.

Reviewed-by: WANG Xuerui <git@...0n.name>

[1]: 
https://loongson.github.io/LoongArch-Documentation/Loongson-3A5000-usermanual-EN.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ