Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 May 2020 13:53:11 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r361079 - head/sys/kern
Message-ID:  <202005151353.04FDrBst022533@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri May 15 13:53:10 2020
New Revision: 361079
URL: https://svnweb.freebsd.org/changeset/base/361079

Log:
  Improve comment for compat32 handling of sysctl hw.pagesizes.
  
  Explain why truncation works as intended.
  Reformat.
  
  Sponsored by:	The FreeBSD Foundation
  MFC after:	3 days

Modified:
  head/sys/kern/kern_mib.c

Modified: head/sys/kern/kern_mib.c
==============================================================================
--- head/sys/kern/kern_mib.c	Fri May 15 13:52:39 2020	(r361078)
+++ head/sys/kern/kern_mib.c	Fri May 15 13:53:10 2020	(r361079)
@@ -238,8 +238,9 @@ sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS)
 
 	if (req->flags & SCTL_MASK32) {
 		/*
-		 * Recreate the "pagesizes" array with 32-bit elements.  Truncate
-		 * any page size greater than UINT32_MAX to zero.
+		 * Recreate the "pagesizes" array with 32-bit elements.
+		 * Truncate any page size greater than UINT32_MAX to zero,
+		 * which assumes that page sizes are powers of two.
 		 */
 		for (i = 0; i < MAXPAGESIZES; i++)
 			pagesizes32[i] = (uint32_t)pagesizes[i];



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