* [PATCH] scsi_status_is_good() uses __KERNEL__ constants.
@ 2023-10-16 20:42 enh
2023-10-16 20:48 ` Bart Van Assche
0 siblings, 1 reply; 3+ messages in thread
From: enh @ 2023-10-16 20:42 UTC (permalink / raw)
To: Linux Kernel Mailing List, linux-scsi
Without this missing #ifdef, userspace code trying to use this header
directly won't compile. glibc manually removes it, bionic removes it
using a script. If we add this, the preprocessor can remove it instead.
Signed-off-by: Elliott Hughes <enh@google.com>
---
include/scsi/scsi.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index ec093594ba53..a585e2067373 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -186,6 +186,7 @@ enum scsi_disposition {
/* Used to obtain the PCI location of a device */
#define SCSI_IOCTL_GET_PCI 0x5387
+#ifdef __KERNEL__
/** scsi_status_is_good - check the status return.
*
* @status: the status passed up from the driver (including host and
@@ -216,5 +217,6 @@ static inline bool scsi_status_is_good(int status)
/* FIXME: this is obsolete in SAM-3 */
(status == SAM_STAT_COMMAND_TERMINATED));
}
+#endif /* __KERNEL__ */
#endif /* _SCSI_SCSI_H */
--
2.42.0.655.g421f12c284-goog
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] scsi_status_is_good() uses __KERNEL__ constants.
2023-10-16 20:42 [PATCH] scsi_status_is_good() uses __KERNEL__ constants enh
@ 2023-10-16 20:48 ` Bart Van Assche
2023-10-16 22:06 ` enh
0 siblings, 1 reply; 3+ messages in thread
From: Bart Van Assche @ 2023-10-16 20:48 UTC (permalink / raw)
To: enh, Linux Kernel Mailing List, linux-scsi
On 10/16/23 13:42, enh wrote:
> Without this missing #ifdef, userspace code trying to use this header
> directly won't compile. glibc manually removes it, bionic removes it
> using a script. If we add this, the preprocessor can remove it instead.
Is that the right solution? Shouldn't these software projects be
modified such that <scsi/scsi.h> is *not* included?
Thanks,
Bart.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi_status_is_good() uses __KERNEL__ constants.
2023-10-16 20:48 ` Bart Van Assche
@ 2023-10-16 22:06 ` enh
0 siblings, 0 replies; 3+ messages in thread
From: enh @ 2023-10-16 22:06 UTC (permalink / raw)
To: Bart Van Assche; +Cc: Linux Kernel Mailing List, linux-scsi
On Mon, Oct 16, 2023 at 1:48 PM Bart Van Assche <bvanassche@acm.org> wrote:
>
> On 10/16/23 13:42, enh wrote:
> > Without this missing #ifdef, userspace code trying to use this header
> > directly won't compile. glibc manually removes it, bionic removes it
> > using a script. If we add this, the preprocessor can remove it instead.
>
> Is that the right solution? Shouldn't these software projects be
> modified such that <scsi/scsi.h> is *not* included?
i'm not sure that's practical? all linux libcs i know of include these
headers. (though bionic only has them because glibc did. i'm assuming
the same is true for musl?)
i think there's obviously a question of "why aren't these uapi
headers, if stuff is using them?". just looking at Android, i see
sg3_utils, mtools, compiler-rt (for ioctls), and toybox (for the eject
command).
or perhaps --- even if most of the scsi headers should be non-uapi, is
there a subset of stuff that should be in uapi?
but "libc can use this header directly like it does uapi headers,
rather than having to need a human manually fix the header" seemed
like a step forward from the status quo where everyone's shipping
their own hacked-up versions of these headers?
> Thanks,
>
> Bart.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-10-16 22:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-16 20:42 [PATCH] scsi_status_is_good() uses __KERNEL__ constants enh
2023-10-16 20:48 ` Bart Van Assche
2023-10-16 22:06 ` enh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®