]> git.karo-electronics.de Git - karo-tx-linux.git/commit
target: simplify code around transport_get_sense_data
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 5 Sep 2012 15:09:14 +0000 (17:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Oct 2012 17:38:58 +0000 (10:38 -0700)
commit613401671e4b54a5814c49c8c81917fcb3435292
tree2497ae101f5d62081513513add7cb1652360176d
parent42740e446939b3e4c9b4798950371c87f483c6f6
target: simplify code around transport_get_sense_data

commit 27a2709912ac19c755d34c79fe11994b0bf8082b upstream.

The error conditions in transport_get_sense_data are superfluous
and complicate the code unnecessarily:

* SCF_TRANSPORT_TASK_SENSE is checked in the caller;

* it's simply part of the invariants of dev->transport->get_sense_buffer
  that it must be there if transport_complete ever returns 1, and that
  it must not return NULL.  Besides, the entire callback will disappear
  with the next patch.

* similarly in the caller we can expect that sense data is only sent
  for non-zero cmd->scsi_status.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/target_core_transport.c