linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug report] ibmvscsis: Initial commit of IBM VSCSI Tgt Driver
@ 2016-08-03 19:01 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-08-03 19:01 UTC (permalink / raw)
  To: bryantly; +Cc: linux-scsi

Hello Bryant G. Ly,

The patch 88a678bbc34c: "ibmvscsis: Initial commit of IBM VSCSI Tgt
Driver" from Jun 28, 2016, leads to the following static checker
warning:

	drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:1981 ibmvscsis_srp_login()
	warn: suspicious bitop condition

drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
  1967          iport = (struct port_id *)req->initiator_port_id;
  1968          tport = (struct port_id *)req->target_port_id;
  1969          fmt = (struct format_code *)&req->req_buf_fmt;
  1970          if (be32_to_cpu(req->req_it_iu_len) > SRP_MAX_IU_LEN)
  1971                  reason = SRP_LOGIN_REJ_REQ_IT_IU_LENGTH_TOO_LARGE;
  1972          else if (be32_to_cpu(req->req_it_iu_len) < 64)
  1973                  reason = SRP_LOGIN_REJ_UNABLE_ESTABLISH_CHANNEL;
  1974          else if ((be64_to_cpu(iport->id_extension) > (MAX_NUM_PORTS - 1)) ||
  1975                   (be64_to_cpu(tport->id_extension) > (MAX_NUM_PORTS - 1)))
  1976                  reason = SRP_LOGIN_REJ_UNABLE_ASSOCIATE_CHANNEL;
  1977          else if (req->req_flags & SRP_MULTICHAN_MULTI)
  1978                  reason = SRP_LOGIN_REJ_MULTI_CHANNEL_UNSUPPORTED;
  1979          else if (fmt->buffers & (~SUPPORTED_FORMATS))
  1980                  reason = SRP_LOGIN_REJ_UNSUPPORTED_DESCRIPTOR_FMT;
  1981          else if ((fmt->buffers | SUPPORTED_FORMATS) == 0)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SUPPORTED_FORMATS is 1 << 1 so it's never zero.

  1982                  reason = SRP_LOGIN_REJ_UNSUPPORTED_DESCRIPTOR_FMT;
  1983  
  1984          if (vscsi->state == SRP_PROCESSING)
  1985                  reason = SRP_LOGIN_REJ_CHANNEL_LIMIT_REACHED;
  1986  


regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-03 19:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-03 19:01 [bug report] ibmvscsis: Initial commit of IBM VSCSI Tgt Driver Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).