[PATCH] iscsi class: quiet iscsi_add_session compilation warning.

From: Mike Christie
Date: Mon May 18 2009 - 12:54:37 EST


If ISCSI_MAX_TARGET was zero then iscsi_add_session could return
success when it had failed. This will currently not happen because
ISCSI_MAX_TARGET is a macro and not a variable. But gcc likes to
complain about it and people keep reporting it. This patch
just initializes err to be -EINVAL so if we ever defined
ISCSI_MAX_TARGET incorrectly we would fail gracefully.
---
drivers/scsi/scsi_transport_iscsi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 0a2ce7b..f508567 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -675,7 +675,7 @@ int iscsi_add_session(struct iscsi_cls_session *session, unsigned int target_id)
struct iscsi_cls_host *ihost;
unsigned long flags;
unsigned int id = target_id;
- int err;
+ int err = -EINVAL;

ihost = shost->shost_data;
session->sid = atomic_add_return(1, &iscsi_session_nr);
--
1.6.0.6


--------------060500030205030504050102--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/