diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 321af38b0c..dc3f207e1c 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -23,7 +23,7 @@ standard_targets = all install installdirs uninstall distprep clean distclean ma
 # these targets should recurse even into subdirectories not being built:
 standard_always_targets = distprep clean distclean maintainer-clean
 
-.PHONY: $(standard_targets) install-strip html man installcheck-parallel maintainer-check
+.PHONY: $(standard_targets) install-strip html man installcheck-parallel
 
 # make `all' the default target
 all:
diff --git a/src/backend/access/heap/rewriteheap.c b/src/backend/access/heap/rewriteheap.c
index 72a448ad31..4d4264fef3 100644
--- a/src/backend/access/heap/rewriteheap.c
+++ b/src/backend/access/heap/rewriteheap.c
@@ -787,7 +787,7 @@ raw_heap_insert(RewriteState state, HeapTuple tup)
  * Instead we simply write the mapping files out to disk, *before* the
  * XLogInsert() is performed. That guarantees that either the XLogInsert() is
  * inserted after the checkpoint's redo pointer or that the checkpoint (via
- * LogicalRewriteHeapCheckpoint()) has flushed the (partial) mapping file to
+ * CheckPointLogicalRewriteHeap()) has flushed the (partial) mapping file to
  * disk. That leaves the tail end that has not yet been flushed open to
  * corruption, which is solved by including the current offset in the
  * xl_heap_rewrite_mapping records and truncating the mapping file to it
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index da3d250986..b20daa66d5 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -1796,14 +1796,14 @@ WaitXLogInsertionsToFinish(XLogRecPtr upto)
 		do
 		{
 			/*
-			 * See if this insertion is in progress. LWLockWait will wait for
-			 * the lock to be released, or for the 'value' to be set by a
-			 * LWLockUpdateVar call.  When a lock is initially acquired, its
-			 * value is 0 (InvalidXLogRecPtr), which means that we don't know
-			 * where it's inserting yet.  We will have to wait for it.  If
-			 * it's a small insertion, the record will most likely fit on the
-			 * same page and the inserter will release the lock without ever
-			 * calling LWLockUpdateVar.  But if it has to sleep, it will
+			 * See if this insertion is in progress.  LWLockWaitForVar will
+			 * wait for the lock to be released, or for the 'value' to be set
+			 * by a LWLockUpdateVar call.  When a lock is initially acquired,
+			 * its value is 0 (InvalidXLogRecPtr), which means that we don't
+			 * know where it's inserting yet.  We will have to wait for it.
+			 * If it's a small insertion, the record will most likely fit on
+			 * the same page and the inserter will release the lock without
+			 * ever calling LWLockUpdateVar.  But if it has to sleep, it will
 			 * advertise the insertion point with LWLockUpdateVar before
 			 * sleeping.
 			 */
diff --git a/src/backend/postmaster/bgwriter.c b/src/backend/postmaster/bgwriter.c
index e6b6c549de..8ec16a3fb8 100644
--- a/src/backend/postmaster/bgwriter.c
+++ b/src/backend/postmaster/bgwriter.c
@@ -291,10 +291,10 @@ BackgroundWriterMain(void)
 		 * significantly bigger than BgWriterDelay, so we don't complicate the
 		 * overall timeout handling but just assume we're going to get called
 		 * often enough even if hibernation mode is active. It's not that
-		 * important that log_snap_interval_ms is met strictly. To make sure
-		 * we're not waking the disk up unnecessarily on an idle system we
-		 * check whether there has been any WAL inserted since the last time
-		 * we've logged a running xacts.
+		 * important that LOG_SNAPSHOT_INTERVAL_MS is met strictly. To make
+		 * sure we're not waking the disk up unnecessarily on an idle system
+		 * we check whether there has been any WAL inserted since the last
+		 * time we've logged a running xacts.
 		 *
 		 * We do this logging in the bgwriter as it is the only process that
 		 * is run regularly and returns to its mainloop all the time. E.g.
diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c
index bc1aa88322..c77d47c01c 100644
--- a/src/backend/storage/lmgr/lwlock.c
+++ b/src/backend/storage/lmgr/lwlock.c
@@ -232,7 +232,7 @@ LOG_LWDEBUG(const char *where, LWLock *lock, const char *msg)
 
 static void init_lwlock_stats(void);
 static void print_lwlock_stats(int code, Datum arg);
-static lwlock_stats * get_lwlock_stats_entry(LWLock *lockid);
+static lwlock_stats * get_lwlock_stats_entry(LWLock *lock);
 
 static void
 init_lwlock_stats(void)
diff --git a/src/common/unicode_norm.c b/src/common/unicode_norm.c
index 6281f2222f..89c5533212 100644
--- a/src/common/unicode_norm.c
+++ b/src/common/unicode_norm.c
@@ -178,7 +178,7 @@ recompose_code(uint32 start, uint32 code, uint32 *result)
 			 ((start - SBASE) % TCOUNT) == 0 &&
 			 code >= TBASE && code < (TBASE + TCOUNT))
 	{
-		/* make syllable of from LVT */
+		/* make syllable of form LVT */
 		uint32		tindex = code - TBASE;
 
 		*result = start + tindex;
diff --git a/src/include/replication/logicalproto.h b/src/include/replication/logicalproto.h
index 9c0000cc59..3fc430af01 100644
--- a/src/include/replication/logicalproto.h
+++ b/src/include/replication/logicalproto.h
@@ -19,8 +19,8 @@
 /*
  * Protocol capabilities
  *
- * LOGICAL_PROTO_VERSION_NUM is our native protocol and the greatest version
- * we can support. PGLOGICAL_PROTO_MIN_VERSION_NUM is the oldest version we
+ * LOGICALREP_PROTO_VERSION_NUM is our native protocol and the greatest version
+ * we can support. LOGICALREP_PROTO_MIN_VERSION_NUM is the oldest version we
  * have backwards compatibility for. The client requests protocol version at
  * connect time.
  */
@@ -106,4 +106,4 @@ extern LogicalRepRelation *logicalrep_read_rel(StringInfo in);
 extern void logicalrep_write_typ(StringInfo out, Oid typoid);
 extern void logicalrep_read_typ(StringInfo out, LogicalRepTyp *ltyp);
 
-#endif							/* LOGICALREP_PROTO_H */
+#endif							/* LOGICAL_PROTO_H */
diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h
index 34b68ad0e0..4ef6d8ddd4 100644
--- a/src/include/storage/bufpage.h
+++ b/src/include/storage/bufpage.h
@@ -306,7 +306,7 @@ typedef PageHeaderData *PageHeader;
  * This is intended to catch use of the pointer before page initialization.
  * It is implemented as a function due to the limitations of the MSVC
  * compiler, which choked on doing all these tests within another macro.  We
- * return true so that MacroAssert() can be used while still getting the
+ * return true so that AssertMacro() can be used while still getting the
  * specifics from the macro failure within this function.
  */
 static inline bool
diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h
index 08e0dc8144..f627dfedc5 100644
--- a/src/include/storage/lwlock.h
+++ b/src/include/storage/lwlock.h
@@ -133,7 +133,7 @@ typedef enum LWLockMode
 {
 	LW_EXCLUSIVE,
 	LW_SHARED,
-	LW_WAIT_UNTIL_FREE			/* A special mode used in PGPROC->lwlockMode,
+	LW_WAIT_UNTIL_FREE			/* A special mode used in PGPROC->lwWaitMode,
 								 * when waiting for lock to become free. Not
 								 * to be used as LWLockAcquire argument */
 } LWLockMode;
