public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: aeasi@marvell.com
Cc: linux-scsi@vger.kernel.org
Subject: [bug report] scsi: qla2xxx: Setup debugfs entries for remote ports
Date: Thu, 24 Sep 2020 11:59:45 +0300	[thread overview]
Message-ID: <20200924085945.GA1569340@mwanda> (raw)

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

             reply	other threads:[~2020-09-24  8:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-24  8:59 Dan Carpenter [this message]
2020-09-24 17:27 ` [EXT] [bug report] scsi: qla2xxx: Setup debugfs entries for remote ports Arun Easi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200924085945.GA1569340@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=aeasi@marvell.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox