LEROY Christophe <christophe.le...@c-s.fr> writes: > Benjamin Herrenschmidt <b...@kernel.crashing.org> a écrit : > >> Define a common page_fault_is_write() helper and use it >> >> Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> >> --- >> arch/powerpc/mm/fault.c | 18 +++++++++++------- >> 1 file changed, 11 insertions(+), 7 deletions(-) >> >> diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c >> index f257965b54b5..26ec0dd4f419 100644 >> --- a/arch/powerpc/mm/fault.c >> +++ b/arch/powerpc/mm/fault.c >> @@ -183,6 +183,16 @@ static int mm_fault_error(struct pt_regs *regs, >> unsigned long addr, int fault) >> } >> >> /* >> + * Define the correct "is_write" bit in error_code based >> + * on the processor family >> + */ >> +#if (defined(CONFIG_4xx) || defined(CONFIG_BOOKE)) >> +#define page_fault_is_write(__err) ((__err) & ESR_DST) >> +#else >> +#define page_fault_is_write(__err) ((__err) & DSISR_ISSTORE) >> +#endif > > Doesn't linux kernel codying style make preference to static inline > functions instead of macros ?
In general yes. Especially for things that look like functions. Ben was worried the code gen would be worse if it was a static inline returning bool, I'll apply it and have a look. cheers