Vineet Gupta 1c3c909303 ARC: mm: fix build breakage with STRICT_MM_TYPECHECKS
|  CC      mm/memory.o
| In file included from ../mm/memory.c:53:0:
| ../include/linux/pfn_t.h: In function ‘pfn_t_pte’:
| ../include/linux/pfn_t.h:78:2: error: conversion to non-scalar type requested
|  return pfn_pte(pfn_t_to_pfn(pfn), pgprot);

With STRICT_MM_TYPECHECKS pte_t is a struct and the offending code
forces a cast which ends up shifting a struct and hence the gcc warning.

Note that in recent past some of the arches (aarch64, s390) made
STRICT_MM_TYPECHECKS default, but we don't for ARC as this leads to slightly
worse generated code, given ARC ABI definition of returning structs
(which pte_t would become)

Quoting from ARC ABI...

  "Results of type struct are returned in a caller-supplied temporary
  variable whose address is passed in r0.
  For such functions, the arguments are shifted so that they are
  passed in r1 and up."

So
 - struct to be returned would be allocated on stack requiring extra
   code at call sites
 - callee updates stack memory to facilitate the return (vs. simple
   MOV into return reg r0)

Hence STRICT_MM_TYPECHECKS is not enabled by default for ARC

Cc: <stable@vger.kernel.org>   #4.4+
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2016-08-19 11:04:57 -07:00
..
2013-01-28 12:34:21 +05:30
2016-06-20 11:25:49 +02:00
2016-03-10 14:44:13 -06:00
2016-05-30 10:07:32 +05:30
2016-05-09 09:32:30 +05:30
2016-04-22 18:12:31 +05:30
2016-05-30 10:07:32 +05:30
2015-10-29 18:41:30 +05:30
2013-02-15 23:16:02 +05:30
2016-03-10 14:44:13 -06:00
2016-05-30 10:07:32 +05:30
2015-08-05 11:48:21 +05:30
2013-02-11 20:00:31 +05:30
2016-05-30 10:07:32 +05:30
2015-08-04 09:26:33 +05:30
2013-06-22 19:23:26 +05:30
2016-05-30 10:07:32 +05:30
2013-02-11 20:00:39 +05:30
2013-06-22 13:46:42 +05:30
2013-06-22 13:46:42 +05:30
2016-05-30 10:07:32 +05:30