diff --git a/contrib/pgcrypto/px-crypt.h b/contrib/pgcrypto/px-crypt.h
index 08001a81f5..4efcad40dd 100644
--- a/contrib/pgcrypto/px-crypt.h
+++ b/contrib/pgcrypto/px-crypt.h
@@ -39,7 +39,7 @@
 #define PX_MAX_SALT_LEN		128
 
 /* default rounds for xdes salt */
-/* NetBSD bin/passwd/local_passwd.c has (29 * 25)*/
+/* NetBSD bin/passwd/local_passwd.c had 29 * 25 (in rev. 1.19) */
 #define PX_XDES_ROUNDS		(29 * 25)
 
 /* default for blowfish salt */
diff --git a/doc/src/sgml/custom-scan.sgml b/doc/src/sgml/custom-scan.sgml
index ab9b055d9a..b8963a28eb 100644
--- a/doc/src/sgml/custom-scan.sgml
+++ b/doc/src/sgml/custom-scan.sgml
@@ -83,10 +83,7 @@ typedef struct CustomPath
     by <literal>nodeToString</literal>, so that debugging routines that attempt to
     print the custom path will work as designed.  <structfield>methods</structfield> must
     point to a (usually statically allocated) object implementing the required
-    custom path methods, of which there is currently only one.  The
-    <structfield>LibraryName</structfield> and <structfield>SymbolName</structfield> fields must also
-    be initialized so that the dynamic loader can resolve them to locate the
-    method table.
+    custom path methods, of which there is currently only one.
   </para>
 
   <para>
diff --git a/src/backend/access/gin/gindatapage.c b/src/backend/access/gin/gindatapage.c
index 21de8ed714..e8c34d6b1f 100644
--- a/src/backend/access/gin/gindatapage.c
+++ b/src/backend/access/gin/gindatapage.c
@@ -1371,7 +1371,7 @@ disassembleLeaf(Page page)
 	if (GinPageIsCompressed(page))
 	{
 		/*
-		 * Create a leafSegment entry for each segment.
+		 * Create a leafSegmentInfo entry for each segment.
 		 */
 		seg = GinDataLeafPageGetPostingList(page);
 		segbegin = (Pointer) seg;
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index d7930c077d..1bbaeeebf4 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -1988,7 +1988,7 @@ StartTransaction(void)
 
 	/*
 	 * Advertise it in the proc array.  We assume assignment of
-	 * LocalTransactionID is atomic, and the backendId should be set already.
+	 * localTransactionId is atomic, and the backendId should be set already.
 	 */
 	Assert(MyProc->backendId == vxid.backendId);
 	MyProc->lxid = vxid.localTransactionId;
diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c
index 9358219aa6..e2cd5b9f60 100644
--- a/src/backend/libpq/auth.c
+++ b/src/backend/libpq/auth.c
@@ -1796,14 +1796,9 @@ interpret_ident_response(const char *ident_response,
 
 
 /*
- *	Talk to the ident server on host "remote_ip_addr" and find out who
- *	owns the tcp connection from his port "remote_port" to port
- *	"local_port_addr" on host "local_ip_addr".  Return the user name the
- *	ident server gives as "*ident_user".
- *
- *	IP addresses and port numbers are in network byte order.
- *
- *	But iff we're unable to get the information from ident, return false.
+ *	Talk to the ident server on port->raddr and find out who
+ *	owns the tcp connection to port->laddr.
+ *	It the username successfully retrieved, check the usermap.
  *
  *	XXX: Using WaitLatchOrSocket() and doing a CHECK_FOR_INTERRUPTS() if the
  *	latch was set would improve the responsiveness to timeouts/cancellations.
diff --git a/src/backend/storage/ipc/standby.c b/src/backend/storage/ipc/standby.c
index 25b7e314af..01ddffec40 100644
--- a/src/backend/storage/ipc/standby.c
+++ b/src/backend/storage/ipc/standby.c
@@ -99,7 +99,7 @@ InitRecoveryTransactionEnvironment(void)
 	 * Lock a virtual transaction id for Startup process.
 	 *
 	 * We need to do GetNextLocalTransactionId() because
-	 * SharedInvalBackendInit() leaves localTransactionid invalid and the lock
+	 * SharedInvalBackendInit() leaves localTransactionId invalid and the lock
 	 * manager doesn't like that at all.
 	 *
 	 * Note that we don't need to run XactLockTableInsert() because nobody
diff --git a/src/bin/pg_controldata/pg_controldata.c b/src/bin/pg_controldata/pg_controldata.c
index 390ea0a939..ff17804723 100644
--- a/src/bin/pg_controldata/pg_controldata.c
+++ b/src/bin/pg_controldata/pg_controldata.c
@@ -4,7 +4,7 @@
  * reads the data from $PGDATA/global/pg_control
  *
  * copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001;
- * licence: BSD
+ * license: BSD
  *
  * src/bin/pg_controldata/pg_controldata.c
  */
diff --git a/src/bin/pg_upgrade/pg_upgrade.h b/src/bin/pg_upgrade/pg_upgrade.h
index ca6a9efd9c..7516b5b881 100644
--- a/src/bin/pg_upgrade/pg_upgrade.h
+++ b/src/bin/pg_upgrade/pg_upgrade.h
@@ -19,7 +19,6 @@
 #define USER_NAME_SIZE		128
 
 #define MAX_STRING			1024
-#define LINE_ALLOC			4096
 #define QUERY_ALLOC			8192
 
 #define MIGRATOR_API_VERSION	1
diff --git a/src/include/storage/lock.h b/src/include/storage/lock.h
index 986bb6433a..6efb7a9648 100644
--- a/src/include/storage/lock.h
+++ b/src/include/storage/lock.h
@@ -594,4 +594,4 @@ extern void VirtualXactLockTableInsert(VirtualTransactionId vxid);
 extern void VirtualXactLockTableCleanup(void);
 extern bool VirtualXactLock(VirtualTransactionId vxid, bool wait);
 
-#endif							/* LOCK_H */
+#endif							/* LOCK_H_ */
diff --git a/src/include/storage/lockdefs.h b/src/include/storage/lockdefs.h
index 3c2c47dc6a..bda08edcfd 100644
--- a/src/include/storage/lockdefs.h
+++ b/src/include/storage/lockdefs.h
@@ -56,4 +56,4 @@ typedef struct xl_standby_lock
 	Oid			relOid;			/* OID of table */
 } xl_standby_lock;
 
-#endif							/* LOCKDEF_H_ */
+#endif							/* LOCKDEFS_H_ */
