aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2024-01-13 01:44:39 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2024-01-13 16:45:53 +0000
commit69748e62e82a1f5ef77fd3e1b0c9d7e6a89d22b2 (patch)
tree437f4a772c9f358d923e614bf43ff3823de30704
parente3c7b76fa8105929ae9a785e5ffc44274b1b0a81 (diff)
downloadsrc-69748e62e82a1f5ef77fd3e1b0c9d7e6a89d22b2.tar.gz
src-69748e62e82a1f5ef77fd3e1b0c9d7e6a89d22b2.zip
vm/vm_object.c: minor cleanup
Remove sys/cdefs.h and sys/socket.h includes. Order sys/ includes alphabetically. Do not check for NULL before free(). Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week DIfferential revision: https://reviews.freebsd.org/D43444
-rw-r--r--sys/vm/vm_object.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index c141b410edf2..1dd6878cf4ab 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -62,10 +62,8 @@
* Virtual memory object module.
*/
-#include <sys/cdefs.h>
#include "opt_vm.h"
-#include <sys/param.h>
#include <sys/systm.h>
#include <sys/blockcount.h>
#include <sys/cpuset.h>
@@ -74,19 +72,18 @@
#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/kernel.h>
-#include <sys/pctrie.h>
-#include <sys/sysctl.h>
#include <sys/mutex.h>
-#include <sys/proc.h> /* for curproc, pageproc */
+#include <sys/pctrie.h>
+#include <sys/proc.h>
#include <sys/refcount.h>
-#include <sys/socket.h>
+#include <sys/sx.h>
+#include <sys/sysctl.h>
#include <sys/resourcevar.h>
#include <sys/refcount.h>
#include <sys/rwlock.h>
#include <sys/user.h>
#include <sys/vnode.h>
#include <sys/vmmeter.h>
-#include <sys/sx.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
@@ -2612,8 +2609,7 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only)
}
strlcpy(kvo->kvo_path, fullpath, sizeof(kvo->kvo_path));
- if (freepath != NULL)
- free(freepath, M_TEMP);
+ free(freepath, M_TEMP);
/* Pack record size down */
kvo->kvo_structsize = offsetof(struct kinfo_vmobject, kvo_path)