Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <robherring2@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>

authored by

Mikulas Patocka and committed by
Alasdair G Kergon
43aeaa29 553d8fe0

+4
+4
drivers/md/dm-cache-target.c
··· 425 425 return cache->sectors_per_block_shift >= 0; 426 426 } 427 427 428 + /* gcc on ARM generates spurious references to __udivdi3 and __umoddi3 */ 429 + #if defined(CONFIG_ARM) && __GNUC__ == 4 && __GNUC_MINOR__ <= 6 430 + __always_inline 431 + #endif 428 432 static dm_block_t block_div(dm_block_t b, uint32_t n) 429 433 { 430 434 do_div(b, n);