Skip to content

Commit

Permalink
target: Fix 32-bit + CONFIG_LBDAF=n link error w/ sector_div
Browse files Browse the repository at this point in the history
This patch changes core_alua_state_lba_dependent() to use do_div()
instead sector_div() to avoid the following link error on 32-bit
with CONFIG_LBDAF=n as reported by Jim:

buildlog-1391099072.txt-drivers/built-in.o: In function `target_alua_state_check':
buildlog-1391099072.txt-(.text+0x928d93): undefined reference to `__umoddi3'
buildlog-1391099072.txt:make: *** [vmlinux] Error 1 --
buildlog-1391101753.txt-  CC      init/version.o
buildlog-1391101753.txt-  LD      init/built-in.o
buildlog-1391101753.txt-drivers/built-in.o: In function `core_alua_state_lba_dependent':
buildlog-1391101753.txt-/home/jim/linux/drivers/target/target_core_alua.c:503: undefined reference to `__umoddi3'
buildlog-1391101753.txt:make: *** [vmlinux] Error 1

Reported-by: Jim Davis <jim.epost@gmail.com>
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Nicholas Bellinger committed Feb 12, 2014
1 parent fc09149 commit cdf5594
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/target/target_core_alua.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ static inline int core_alua_state_lba_dependent(

if (segment_mult) {
u64 tmp = lba;
start_lba = sector_div(tmp, segment_size * segment_mult);
start_lba = do_div(tmp, segment_size * segment_mult);

last_lba = first_lba + segment_size - 1;
if (start_lba >= first_lba &&
Expand Down

0 comments on commit cdf5594

Please sign in to comment.