Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jul 2022 15:06:21 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: e98f952c8290 - main - stand: Make sure nobody has a NULL pointer for dv_cleanup
Message-ID:  <202207271506.26RF6LvD019436@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=e98f952c82907ec39cebb4e66efd92691c835e05

commit e98f952c82907ec39cebb4e66efd92691c835e05
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-07-27 14:46:21 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-07-27 15:04:13 +0000

    stand: Make sure nobody has a NULL pointer for dv_cleanup
    
    dv_cleanup is specified almost everywhere. Use nullsys instead of NULL
    to indicate 'do nothing'. Also, be consistent in trailing commas that
    were missing before.
    
    Sponsored by:           Netflix
    Reviewed by:            tsoome
    Differential Revision:  https://reviews.freebsd.org/D35913
---
 stand/common/md.c              | 1 +
 stand/common/vdisk.c           | 2 +-
 stand/efi/libefi/efihttp.c     | 2 +-
 stand/efi/libefi/efinet.c      | 2 +-
 stand/efi/libefi/efipart.c     | 6 +++---
 stand/i386/libi386/biosdisk.c  | 6 +++---
 stand/i386/libi386/pxe.c       | 2 +-
 stand/kboot/hostdisk.c         | 1 +
 stand/libofw/ofw_disk.c        | 1 +
 stand/libsa/zfs/zfs.c          | 2 +-
 stand/userboot/userboot/host.c | 2 +-
 11 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/stand/common/md.c b/stand/common/md.c
index e9fcac668d93..61db56ece7ae 100644
--- a/stand/common/md.c
+++ b/stand/common/md.c
@@ -74,6 +74,7 @@ struct devsw md_dev = {
 	.dv_close = md_close,
 	.dv_ioctl = noioctl,
 	.dv_print = md_print,
+	.dv_cleanup = nullsys,
 };
 
 static int
diff --git a/stand/common/vdisk.c b/stand/common/vdisk.c
index 521ad498b194..c904613a8e91 100644
--- a/stand/common/vdisk.c
+++ b/stand/common/vdisk.c
@@ -52,7 +52,7 @@ struct devsw vdisk_dev = {
 	.dv_close = vdisk_close,
 	.dv_ioctl = vdisk_ioctl,
 	.dv_print = vdisk_print,
-	.dv_cleanup = NULL
+	.dv_cleanup = nullsys,
 };
 
 typedef STAILQ_HEAD(vdisk_info_list, vdisk_info) vdisk_info_list_t;
