Re: [target:for-next 13/14] ERROR: "__umoddi3" [drivers/target/target_core_mod.ko] undefined!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2013-12-18 at 06:32 +0800, kbuild test robot wrote:
> tree:   git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git for-next
> head:   31cf8df68491eb8bc2f07912e0e14f61e18f39fd
> commit: 923aacab87ba24cc42b5c3ccd29b5ef769b46e12 [13/14] target_core_alua: Referrals infrastructure
> config: make ARCH=m68k allmodconfig
> 
> All error/warnings:
> 
> >> ERROR: "__umoddi3" [drivers/target/target_core_mod.ko] undefined!
> 

Ok, the following sector_div() usage should address unsigned long long
division on 32-bit.

Hannes, please review.

diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c
index dbfbf14..2625d5a 100644
--- a/drivers/target/target_core_alua.c
+++ b/drivers/target/target_core_alua.c
@@ -489,7 +489,10 @@ static inline int core_alua_state_lba_dependent(
                        u64 first_lba = map->lba_map_first_lba;
 
                        if (segment_mult) {
-                               start_lba = lba % (segment_size * segment_mult);
+                               u64 tmp = lba;
+                               sector_div(tmp, segment_size * segment_mult);
+                               start_lba = tmp;
+
                                last_lba = first_lba + segment_size - 1;
                                if (start_lba >= first_lba &&
                                    start_lba <= last_lba) {


Also, fixed up the one other minor compile warning:

drivers/target/target_core_alua.c: In function ‘core_alua_state_lba_dependent’:
drivers/target/target_core_alua.c:473:2: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]

diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c
index dbfbf14..5727260 100644
--- a/drivers/target/target_core_alua.c
+++ b/drivers/target/target_core_alua.c
@@ -470,7 +470,7 @@ static inline int core_alua_state_lba_dependent(
        u64 lba;
 
        /* Only need to check for cdb actually containing LBAs */
-       if (!cmd->se_cmd_flags & SCF_SCSI_DATA_CDB)
+       if (!(cmd->se_cmd_flags & SCF_SCSI_DATA_CDB))
                return 0;
 
        spin_lock(&dev->t10_alua.lba_map_lock);

Thanks Fengguang!

--nab

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux