public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] qla2xxx: Add framework for async fabric discovery
@ 2017-02-06 11:37 Dan Carpenter
  2017-02-06 17:41 ` Tran, Quinn
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-02-06 11:37 UTC (permalink / raw)
  To: quinn.tran; +Cc: linux-scsi

Hello Quinn Tran,

The patch b79414ee4988: "qla2xxx: Add framework for async fabric
discovery" from Jan 19, 2017, leads to the following static checker
warning:

	drivers/scsi/qla2xxx/qla_init.c:3910 qla2x00_alloc_fcport()
	warn: use 'flags' here instead of GFP_XXX?

drivers/scsi/qla2xxx/qla_init.c
  3894  fc_port_t *
  3895  qla2x00_alloc_fcport(scsi_qla_host_t *vha, gfp_t flags)
  3896  {
  3897          fc_port_t *fcport;
  3898  
  3899          fcport = kzalloc(sizeof(fc_port_t), flags);

In pratice "flags" is always GFP_KERNEL.

  3900          if (!fcport)
  3901                  return NULL;
  3902  
  3903          /* Setup fcport template structure. */
  3904          fcport->vha = vha;
  3905          fcport->port_type = FCT_UNKNOWN;
  3906          fcport->loop_id = FC_NO_LOOP_ID;
  3907          qla2x00_set_fcport_state(fcport, FCS_UNCONFIGURED);
  3908          fcport->supported_classes = FC_COS_UNSPECIFIED;
  3909  
  3910          fcport->ct_desc.ct_sns = dma_alloc_coherent(&vha->hw->pdev->dev,
  3911                  sizeof(struct ct_sns_pkt), &fcport->ct_desc.ct_sns_dma,
  3912                          GFP_ATOMIC);

There isn't an obvious reason why GFP_ATOMIC is required here.

  3913          fcport->disc_state = DSC_DELETED;
  3914          fcport->fw_login_state = DSC_LS_PORT_UNAVAIL;
  3915          fcport->deleted = QLA_SESS_DELETED;
  3916          fcport->login_retry = vha->hw->login_retry_count;
  3917          fcport->login_retry = 5;
  3918          fcport->logout_on_delete = 1;
  3919  
  3920          if (!fcport->ct_desc.ct_sns) {
  3921                  ql_log(ql_log_warn, vha, 0xffff,
  3922                      "Failed to allocate ct_sns request.\n");
  3923                  kfree(fcport);
  3924                  fcport = NULL;
  3925          }
  3926          INIT_WORK(&fcport->del_work, qla24xx_delete_sess_fn);
  3927          INIT_LIST_HEAD(&fcport->gnl_entry);
  3928          INIT_LIST_HEAD(&fcport->list);
  3929  
  3930          return fcport;
  3931  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-06 17:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-06 11:37 [bug report] qla2xxx: Add framework for async fabric discovery Dan Carpenter
2017-02-06 17:41 ` Tran, Quinn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox