From: Dave Martin <Dave.Martin@arm.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: catalin.marinas@arm.com, will.deacon@arm.com,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/3] arm64: constify sys64_hook instances
Date: Wed, 14 Aug 2019 10:12:34 +0100 [thread overview]
Message-ID: <20190814091234.GM10425@arm.com> (raw)
In-Reply-To: <20190813141639.13476-4-mark.rutland@arm.com>
On Tue, Aug 13, 2019 at 03:16:39PM +0100, Mark Rutland wrote:
> All instances of struct sys64_hook contain compile-time constant data,
> and are never inentionally modified, so let's make them all const.
>
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> ---
> arch/arm64/kernel/traps.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
> index 42c8422cdf4a..a5d7ce4297b0 100644
> --- a/arch/arm64/kernel/traps.c
> +++ b/arch/arm64/kernel/traps.c
> @@ -511,7 +511,7 @@ struct sys64_hook {
> void (*handler)(unsigned int esr, struct pt_regs *regs);
> };
>
> -static struct sys64_hook sys64_hooks[] = {
> +static const struct sys64_hook sys64_hooks[] = {
> {
> .esr_mask = ESR_ELx_SYS64_ISS_EL0_CACHE_OP_MASK,
> .esr_val = ESR_ELx_SYS64_ISS_EL0_CACHE_OP_VAL,
> @@ -636,7 +636,7 @@ static void compat_cntfrq_read_handler(unsigned int esr, struct pt_regs *regs)
> arm64_compat_skip_faulting_instruction(regs, 4);
> }
>
> -static struct sys64_hook cp15_32_hooks[] = {
> +static const struct sys64_hook cp15_32_hooks[] = {
> {
> .esr_mask = ESR_ELx_CP15_32_ISS_SYS_MASK,
> .esr_val = ESR_ELx_CP15_32_ISS_SYS_CNTFRQ,
> @@ -656,7 +656,7 @@ static void compat_cntvct_read_handler(unsigned int esr, struct pt_regs *regs)
> arm64_compat_skip_faulting_instruction(regs, 4);
> }
>
> -static struct sys64_hook cp15_64_hooks[] = {
> +static const struct sys64_hook cp15_64_hooks[] = {
> {
> .esr_mask = ESR_ELx_CP15_64_ISS_SYS_MASK,
> .esr_val = ESR_ELx_CP15_64_ISS_SYS_CNTVCT,
> @@ -667,7 +667,7 @@ static struct sys64_hook cp15_64_hooks[] = {
>
> asmlinkage void __exception do_cp15instr(unsigned int esr, struct pt_regs *regs)
> {
> - struct sys64_hook *hook, *hook_base;
> + const struct sys64_hook *hook, *hook_base;
>
> if (!cp15_cond_valid(esr, regs)) {
> /*
> @@ -707,7 +707,7 @@ asmlinkage void __exception do_cp15instr(unsigned int esr, struct pt_regs *regs)
>
> asmlinkage void __exception do_sysinstr(unsigned int esr, struct pt_regs *regs)
> {
> - struct sys64_hook *hook;
> + const struct sys64_hook *hook;
>
> for (hook = sys64_hooks; hook->handler; hook++)
> if ((hook->esr_mask & esr) == hook->esr_val) {
Reviewed-by: Dave Martin <Dave.Martin@arm.com>
Cheers
---Dave
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2019-08-14 9:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-13 14:16 [PATCH 0/3] arm64: trivial constification patches Mark Rutland
2019-08-13 14:16 ` [PATCH 1/3] arm64: constify icache_policy_str[] Mark Rutland
2019-08-14 9:07 ` Dave Martin
2019-08-13 14:16 ` [PATCH 2/3] arm64: constify aarch64_insn_encoding_class[] Mark Rutland
2019-08-14 9:10 ` Dave Martin
2019-08-13 14:16 ` [PATCH 3/3] arm64: constify sys64_hook instances Mark Rutland
2019-08-14 9:12 ` Dave Martin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190814091234.GM10425@arm.com \
--to=dave.martin@arm.com \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).