linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: alternative: simplify passing alt_region
@ 2021-04-16 16:30 Mark Rutland
  2021-04-22 12:59 ` Will Deacon
  2021-04-23 17:10 ` Catalin Marinas
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Rutland @ 2021-04-16 16:30 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Mark Rutland, Catalin Marinas, Will Deacon

In __apply_alternatives() we take a pointer to void which we later
assign to a pointer to struct alt_region. As all callers are passing a
pointer to struct alt_region to begin with, it's simpler and more robust
to take a pointer to struct alt region, so let's do so and avoid the
need for a temporary variable.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
---
 arch/arm64/kernel/alternative.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/alternative.c b/arch/arm64/kernel/alternative.c
index 1184c44ea2c7..f6fd16185040 100644
--- a/arch/arm64/kernel/alternative.c
+++ b/arch/arm64/kernel/alternative.c
@@ -133,11 +133,10 @@ static void clean_dcache_range_nopatch(u64 start, u64 end)
 	} while (cur += d_size, cur < end);
 }
 
-static void __apply_alternatives(void *alt_region,  bool is_module,
+static void __apply_alternatives(struct alt_region *region, bool is_module,
 				 unsigned long *feature_mask)
 {
 	struct alt_instr *alt;
-	struct alt_region *region = alt_region;
 	__le32 *origptr, *updptr;
 	alternative_cb_t alt_cb;
 
-- 
2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: alternative: simplify passing alt_region
  2021-04-16 16:30 [PATCH] arm64: alternative: simplify passing alt_region Mark Rutland
@ 2021-04-22 12:59 ` Will Deacon
  2021-04-23 17:10 ` Catalin Marinas
  1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2021-04-22 12:59 UTC (permalink / raw)
  To: Mark Rutland; +Cc: linux-arm-kernel, Catalin Marinas

On Fri, Apr 16, 2021 at 05:30:32PM +0100, Mark Rutland wrote:
> In __apply_alternatives() we take a pointer to void which we later
> assign to a pointer to struct alt_region. As all callers are passing a
> pointer to struct alt_region to begin with, it's simpler and more robust
> to take a pointer to struct alt region, so let's do so and avoid the
> need for a temporary variable.
> 
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> ---
>  arch/arm64/kernel/alternative.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Acked-by: Will Deacon <will@kernel.org>

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: alternative: simplify passing alt_region
  2021-04-16 16:30 [PATCH] arm64: alternative: simplify passing alt_region Mark Rutland
  2021-04-22 12:59 ` Will Deacon
@ 2021-04-23 17:10 ` Catalin Marinas
  1 sibling, 0 replies; 3+ messages in thread
From: Catalin Marinas @ 2021-04-23 17:10 UTC (permalink / raw)
  To: linux-arm-kernel, Mark Rutland; +Cc: Will Deacon

On Fri, 16 Apr 2021 17:30:32 +0100, Mark Rutland wrote:
> In __apply_alternatives() we take a pointer to void which we later
> assign to a pointer to struct alt_region. As all callers are passing a
> pointer to struct alt_region to begin with, it's simpler and more robust
> to take a pointer to struct alt region, so let's do so and avoid the
> need for a temporary variable.

Applied to arm64 (for-next/core), thanks!

[1/1] arm64: alternative: simplify passing alt_region
      https://git.kernel.org/arm64/c/8d144746ecc5

-- 
Catalin


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-23 17:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-16 16:30 [PATCH] arm64: alternative: simplify passing alt_region Mark Rutland
2021-04-22 12:59 ` Will Deacon
2021-04-23 17:10 ` Catalin Marinas

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).