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: <20240708-wildcard-denim-12de7fae795b@spud>
Date: Mon, 8 Jul 2024 13:22:11 +0100
From: Conor Dooley <conor@...nel.org>
To: Xiao Wang <xiao.w.wang@...el.com>
Cc: paul.walmsley@...ive.com, palmer@...belt.com, aou@...s.berkeley.edu,
	atishp@...shpatra.org, anup@...infault.org,
	linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drivers/perf: riscv: Remove redundant macro check

On Mon, Jul 08, 2024 at 08:12:24PM +0800, Xiao Wang wrote:
> The macro CONFIG_RISCV_PMU must have been defined when riscv_pmu.c gets
> compiled, so this patch removes the redundant check.

Did you investigate why this define was added? Why do you think that it
is redundant, rather than checking the incorrect config option?

Cheers,
Conor.

> 
> Signed-off-by: Xiao Wang <xiao.w.wang@...el.com>
> ---
>  drivers/perf/riscv_pmu.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/perf/riscv_pmu.c b/drivers/perf/riscv_pmu.c
> index 0a02e85a8951..7644147d50b4 100644
> --- a/drivers/perf/riscv_pmu.c
> +++ b/drivers/perf/riscv_pmu.c
> @@ -39,7 +39,6 @@ void arch_perf_update_userpage(struct perf_event *event,
>  	userpg->cap_user_time_short = 0;
>  	userpg->cap_user_rdpmc = riscv_perf_user_access(event);
>  
> -#ifdef CONFIG_RISCV_PMU
>  	/*
>  	 * The counters are 64-bit but the priv spec doesn't mandate all the
>  	 * bits to be implemented: that's why, counter width can vary based on
> @@ -47,7 +46,6 @@ void arch_perf_update_userpage(struct perf_event *event,
>  	 */
>  	if (userpg->cap_user_rdpmc)
>  		userpg->pmc_width = to_riscv_pmu(event->pmu)->ctr_get_width(event->hw.idx) + 1;
> -#endif
>  
>  	do {
>  		rd = sched_clock_read_begin(&seq);
> -- 
> 2.25.1
> 
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