Skip to content

RFC Fix Thumb-2 undef handling for mixed-arch kernels

Dave Martin linux-arm-kernel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest0 of 5 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 5 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/5] Fix Thumb-2 undef handling for mixed-arch kernels
Quoted 12 lines · Nicolas Pitre
Quoted 10 lines · Dave Martin
Quoted 9 lines · Tixy

An alternative to defend against this is to make cpu_architecture() an inline function returning the value of the global variable like:

inline int cpu_architecture(void)

{
	BUG_ON(the_cpu_architecture == CPU_ARCH_UNKNOWN);
	return the_cpu_architecture;
}
Quoted 7 lines
Quoted 5 lines
Quoted 1 line

This has the bonus of not needing to change users of the the function.

Sounds like a good idea. I got rid of the function because I didn't like calling a function from the undef handler entry code, but an inline function which just reads the variable seems like the best of both worlds.

While at it, you could mark the function with __attribute__((pure)).

Hmmm, I don't know what exact impact that has for an inline function, but it would certainly do no harm. Maybe it will eliminate some calls to BUG_ON(). I will add it anyway -- I don't see a reason not to.

Cheers
---Dave