public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: isci: Use proper enumerated type in atapi_d2h_reg_frame_handler
@ 2018-09-27  0:11 Nathan Chancellor
  2018-10-17  1:40 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2018-09-27  0:11 UTC (permalink / raw)
  To: Intel SCU Linux support, Artur Paszkiewicz, James E.J. Bottomley,
	Martin K. Petersen
  Cc: linux-scsi, linux-kernel, Nathan Chancellor

Clang warns when one enumerated type is implicitly converted to another.

drivers/scsi/isci/request.c:1629:13: warning: implicit conversion from
enumeration type 'enum sci_io_status' to different enumeration type
'enum sci_status' [-Wenum-conversion]
                        status = SCI_IO_FAILURE_RESPONSE_VALID;
                               ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/isci/request.c:1631:12: warning: implicit conversion from
enumeration type 'enum sci_io_status' to different enumeration type
'enum sci_status' [-Wenum-conversion]
                status = SCI_IO_FAILURE_RESPONSE_VALID;
                       ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

status is of type sci_status but SCI_IO_FAILURE_RESPONSE_VALID is of
type sci_io_status. Use SCI_FAILURE_IO_RESPONSE_VALID, which is from
sci_status and has SCI_IO_FAILURE_RESPONSE_VALID's exact value since
that is what SCI_IO_FAILURE_RESPONSE_VALID is mapped to in the isci.h
file.

Link: https://github.com/ClangBuiltLinux/linux/issues/153
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
 drivers/scsi/isci/request.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c
index ed197bc8e801..2f151708b59a 100644
--- a/drivers/scsi/isci/request.c
+++ b/drivers/scsi/isci/request.c
@@ -1626,9 +1626,9 @@ static enum sci_status atapi_d2h_reg_frame_handler(struct isci_request *ireq,
 
 	if (status == SCI_SUCCESS) {
 		if (ireq->stp.rsp.status & ATA_ERR)
-			status = SCI_IO_FAILURE_RESPONSE_VALID;
+			status = SCI_FAILURE_IO_RESPONSE_VALID;
 	} else {
-		status = SCI_IO_FAILURE_RESPONSE_VALID;
+		status = SCI_FAILURE_IO_RESPONSE_VALID;
 	}
 
 	if (status != SCI_SUCCESS) {
-- 
2.19.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scsi: isci: Use proper enumerated type in atapi_d2h_reg_frame_handler
  2018-09-27  0:11 [PATCH] scsi: isci: Use proper enumerated type in atapi_d2h_reg_frame_handler Nathan Chancellor
@ 2018-10-17  1:40 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2018-10-17  1:40 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Intel SCU Linux support, Artur Paszkiewicz, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi, linux-kernel


Nathan,

> -			status = SCI_IO_FAILURE_RESPONSE_VALID;
> +			status = SCI_FAILURE_IO_RESPONSE_VALID;

Naming fail!

Applied to 4.20/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-17  1:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-27  0:11 [PATCH] scsi: isci: Use proper enumerated type in atapi_d2h_reg_frame_handler Nathan Chancellor
2018-10-17  1:40 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox