scsi: qla2xxx: Declare fourth qla2x00_set_model_info() argument const
[linux-2.6-block.git] / drivers / scsi / qla2xxx / qla_init.c
index 02bbc5bdaa4352ba6e0695b98686bfae8337a642..1fd9a086748e39786a986aabb3903ead7605cdee 100644 (file)
@@ -122,13 +122,11 @@ static void qla24xx_abort_sp_done(void *ptr, int res)
        srb_t *sp = ptr;
        struct srb_iocb *abt = &sp->u.iocb_cmd;
 
-       if ((res == QLA_OS_TIMER_EXPIRED) ||
-           del_timer(&sp->u.iocb_cmd.timer)) {
-               if (sp->flags & SRB_WAKEUP_ON_COMP)
-                       complete(&abt->u.abt.comp);
-               else
-                       sp->free(sp);
-       }
+       del_timer(&sp->u.iocb_cmd.timer);
+       if (sp->flags & SRB_WAKEUP_ON_COMP)
+               complete(&abt->u.abt.comp);
+       else
+               sp->free(sp);
 }
 
 static int qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait)
@@ -378,9 +376,6 @@ qla2x00_async_logout(struct scsi_qla_host *vha, fc_port_t *fcport)
        struct srb_iocb *lio;
        int rval = QLA_FUNCTION_FAILED;
 
-       if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT))
-               return rval;
-
        fcport->flags |= FCF_ASYNC_SENT;
        sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL);
        if (!sp)
@@ -1687,9 +1682,9 @@ void qla24xx_handle_relogin_event(scsi_qla_host_t *vha,
        }
 
        if (fcport->last_rscn_gen != fcport->rscn_gen) {
-               ql_dbg(ql_dbg_disc, vha, 0x20e9, "%s %d %8phC post gidpn\n",
+               ql_dbg(ql_dbg_disc, vha, 0x20e9, "%s %d %8phC post gnl\n",
                    __func__, __LINE__, fcport->port_name);
-
+               qla24xx_post_gnl_work(vha, fcport);
                return;
        }
 
@@ -2293,6 +2288,10 @@ qla2x00_initialize_adapter(scsi_qla_host_t *vha)
        if (qla_ini_mode_enabled(vha) || qla_dual_mode_enabled(vha))
                rval = qla2x00_init_rings(vha);
 
+       /* No point in continuing if firmware initialization failed. */
+       if (rval != QLA_SUCCESS)
+               return rval;
+
        ha->flags.chip_reset_done = 1;
 
        if (rval == QLA_SUCCESS && IS_QLA84XX(ha)) {
@@ -4427,7 +4426,7 @@ qla2x00_configure_hba(scsi_qla_host_t *vha)
 
 inline void
 qla2x00_set_model_info(scsi_qla_host_t *vha, uint8_t *model, size_t len,
-       char *def)
+                      const char *def)
 {
        char *st, *en;
        uint16_t index;
@@ -5085,7 +5084,7 @@ qla2x00_configure_local_loop(scsi_qla_host_t *vha)
 
        uint16_t        index;
        uint16_t        entries;
-       char            *id_iter;
+       struct gid_list_info *gid;
        uint16_t        loop_id;
        uint8_t         domain, area, al_pa;
        struct qla_hw_data *ha = vha->hw;
@@ -5160,18 +5159,16 @@ qla2x00_configure_local_loop(scsi_qla_host_t *vha)
        new_fcport->flags &= ~FCF_FABRIC_DEVICE;
 
        /* Add devices to port list. */
-       id_iter = (char *)ha->gid_list;
+       gid = ha->gid_list;
        for (index = 0; index < entries; index++) {
-               domain = ((struct gid_list_info *)id_iter)->domain;
-               area = ((struct gid_list_info *)id_iter)->area;
-               al_pa = ((struct gid_list_info *)id_iter)->al_pa;
+               domain = gid->domain;
+               area = gid->area;
+               al_pa = gid->al_pa;
                if (IS_QLA2100(ha) || IS_QLA2200(ha))
-                       loop_id = (uint16_t)
-                           ((struct gid_list_info *)id_iter)->loop_id_2100;
+                       loop_id = gid->loop_id_2100;
                else
-                       loop_id = le16_to_cpu(
-                           ((struct gid_list_info *)id_iter)->loop_id);
-               id_iter += ha->gid_list_info_size;
+                       loop_id = le16_to_cpu(gid->loop_id);
+               gid = (void *)gid + ha->gid_list_info_size;
 
                /* Bypass reserved domain fields. */
                if ((domain & 0xf0) == 0xf0)
@@ -5396,7 +5393,7 @@ qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport)
            "%s %8phN. rport %p is %s mode\n",
            __func__, fcport->port_name, rport,
            (fcport->port_type == FCT_TARGET) ? "tgt" :
-           ((fcport->port_type & FCT_NVME) ? "nvme" :"ini"));
+           ((fcport->port_type & FCT_NVME) ? "nvme" : "ini"));
 
        fc_remote_port_rolechg(rport, rport_ids.roles);
 }