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/keyctl.c b/security/keys/keyctl.c
index 60924f6..83ec98b7 100644
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -46,7 +46,6 @@
return 0;
}
-/*****************************************************************************/
/*
* extract the description of a new key from userspace and either add it as a
* new key to the specified keyring or update a matching key in that keyring
@@ -132,10 +131,8 @@
kfree(description);
error:
return ret;
+}
-} /* end sys_add_key() */
-
-/*****************************************************************************/
/*
* search the process keyrings for a matching key
* - nested keyrings may also be searched if they have Search permission
@@ -222,10 +219,8 @@
kfree(description);
error:
return ret;
+}
-} /* end sys_request_key() */
-
-/*****************************************************************************/
/*
* get the ID of the specified process keyring
* - the keyring must have search permission to be found
@@ -251,7 +246,6 @@
} /* end keyctl_get_keyring_ID() */
-/*****************************************************************************/
/*
* join the session keyring
* - implements keyctl(KEYCTL_JOIN_SESSION_KEYRING)
@@ -277,10 +271,8 @@
error:
return ret;
+}
-} /* end keyctl_join_session_keyring() */
-
-/*****************************************************************************/
/*
* update a key's data payload
* - the key must be writable
@@ -326,10 +318,8 @@
kfree(payload);
error:
return ret;
+}
-} /* end keyctl_update_key() */
-
-/*****************************************************************************/
/*
* revoke a key
* - the key must be writable
@@ -358,10 +348,8 @@
key_ref_put(key_ref);
error:
return ret;
+}
-} /* end keyctl_revoke_key() */
-
-/*****************************************************************************/
/*
* clear the specified process keyring
* - the keyring must be writable
@@ -383,10 +371,8 @@
key_ref_put(keyring_ref);
error:
return ret;
+}
-} /* end keyctl_keyring_clear() */
-
-/*****************************************************************************/
/*
* link a key into a keyring
* - the keyring must be writable
@@ -417,10 +403,8 @@
key_ref_put(keyring_ref);
error:
return ret;
+}
-} /* end keyctl_keyring_link() */
-
-/*****************************************************************************/
/*
* unlink the first attachment of a key from a keyring
* - the keyring must be writable
@@ -451,10 +435,8 @@
key_ref_put(keyring_ref);
error:
return ret;
+}
-} /* end keyctl_keyring_unlink() */
-
-/*****************************************************************************/
/*
* describe a user key
* - the key must have view permission
@@ -531,10 +513,8 @@
key_ref_put(key_ref);
error:
return ret;
+}
-} /* end keyctl_describe_key() */
-
-/*****************************************************************************/
/*
* search the specified keyring for a matching key
* - the start keyring must be searchable
@@ -626,10 +606,8 @@
kfree(description);
error:
return ret;
+}
-} /* end keyctl_keyring_search() */
-
-/*****************************************************************************/
/*
* read a user key's payload
* - the keyring must be readable or the key must be searchable from the
@@ -688,10 +666,8 @@
key_put(key);
error:
return ret;
+}
-} /* end keyctl_read_key() */
-
-/*****************************************************************************/
/*
* change the ownership of a key
* - the keyring owned by the changer
@@ -796,10 +772,8 @@
zapowner = newowner;
ret = -EDQUOT;
goto error_put;
+}
-} /* end keyctl_chown_key() */
-
-/*****************************************************************************/
/*
* change the permission mask on a key
* - the keyring owned by the changer
@@ -838,8 +812,7 @@
key_put(key);
error:
return ret;
-
-} /* end keyctl_setperm_key() */
+}
/*
* get the destination keyring for instantiation
@@ -895,7 +868,6 @@
return commit_creds(new);
}
-/*****************************************************************************/
/*
* instantiate the key with the specified payload, and, if one is given, link
* the key into the keyring
@@ -973,10 +945,8 @@
vfree(payload);
error:
return ret;
+}
-} /* end keyctl_instantiate_key() */
-
-/*****************************************************************************/
/*
* negatively instantiate the key with the given timeout (in seconds), and, if
* one is given, link the key into the keyring
@@ -1020,10 +990,8 @@
error:
return ret;
+}
-} /* end keyctl_negate_key() */
-
-/*****************************************************************************/
/*
* set the default keyring in which request_key() will cache keys
* - return the old setting
@@ -1079,10 +1047,8 @@
error:
abort_creds(new);
return ret;
+}
-} /* end keyctl_set_reqkey_keyring() */
-
-/*****************************************************************************/
/*
* set or clear the timeout for a key
*/
@@ -1136,10 +1102,8 @@
ret = 0;
error:
return ret;
+}
-} /* end keyctl_set_timeout() */
-
-/*****************************************************************************/
/*
* assume the authority to instantiate the specified key
*/
@@ -1178,8 +1142,7 @@
ret = authkey->serial;
error:
return ret;
-
-} /* end keyctl_assume_authority() */
+}
/*
* get the security label of a key
@@ -1348,7 +1311,6 @@
#endif /* !TIF_NOTIFY_RESUME */
}
-/*****************************************************************************/
/*
* the key control system call
*/
@@ -1439,5 +1401,4 @@
default:
return -EOPNOTSUPP;
}
-
-} /* end sys_keyctl() */
+}