On 2021-04-29 2:48 a.m., Christoph Hellwig wrote:
On Tue, Apr 27, 2021 at 10:30:46AM +0200, Hannes Reinecke wrote:
+/*
+ * Original linux SCSI Status codes. They are shifted 1 bit right
+ * from those found in the SCSI standards.
+ */
+
+#define GOOD 0x00
+#define CHECK_CONDITION 0x01
+#define CONDITION_GOOD 0x02
+#define BUSY 0x04
+#define INTERMEDIATE_GOOD 0x08
+#define INTERMEDIATE_C_GOOD 0x0a
+#define RESERVATION_CONFLICT 0x0c
+#define COMMAND_TERMINATED 0x11
+#define QUEUE_FULL 0x14
+#define ACA_ACTIVE 0x18
+#define TASK_ABORTED 0x20
I don't think there is any need to keep defining them, is there?
If you don't mind breaking existing, user space facing APIs, then
yes, they can be dropped ...
Banishing them to the sg header is correct IMO. Which is exactly
what this patch does.
One thought, they could be wrapped with:
#ifndef __KERNEL__
...
#endif
and repeated in a new header: scsi/sg_priv.h
Then the sg driver and any other files that need those old defines
could include sg_priv.h . The result would be parts of the kernel
not being polluted with commonly use names like GOOD and BUSY.
Anyway:
Reviewed-by: Douglas Gilbert <dgilbert@xxxxxxxxxxxx>