git: c329931c0225 - main - pass: Make the name of the driver a #define
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 18 Jun 2025 20:30:49 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=c329931c022513070ba86cfe9c96a5b27f508b15
commit c329931c022513070ba86cfe9c96a5b27f508b15
Author: Warner Losh <imp@FreeBSD.org>
AuthorDate: 2025-06-18 20:25:26 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-06-18 20:30:34 +0000
pass: Make the name of the driver a #define
"pass" is in several places, but should be a #define. Make it one. This
also lets folks with particular needs that copy this driver to reduce
diffs.
Sponsored by: Netflix
---
sys/cam/scsi/scsi_pass.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c
index 534ea945a54b..64b29eae7510 100644
--- a/sys/cam/scsi/scsi_pass.c
+++ b/sys/cam/scsi/scsi_pass.c
@@ -63,6 +63,8 @@
#include <cam/scsi/scsi_all.h>
#include <cam/scsi/scsi_pass.h>
+#define PERIPH_NAME "pass"
+
typedef enum {
PASS_FLAG_OPEN = 0x01,
PASS_FLAG_LOCKED = 0x02,
@@ -185,7 +187,7 @@ static void passflags(union ccb *ccb, uint32_t *cam_flags,
static struct periph_driver passdriver =
{
- passinit, "pass",
+ passinit, PERIPH_NAME,
TAILQ_HEAD_INITIALIZER(passdriver.units), /* generation */ 0
};
@@ -199,7 +201,7 @@ static struct cdevsw pass_cdevsw = {
.d_ioctl = passioctl,
.d_poll = passpoll,
.d_kqfilter = passkqfilter,
- .d_name = "pass",
+ .d_name = PERIPH_NAME,
};
static const struct filterops passread_filtops = {
@@ -505,7 +507,7 @@ passasync(void *callback_arg, uint32_t code,
* process.
*/
status = cam_periph_alloc(passregister, passoninvalidate,
- passcleanup, passstart, "pass",
+ passcleanup, passstart, PERIPH_NAME,
CAM_PERIPH_BIO, path,
passasync, AC_FOUND_DEVICE, cgd);
@@ -616,7 +618,7 @@ passregister(struct cam_periph *periph, void *arg)
*/
cam_periph_unlock(periph);
no_tags = (cgd->inq_data.flags & SID_CmdQue) == 0;
- softc->device_stats = devstat_new_entry("pass",
+ softc->device_stats = devstat_new_entry(PERIPH_NAME,
periph->unit_number, 0,
DEVSTAT_NO_BLOCKSIZE
| (no_tags ? DEVSTAT_NO_ORDERED_TAGS : 0),