diff --git a/contrib/pgcrypto/pgp-decrypt.c b/contrib/pgcrypto/pgp-decrypt.c
index 7d8951cda4..eed0f6ad2d 100644
--- a/contrib/pgcrypto/pgp-decrypt.c
+++ b/contrib/pgcrypto/pgp-decrypt.c
@@ -355,7 +355,7 @@ mdc_finish(PGP_Context *ctx, PullFilter *src, int len)
 	if (len != 20)
 		return PXE_PGP_CORRUPT_DATA;
 
-	/* mdc_read should not call md_update */
+	/* mdc_read should not call px_md_update */
 	ctx->in_mdc_pkt = 1;
 
 	/* read data */
diff --git a/src/backend/access/common/bufmask.c b/src/backend/access/common/bufmask.c
index ee1c6f234a..bcd9bd007b 100644
--- a/src/backend/access/common/bufmask.c
+++ b/src/backend/access/common/bufmask.c
@@ -20,7 +20,7 @@
 #include "access/bufmask.h"
 
 /*
- * mask_page_lsn
+ * mask_page_lsn_and_checksum
  *
  * In consistency checks, the LSN of the two pages compared will likely be
  * different because of concurrent operations when the WAL is generated and
diff --git a/src/backend/access/heap/rewriteheap.c b/src/backend/access/heap/rewriteheap.c
index 4d4264fef3..a17508a82f 100644
--- a/src/backend/access/heap/rewriteheap.c
+++ b/src/backend/access/heap/rewriteheap.c
@@ -237,7 +237,7 @@ static void logical_end_heap_rewrite(RewriteState state);
  * new_heap		new, locked heap relation to insert tuples to
  * oldest_xmin	xid used by the caller to determine which tuples are dead
  * freeze_xid	xid before which tuples will be frozen
- * min_multi	multixact before which multis will be removed
+ * cutoff_multi	multixact before which multis will be removed
  * use_wal		should the inserts to the new heap be WAL-logged?
  *
  * Returns an opaque RewriteState, allocated in current memory context,
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index b20daa66d5..27341ae026 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -6024,7 +6024,10 @@ recoveryApplyDelay(XLogReaderState *record)
 		TimestampDifference(GetCurrentTimestamp(), recoveryDelayUntilTime,
 							&secs, &microsecs);
 
-		/* NB: We're ignoring waits below min_apply_delay's resolution. */
+		/*
+		 * NB: We're ignoring waits below recovery_min_apply_delay's
+		 * resolution.
+		 */
 		if (secs <= 0 && microsecs / 1000 <= 0)
 			break;
 
diff --git a/src/backend/commands/operatorcmds.c b/src/backend/commands/operatorcmds.c
index 17f54410a0..d733aa4826 100644
--- a/src/backend/commands/operatorcmds.c
+++ b/src/backend/commands/operatorcmds.c
@@ -27,9 +27,6 @@
  *		"create operator":
  *				operators
  *
- *		Most of the parse-tree manipulation routines are defined in
- *		commands/manip.c.
- *
  *-------------------------------------------------------------------------
  */
 #include "postgres.h"
diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c
index 52136ad558..07f3c93d3f 100644
--- a/src/backend/storage/smgr/md.c
+++ b/src/backend/storage/smgr/md.c
@@ -731,7 +731,7 @@ mdwrite(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
  *	mdnblocks() -- Get the number of blocks stored in a relation.
  *
  *		Important side effect: all active segments of the relation are opened
- *		and added to the mdfd_seg_fds array.  If this routine has not been
+ *		and added to the md_seg_fds array.  If this routine has not been
  *		called, then only segments up to the last one actually touched
  *		are present in the array.
  */
diff --git a/src/backend/utils/mmgr/aset.c b/src/backend/utils/mmgr/aset.c
index 6e4a343439..6b63d6f85d 100644
--- a/src/backend/utils/mmgr/aset.c
+++ b/src/backend/utils/mmgr/aset.c
@@ -915,7 +915,7 @@ AllocSetAlloc(MemoryContext context, Size size)
 
 		/*
 		 * We could be asking for pretty big blocks here, so cope if malloc
-		 * fails.  But give up if there's less than a meg or so available...
+		 * fails.  But give up if there's less than 1 MB or so available...
 		 */
 		while (block == NULL && blksize > 1024 * 1024)
 		{
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c
index 3a9a65d31d..068b65a2af 100644
--- a/src/bin/pg_ctl/pg_ctl.c
+++ b/src/bin/pg_ctl/pg_ctl.c
@@ -1725,7 +1725,7 @@ pgwin32_doRunAsService(void)
 /*
  * Mingw headers are incomplete, and so are the libraries. So we have to load
  * a whole lot of API functions dynamically. Since we have to do this anyway,
- * also load the couple of functions that *do* exist in minwg headers but not
+ * also load the couple of functions that *do* exist in mingw headers but not
  * on NT4. That way, we don't break on NT4.
  */
 typedef BOOL (WINAPI * __CreateRestrictedToken) (HANDLE, DWORD, DWORD, PSID_AND_ATTRIBUTES, DWORD, PLUID_AND_ATTRIBUTES, DWORD, PSID_AND_ATTRIBUTES, PHANDLE);
diff --git a/src/bin/pg_upgrade/pg_upgrade.h b/src/bin/pg_upgrade/pg_upgrade.h
index 7516b5b881..57c4ed6913 100644
--- a/src/bin/pg_upgrade/pg_upgrade.h
+++ b/src/bin/pg_upgrade/pg_upgrade.h
@@ -21,8 +21,6 @@
 #define MAX_STRING			1024
 #define QUERY_ALLOC			8192
 
-#define MIGRATOR_API_VERSION	1
-
 #define MESSAGE_WIDTH		60
 
 #define GET_MAJOR_VERSION(v)	((v) / 100)
diff --git a/src/include/access/gist_private.h b/src/include/access/gist_private.h
index 0488d01c9b..acebe6c93b 100644
--- a/src/include/access/gist_private.h
+++ b/src/include/access/gist_private.h
@@ -417,7 +417,7 @@ extern bool gistplacetopage(Relation rel, Size freespace, GISTSTATE *giststate,
 							OffsetNumber oldoffnum, BlockNumber *newblkno,
 							Buffer leftchildbuf,
 							List **splitinfo,
-							bool markleftchild,
+							bool markfollowright,
 							Relation heapRel,
 							bool is_build);
 
