re: tcm_qla2xxx: Add >= 24xx series fabric module for target-core

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

 



On Tue, 2012-03-13 at 20:19 +0300, Dan Carpenter wrote:
> Hello Nicholas,
> 
> The patch b3fd3cce29bb: "tcm_qla2xxx: Add >= 24xx series fabric 
> module for target-core" from Mar 8, 2012, leads to the following Sparse
> warning:
> 
> drivers/scsi/qla2xxx/tcm_qla2xxx.c:843:37: warning: right shift by
> 	bigger than source value
> 
> +       domain = (nacl->nport_id >> 16) & 0xff;
>                         ^^^^^^^^
> nport_id is a u16 so this is always zero.
> 
> +       area = (nacl->nport_id >> 8) & 0xff;
> +       al_pa = nacl->nport_id & 0xff;
> 
> [snip]
> 
> +struct tcm_qla2xxx_nacl {
> +       /* From libfc struct fc_rport->port_id */
> +       u16 nport_id;
> 
> fc_rport->port_id is a u32.
> 
> 

Hi Dan,

Thanks for reporting.  Applying the following to lio-core, and will get
this squashed into for-next-merge soon.

Thanks!

--nab

diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
index c6acb80..df5374e 100644
--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
+++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
@@ -812,7 +812,7 @@ static int tcm_qla2xxx_setup_nacl_from_rport(
 
                p->se_nacl = se_nacl;
                pr_debug("Setting p->se_nacl to se_nacl: %p for WWNN: 0x%016LX,"
-                       " port_id: 0x%04x\n", se_nacl, rport_wwnn,
+                       " port_id: 0x%08x\n", se_nacl, rport_wwnn,
                        nacl->nport_id);
                spin_unlock_irqrestore(&vha->hw->hardware_lock, flags);
 
@@ -856,7 +856,7 @@ void tcm_qla2xxx_clear_nacl_from_fcport_map(struct qla_tgt_sess *sess)
 
        p->se_nacl = NULL;
        pr_debug("Clearing p->se_nacl to se_nacl: %p for WWNN: 0x%016LX,"
-               " port_id: 0x%04x\n", se_nacl, nacl->nport_wwnn,
+               " port_id: 0x%08x\n", se_nacl, nacl->nport_wwnn,
                nacl->nport_id);
 }
 
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.h b/drivers/scsi/qla2xxx/tcm_qla2xxx.h
index e700c15..41730ed 100644
--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.h
+++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.h
@@ -10,7 +10,7 @@
 
 struct tcm_qla2xxx_nacl {
        /* From libfc struct fc_rport->port_id */
-       u16 nport_id;
+       u32 nport_id;
        /* Binary World Wide unique Node Name for remote FC Initiator Nport */
        u64 nport_wwnn;
        /* ASCII formatted WWPN for FC Initiator Nport */



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux