lkml.org 
[lkml]   [2013]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 01/11] Add generic fixmap.h
Date
On Tuesday 12 November 2013, Mark Salter wrote:
> Many architectures provide an asm/fixmap.h which defines support for
> compile-time 'special' virtual mappings which need to be made before
> paging_init() has run. This suport is also used for early ioremap
> on x86. Much of this support is identical across the architectures.
> This patch consolidates all of the common bits into asm-generic/fixmap.h
> which is intended to be included from arch/*/include/asm/fixmap.h.


Good idea,

Acked-by: Arnd Bergmann <arnd@arndb.de>

On Tuesday 12 November 2013, Mark Salter wrote:
> +static __always_inline unsigned long fix_to_virt(const unsigned int idx)
> +{
> + /*
> + * this branch gets completely eliminated after inlining,
> + * except when someone tries to use fixaddr indices in an
> + * illegal way. (such as mixing up address types or using
> + * out-of-range indices).
> + *
> + * If it doesn't get removed, the linker will complain
> + * loudly with a reasonably clear error message..
> + */
> + if (idx >= __end_of_fixed_addresses)
> + __this_fixmap_does_not_exist();
> +

You might be able to turn this into the more readable BUILD_BUG_ON().

Arnd


\
 
 \ /
  Last update: 2013-11-12 15:01    [W:0.145 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site