From: Roel Kluin Date: Fri, 2 Jan 2009 16:32:55 +0000 (+0100) Subject: [SCSI] libsas: fix test for negative unsigned and typos X-Git-Tag: v2.6.29-rc1~41^2~17 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=a234b1103f7df35eacb1de7a9d15a636046e263b;p=linux-2.6-omap-h63xx.git [SCSI] libsas: fix test for negative unsigned and typos unsigned req->data_len cannot be negative, and fix =-/-= typo Signed-off-by: Roel Kluin Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/libsas/sas_host_smp.c b/drivers/scsi/libsas/sas_host_smp.c index 16f93123271..d110a366c48 100644 --- a/drivers/scsi/libsas/sas_host_smp.c +++ b/drivers/scsi/libsas/sas_host_smp.c @@ -199,8 +199,8 @@ int sas_smp_host_handler(struct Scsi_Host *shost, struct request *req, break; case SMP_DISCOVER: - req->data_len =- 16; - if (req->data_len < 0) { + req->data_len -= 16; + if ((int)req->data_len < 0) { req->data_len = 0; error = -EINVAL; goto out; @@ -215,8 +215,8 @@ int sas_smp_host_handler(struct Scsi_Host *shost, struct request *req, break; case SMP_REPORT_PHY_SATA: - req->data_len =- 16; - if (req->data_len < 0) { + req->data_len -= 16; + if ((int)req->data_len < 0) { req->data_len = 0; error = -EINVAL; goto out; @@ -238,8 +238,8 @@ int sas_smp_host_handler(struct Scsi_Host *shost, struct request *req, break; case SMP_PHY_CONTROL: - req->data_len =- 44; - if (req->data_len < 0) { + req->data_len -= 44; + if ((int)req->data_len < 0) { req->data_len = 0; error = -EINVAL; goto out;