KEYS: Do some style cleanup in the key management code.

Do a bit of a style clean up in the key management code.  No functional
changes.

Done using:

  perl -p -i -e 's!^/[*]*/\n!!' security/keys/*.c
  perl -p -i -e 's!} /[*] end [a-z0-9_]*[(][)] [*]/\n!}\n!' security/keys/*.c
  sed -i -s -e ": next" -e N -e 's/^\n[}]$/}/' -e t -e P -e 's/^.*\n//' -e "b next" security/keys/*.c

To remove /*****/ lines, remove comments on the closing brace of a
function to name the function and remove blank lines before the closing
brace of a function.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
diff --git a/security/keys/keyring.c b/security/keys/keyring.c
index d37f713..0a2b8e9 100644
--- a/security/keys/keyring.c
+++ b/security/keys/keyring.c
@@ -80,7 +80,6 @@
  */
 static DECLARE_RWSEM(keyring_serialise_link_sem);
 
-/*****************************************************************************/
 /*
  * publish the name of a keyring so that it can be found by name (if it has
  * one)
@@ -102,10 +101,8 @@
 
 		write_unlock(&keyring_name_lock);
 	}
+}
 
-} /* end keyring_publish_name() */
-
-/*****************************************************************************/
 /*
  * initialise a keyring
  * - we object if we were given any data
@@ -123,10 +120,8 @@
 	}
 
 	return ret;
+}
 
-} /* end keyring_instantiate() */
-
-/*****************************************************************************/
 /*
  * match keyrings on their name
  */
@@ -134,10 +129,8 @@
 {
 	return keyring->description &&
 		strcmp(keyring->description, description) == 0;
+}
 
-} /* end keyring_match() */
-
-/*****************************************************************************/
 /*
  * dispose of the data dangling from the corpse of a keyring
  */
@@ -164,10 +157,8 @@
 			key_put(klist->keys[loop]);
 		kfree(klist);
 	}
+}
 
-} /* end keyring_destroy() */
-
-/*****************************************************************************/
 /*
  * describe the keyring
  */
@@ -187,10 +178,8 @@
 	else
 		seq_puts(m, ": empty");
 	rcu_read_unlock();
+}
 
-} /* end keyring_describe() */
-
-/*****************************************************************************/
 /*
  * read a list of key IDs from the keyring's contents
  * - the keyring's semaphore is read-locked
@@ -241,10 +230,8 @@
 
 error:
 	return ret;
+}
 
-} /* end keyring_read() */
-
-/*****************************************************************************/
 /*
  * allocate a keyring and link into the destination keyring
  */
@@ -269,10 +256,8 @@
 	}
 
 	return keyring;
+}
 
-} /* end keyring_alloc() */
-
-/*****************************************************************************/
 /*
  * search the supplied keyring tree for a key that matches the criterion
  * - perform a breadth-then-depth search up to the prescribed limit
@@ -444,10 +429,8 @@
 	rcu_read_unlock();
 error:
 	return key_ref;
+}
 
-} /* end keyring_search_aux() */
-
-/*****************************************************************************/
 /*
  * search the supplied keyring tree for a key that matches the criterion
  * - perform a breadth-then-depth search up to the prescribed limit
@@ -465,12 +448,10 @@
 
 	return keyring_search_aux(keyring, current->cred,
 				  type, description, type->match);
-
-} /* end keyring_search() */
+}
 
 EXPORT_SYMBOL(keyring_search);
 
-/*****************************************************************************/
 /*
  * search the given keyring only (no recursion)
  * - keyring must be locked by caller
@@ -514,10 +495,8 @@
 	atomic_inc(&key->usage);
 	rcu_read_unlock();
 	return make_key_ref(key, possessed);
+}
 
-} /* end __keyring_search_one() */
-
-/*****************************************************************************/
 /*
  * find a keyring with the specified name
  * - all named keyrings are searched
@@ -569,10 +548,8 @@
 out:
 	read_unlock(&keyring_name_lock);
 	return keyring;
+}
 
-} /* end find_keyring_by_name() */
-
-/*****************************************************************************/
 /*
  * see if a cycle will will be created by inserting acyclic tree B in acyclic
  * tree A at the topmost level (ie: as a direct child of A)
@@ -657,8 +634,7 @@
 cycle_detected:
 	ret = -EDEADLK;
 	goto error;
-
-} /* end keyring_detect_cycle() */
+}
 
 /*
  * dispose of a keyring list after the RCU grace period, freeing the unlinked
@@ -898,7 +874,6 @@
 
 EXPORT_SYMBOL(key_link);
 
-/*****************************************************************************/
 /*
  * unlink the first link to a key from a keyring
  */
@@ -968,12 +943,10 @@
 	ret = -ENOMEM;
 	up_write(&keyring->sem);
 	goto error;
-
-} /* end key_unlink() */
+}
 
 EXPORT_SYMBOL(key_unlink);
 
-/*****************************************************************************/
 /*
  * dispose of a keyring list after the RCU grace period, releasing the keys it
  * links to
@@ -989,10 +962,8 @@
 		key_put(klist->keys[loop]);
 
 	kfree(klist);
+}
 
-} /* end keyring_clear_rcu_disposal() */
-
-/*****************************************************************************/
 /*
  * clear the specified process keyring
  * - implements keyctl(KEYCTL_CLEAR)
@@ -1027,12 +998,10 @@
 	}
 
 	return ret;
-
-} /* end keyring_clear() */
+}
 
 EXPORT_SYMBOL(keyring_clear);
 
-/*****************************************************************************/
 /*
  * dispose of the links from a revoked keyring
  * - called with the key sem write-locked
@@ -1050,8 +1019,7 @@
 		rcu_assign_pointer(keyring->payload.subscriptions, NULL);
 		call_rcu(&klist->rcu, keyring_clear_rcu_disposal);
 	}
-
-} /* end keyring_revoke() */
+}
 
 /*
  * Determine whether a key is dead