提交 a234b110 编写于 作者: R Roel Kluin 提交者: James Bottomley

[SCSI] libsas: fix test for negative unsigned and typos

unsigned req->data_len cannot be negative, and fix =-/-= typo
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
上级 d38f47a9
...@@ -199,8 +199,8 @@ int sas_smp_host_handler(struct Scsi_Host *shost, struct request *req, ...@@ -199,8 +199,8 @@ int sas_smp_host_handler(struct Scsi_Host *shost, struct request *req,
break; break;
case SMP_DISCOVER: case SMP_DISCOVER:
req->data_len =- 16; req->data_len -= 16;
if (req->data_len < 0) { if ((int)req->data_len < 0) {
req->data_len = 0; req->data_len = 0;
error = -EINVAL; error = -EINVAL;
goto out; goto out;
...@@ -215,8 +215,8 @@ int sas_smp_host_handler(struct Scsi_Host *shost, struct request *req, ...@@ -215,8 +215,8 @@ int sas_smp_host_handler(struct Scsi_Host *shost, struct request *req,
break; break;
case SMP_REPORT_PHY_SATA: case SMP_REPORT_PHY_SATA:
req->data_len =- 16; req->data_len -= 16;
if (req->data_len < 0) { if ((int)req->data_len < 0) {
req->data_len = 0; req->data_len = 0;
error = -EINVAL; error = -EINVAL;
goto out; goto out;
...@@ -238,8 +238,8 @@ int sas_smp_host_handler(struct Scsi_Host *shost, struct request *req, ...@@ -238,8 +238,8 @@ int sas_smp_host_handler(struct Scsi_Host *shost, struct request *req,
break; break;
case SMP_PHY_CONTROL: case SMP_PHY_CONTROL:
req->data_len =- 44; req->data_len -= 44;
if (req->data_len < 0) { if ((int)req->data_len < 0) {
req->data_len = 0; req->data_len = 0;
error = -EINVAL; error = -EINVAL;
goto out; goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册