[SCSI] bfa: fix frame size over 1024 compile warning
authorJing Huang <huangj@brocade.com>
Tue, 19 Oct 2010 00:14:01 +0000 (17:14 -0700)
committerJames Bottomley <James.Bottomley@suse.de>
Mon, 25 Oct 2010 21:25:35 +0000 (16:25 -0500)
Fix compile warning for frame size over 1024 in gcc 4.4.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/bfa/bfa_defs_fcs.h
drivers/scsi/bfa/bfad.c
drivers/scsi/bfa/bfad_drv.h
drivers/scsi/bfa/bfad_im.c

index 96905d301828f90b3060752661e5d247c54fa18a..ae06258bda0b3254f7d035cd31b6b9e25f12a90b 100644 (file)
@@ -93,7 +93,7 @@ struct bfa_lport_cfg_s {
     wwn_t             pwwn;       /*  port wwn */
     wwn_t             nwwn;       /*  node wwn */
     struct bfa_lport_symname_s  sym_name;   /*  vm port symbolic name */
-       bfa_boolean_t       preboot_vp;  /*  vport created from PBC */
+    bfa_boolean_t       preboot_vp;  /*  vport created from PBC */
     enum bfa_lport_role     roles;      /*  FCS port roles */
     u8      tag[16];   /*  opaque tag from application */
 };
index d3966bcfa20591d1bf7dd4ca32ed781bc6eab592..79f8b86e30e3e34b0dc52200a706ee9b5528831d 100644 (file)
@@ -861,20 +861,6 @@ bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad)
        pci_set_drvdata(pdev, NULL);
 }
 
-void
-bfad_fcs_port_cfg(struct bfad_s *bfad)
-{
-       struct bfa_lport_cfg_s  port_cfg;
-       struct bfa_port_attr_s attr;
-       char            symname[BFA_SYMNAME_MAXLEN];
-
-       sprintf(symname, "%s-%d", BFAD_DRIVER_NAME, bfad->inst_no);
-       memcpy(port_cfg.sym_name.symname, symname, strlen(symname));
-       bfa_fcport_get_attr(&bfad->bfa, &attr);
-       port_cfg.nwwn = attr.nwwn;
-       port_cfg.pwwn = attr.pwwn;
-}
-
 bfa_status_t
 bfad_drv_init(struct bfad_s *bfad)
 {
@@ -1065,9 +1051,6 @@ bfad_start_ops(struct bfad_s *bfad) {
        bfa_fcs_init(&bfad->bfa_fcs);
        spin_unlock_irqrestore(&bfad->bfad_lock, flags);
 
-       /* PPORT FCS config */
-       bfad_fcs_port_cfg(bfad);
-
        retval = bfad_cfg_pport(bfad, BFA_LPORT_ROLE_FCP_IM);
        if (retval != BFA_STATUS_OK) {
                if (bfa_sm_cmp_state(bfad, bfad_sm_initializing))
index 98420bbb4f3f1d01f6c9035472d42f69a258ab88..a9045a8fcbb776764cec78da3518a55b839e2638 100644 (file)
@@ -309,7 +309,6 @@ void                bfad_bfa_tmo(unsigned long data);
 void           bfad_init_timer(struct bfad_s *bfad);
 int            bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad);
 void           bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad);
-void           bfad_fcs_port_cfg(struct bfad_s *bfad);
 void           bfad_drv_uninit(struct bfad_s *bfad);
 int            bfad_worker(void *ptr);
 void           bfad_debugfs_init(struct bfad_port_s *port);
index 236922bc9e40d8b2673d7b0760e0b099dab73e52..7a6f48b277c2ed7510db3f9fae40d7d9922d3e5c 100644 (file)
@@ -915,12 +915,16 @@ bfad_im_slave_alloc(struct scsi_device *sdev)
 static u32
 bfad_im_supported_speeds(struct bfa_s *bfa)
 {
-       struct bfa_ioc_attr_s ioc_attr;
+       struct bfa_ioc_attr_s *ioc_attr;
        u32 supported_speed = 0;
 
-       bfa_get_attr(bfa, &ioc_attr);
-       if (ioc_attr.adapter_attr.max_speed == BFA_PORT_SPEED_8GBPS) {
-               if (ioc_attr.adapter_attr.is_mezz) {
+       ioc_attr = kzalloc(sizeof(struct bfa_ioc_attr_s), GFP_KERNEL);
+       if (!ioc_attr)
+               return 0;
+
+       bfa_get_attr(bfa, ioc_attr);
+       if (ioc_attr->adapter_attr.max_speed == BFA_PORT_SPEED_8GBPS) {
+               if (ioc_attr->adapter_attr.is_mezz) {
                        supported_speed |= FC_PORTSPEED_8GBIT |
                                FC_PORTSPEED_4GBIT |
                                FC_PORTSPEED_2GBIT | FC_PORTSPEED_1GBIT;
@@ -929,12 +933,13 @@ bfad_im_supported_speeds(struct bfa_s *bfa)
                                FC_PORTSPEED_4GBIT |
                                FC_PORTSPEED_2GBIT;
                }
-       } else if (ioc_attr.adapter_attr.max_speed == BFA_PORT_SPEED_4GBPS) {
+       } else if (ioc_attr->adapter_attr.max_speed == BFA_PORT_SPEED_4GBPS) {
                supported_speed |=  FC_PORTSPEED_4GBIT | FC_PORTSPEED_2GBIT |
                                FC_PORTSPEED_1GBIT;
-       } else if (ioc_attr.adapter_attr.max_speed == BFA_PORT_SPEED_10GBPS) {
+       } else if (ioc_attr->adapter_attr.max_speed == BFA_PORT_SPEED_10GBPS) {
                supported_speed |= FC_PORTSPEED_10GBIT;
        }
+       kfree(ioc_attr);
        return supported_speed;
 }
 
@@ -944,9 +949,8 @@ bfad_os_fc_host_init(struct bfad_im_port_s *im_port)
        struct Scsi_Host *host = im_port->shost;
        struct bfad_s         *bfad = im_port->bfad;
        struct bfad_port_s    *port = im_port->port;
-       struct bfa_port_attr_s pattr;
-       struct bfa_lport_attr_s port_attr;
        char symname[BFA_SYMNAME_MAXLEN];
+       struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(&bfad->bfa);
 
        fc_host_node_name(host) =
                cpu_to_be64((bfa_fcs_lport_get_nwwn(port->fcs_port)));
@@ -964,15 +968,12 @@ bfad_os_fc_host_init(struct bfad_im_port_s *im_port)
        /* For fibre channel services type 0x20 */
        fc_host_supported_fc4s(host)[7] = 1;
 
-       bfa_fcs_lport_get_attr(&bfad->bfa_fcs.fabric.bport, &port_attr);
-       strncpy(symname, port_attr.port_cfg.sym_name.symname,
+       strncpy(symname, bfad->bfa_fcs.fabric.bport.port_cfg.sym_name.symname,
                BFA_SYMNAME_MAXLEN);
        sprintf(fc_host_symbolic_name(host), "%s", symname);
 
        fc_host_supported_speeds(host) = bfad_im_supported_speeds(&bfad->bfa);
-
-       bfa_fcport_get_attr(&bfad->bfa, &pattr);
-       fc_host_maxframe_size(host) = pattr.pport_cfg.maxfrsize;
+       fc_host_maxframe_size(host) = fcport->cfg.maxfrsize;  
 }
 
 static void