From: Mikulas Patocka Date: Wed, 10 Jul 2013 22:41:17 +0000 (+0100) Subject: dm cache: fix arm link errors with inline X-Git-Tag: upstream/snapshot3+hdmi~4709^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=43aeaa29573924df76f44eda2bbd94ca36e407b5;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git dm cache: fix arm link errors with inline Use __always_inline to avoid a link failure with gcc 4.6 on ARM. gcc 4.7 is OK. It creates a function block_div.part.8, it references __udivdi3 and __umoddi3 and it is never called. The references to __udivdi3 and __umoddi3 cause a link failure. Reported-by: Rob Herring Signed-off-by: Mikulas Patocka Signed-off-by: Alasdair G Kergon --- diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index df44b60..0df3ec0 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c @@ -425,6 +425,10 @@ static bool block_size_is_power_of_two(struct cache *cache) return cache->sectors_per_block_shift >= 0; } +/* gcc on ARM generates spurious references to __udivdi3 and __umoddi3 */ +#if defined(CONFIG_ARM) && __GNUC__ == 4 && __GNUC_MINOR__ <= 6 +__always_inline +#endif static dm_block_t block_div(dm_block_t b, uint32_t n) { do_div(b, n);