public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] scsi: qla2xxx: Setup debugfs entries for remote ports
@ 2020-09-24  8:59 Dan Carpenter
  2020-09-24 17:27 ` [EXT] " Arun Easi
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-09-24  8:59 UTC (permalink / raw)
  To: aeasi; +Cc: linux-scsi

Hello Arun Easi,

The patch 1e98fb0f9208: "scsi: qla2xxx: Setup debugfs entries for
remote ports" from Sep 3, 2020, leads to the following static checker
warning:

	drivers/scsi/qla2xxx/qla_dfs.c:119 qla2x00_dfs_create_rport()
	warn: 'fp->dfs_rport_dir' is an error pointer or valid

drivers/scsi/qla2xxx/qla_dfs.c
   106  qla2x00_dfs_create_rport(scsi_qla_host_t *vha, struct fc_port *fp)
   107  {
   108          char wwn[32];
   109  
   110  #define QLA_CREATE_RPORT_FIELD_ATTR(_attr)                      \
   111          debugfs_create_file(#_attr, 0400, fp->dfs_rport_dir,    \
   112                  fp, &qla_dfs_rport_field_##_attr##_fops)
   113  
   114          if (!vha->dfs_rport_root || fp->dfs_rport_dir)
   115                  return;
   116  
   117          sprintf(wwn, "pn-%016llx", wwn_to_u64(fp->port_name));
   118          fp->dfs_rport_dir = debugfs_create_dir(wwn, vha->dfs_rport_root);
   119          if (!fp->dfs_rport_dir)

Just delete this test.  Debugfs functions are not supposed to be checked
in the normal case.

   120                  return;
   121          if (NVME_TARGET(vha->hw, fp))
   122                  debugfs_create_file("dev_loss_tmo", 0600, fp->dfs_rport_dir,

The debugfs_create_file() function has it's own checks built in so no
need to check.

   123                                      fp, &qla_dfs_rport_dev_loss_tmo_fops);
   124  
   125          QLA_CREATE_RPORT_FIELD_ATTR(disc_state);
   126          QLA_CREATE_RPORT_FIELD_ATTR(scan_state);
   127          QLA_CREATE_RPORT_FIELD_ATTR(fw_login_state);

regards,
dan carpenter

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

end of thread, other threads:[~2020-09-24 17:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-24  8:59 [bug report] scsi: qla2xxx: Setup debugfs entries for remote ports Dan Carpenter
2020-09-24 17:27 ` [EXT] " Arun Easi

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