Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Jan 2024 16:46:23 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 69748e62e82a - main - vm/vm_object.c: minor cleanup
Message-ID:  <202401131646.40DGkNbp006438@gitrepo.freebsd.org>

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

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

commit 69748e62e82a1f5ef77fd3e1b0c9d7e6a89d22b2
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-01-13 01:44:39 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-01-13 16:45:53 +0000

    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
---
 sys/vm/vm_object.c | 14 +++++---------
 1 file 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)



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