diff --git a/stand/efi/libefi/efihttp.c b/stand/efi/libefi/efihttp.c
index 05d338fbaf04..728f95a47b42 100644
--- a/stand/efi/libefi/efihttp.c
+++ b/stand/efi/libefi/efihttp.c
@@ -94,7 +94,7 @@ struct devsw efihttp_dev = {
 	.dv_close =	efihttp_dev_close,
 	.dv_ioctl =	noioctl,
 	.dv_print =	NULL,
-	.dv_cleanup =	NULL,
+	.dv_cleanup =	nullsys,
 };
 
 struct fs_ops efihttp_fsops = {
diff --git a/stand/efi/libefi/efinet.c b/stand/efi/libefi/efinet.c
index c52b11d32ec8..a6582bd2c1b5 100644
--- a/stand/efi/libefi/efinet.c
+++ b/stand/efi/libefi/efinet.c
@@ -351,7 +351,7 @@ struct devsw efinet_dev = {
 	.dv_close = NULL,		/* Will be set in efinet_dev_init */
 	.dv_ioctl = noioctl,
 	.dv_print = efinet_dev_print,
-	.dv_cleanup = NULL
+	.dv_cleanup = nullsys,
 };
 
 static int
diff --git a/stand/efi/libefi/efipart.c b/stand/efi/libefi/efipart.c
index 7807c17077a6..e5c9c88234b7 100644
--- a/stand/efi/libefi/efipart.c
+++ b/stand/efi/libefi/efipart.c
@@ -78,7 +78,7 @@ struct devsw efipart_fddev = {
 	.dv_close = efipart_close,
 	.dv_ioctl = efipart_ioctl,
 	.dv_print = efipart_printfd,
-	.dv_cleanup = NULL
+	.dv_cleanup = nullsys,
 };
 
 struct devsw efipart_cddev = {
@@ -90,7 +90,7 @@ struct devsw efipart_cddev = {
 	.dv_close = efipart_close,
 	.dv_ioctl = efipart_ioctl,
 	.dv_print = efipart_printcd,
-	.dv_cleanup = NULL
+	.dv_cleanup = nullsys,
 };
 
 struct devsw efipart_hddev = {
@@ -102,7 +102,7 @@ struct devsw efipart_hddev = {
 	.dv_close = efipart_close,
 	.dv_ioctl = efipart_ioctl,
 	.dv_print = efipart_printhd,
-	.dv_cleanup = NULL
+	.dv_cleanup = nullsys,
 };
 
 static pdinfo_list_t fdinfo = STAILQ_HEAD_INITIALIZER(fdinfo);
diff --git a/stand/i386/libi386/biosdisk.c b/stand/i386/libi386/biosdisk.c
index 2c52617f255d..4f07343344fd 100644
--- a/stand/i386/libi386/biosdisk.c
+++ b/stand/i386/libi386/biosdisk.c
@@ -165,7 +165,7 @@ struct devsw biosfd = {
 	.dv_close = bd_close,
 	.dv_ioctl = bd_ioctl,
 	.dv_print = fd_print,
-	.dv_cleanup = NULL
+	.dv_cleanup = nullsys,
 };
 
 struct devsw bioscd = {
@@ -177,7 +177,7 @@ struct devsw bioscd = {
 	.dv_close = bd_close,
 	.dv_ioctl = bd_ioctl,
 	.dv_print = cd_print,
-	.dv_cleanup = NULL
+	.dv_cleanup = nullsys,
 };
 
 struct devsw bioshd = {
@@ -189,7 +189,7 @@ struct devsw bioshd = {
 	.dv_close = bd_close,
 	.dv_ioctl = bd_ioctl,
 	.dv_print = bd_print,
-	.dv_cleanup = NULL
+	.dv_cleanup = nullsys,
 };
 
 static bdinfo_list_t *
diff --git a/stand/i386/libi386/pxe.c b/stand/i386/libi386/pxe.c
index e80a1961e191..3c6c5468fe37 100644
--- a/stand/i386/libi386/pxe.c
+++ b/stand/i386/libi386/pxe.c
@@ -119,7 +119,7 @@ struct devsw pxedisk = {
 	.dv_close = NULL,	/* Will be set in pxe_init */
 	.dv_ioctl = noioctl,
 	.dv_print = pxe_print,
-	.dv_cleanup = pxe_cleanup
+	.dv_cleanup = pxe_cleanup,
 };
 
 /*
diff --git a/stand/kboot/hostdisk.c b/stand/kboot/hostdisk.c
index 25348c60fc97..cd125350ce9b 100644
--- a/stand/kboot/hostdisk.c
+++ b/stand/kboot/hostdisk.c
@@ -48,6 +48,7 @@ struct devsw hostdisk = {
 	.dv_close = hostdisk_close,
 	.dv_ioctl = hostdisk_ioctl,
 	.dv_print = hostdisk_print,
+	.dv_cleanup = nullsys,
 };
 
 static int
diff --git a/stand/libofw/ofw_disk.c b/stand/libofw/ofw_disk.c
index 8af5750b13bc..086b16a9ecdc 100644
--- a/stand/libofw/ofw_disk.c
+++ b/stand/libofw/ofw_disk.c
@@ -59,6 +59,7 @@ struct devsw ofwdisk = {
 	.dv_close = ofwd_close,
 	.dv_ioctl = ofwd_ioctl,
 	.dv_print = ofwd_print,
+	.dv_cleanup = nullsys,
 };
 
 /*
diff --git a/stand/libsa/zfs/zfs.c b/stand/libsa/zfs/zfs.c
index 633ef3b18784..71e3a49c2929 100644
--- a/stand/libsa/zfs/zfs.c
+++ b/stand/libsa/zfs/zfs.c
@@ -1633,7 +1633,7 @@ struct devsw zfs_dev = {
 	.dv_close = zfs_dev_close,
 	.dv_ioctl = noioctl,
 	.dv_print = zfs_dev_print,
-	.dv_cleanup = NULL
+	.dv_cleanup = nullsys,
 };
 
 int
diff --git a/stand/userboot/userboot/host.c b/stand/userboot/userboot/host.c
index 74727fd8ce3b..d7f01f45c0ab 100644
--- a/stand/userboot/userboot/host.c
+++ b/stand/userboot/userboot/host.c
@@ -174,5 +174,5 @@ struct devsw host_dev = {
 	.dv_close = host_dev_close,
 	.dv_ioctl = noioctl,
 	.dv_print = host_dev_print,
-	.dv_cleanup = NULL
+	.dv_cleanup = nullsys,
 };



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202207271506.26RF6LvD019436>