Thread (8 messages) 8 messages, 3 authors, 2021-05-17

Re: [PATCH 1/3] libsas: Introduce more SAM status code aliases in enum exec_status

From: Christoph Hellwig <hch@lst.de>
Date: 2021-05-15 06:44:12

quoted hunk ↗ jump to hunk
index 9271d7a49b90..9b17f7c8c314 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -477,6 +477,9 @@ enum exec_status {
 	/* The SAM_STAT_.. codes fit in the lower 6 bits, alias some of
 	 * them here to silence 'case value not in enumerated type' warnings
 	 */
+	__SAM_STAT_GOOD = SAM_STAT_GOOD,
+	__SAM_STAT_BUSY = SAM_STAT_BUSY,
+	__SAM_STAT_TASK_ABORTED = SAM_STAT_TASK_ABORTED,
 	__SAM_STAT_CHECK_CONDITION = SAM_STAT_CHECK_CONDITION,
I don't think the (existing) naming and comment are very helpful here.

I'd so a s/__SAM_/SAS_SAM_/

and replace the comment with something like:

	/*
	 * The first 6 bytes are used to return the SAM_STAT_* codes.  To avoid
	 * 'case value not in enumerated type' compiler warnings every value
	 * returned through the exec_status enum will need an alias with
	 * the SAS_ prefix here.
	 */
	SAS_SAM_STAT_GOOD = SAM_STAT_GOOD,
	SAS_SAM_STAT_BUSY = SAM_STAT_BUSY,
	...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help