diff options
author | David Howells <dhowells@redhat.com> | 2011-01-20 11:38:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-21 17:59:29 -0500 |
commit | a8b17ed019bd40d3bfa20439d9c36a99f9be9180 (patch) | |
tree | beb3b08575aa01c7ebb24939b678d533b1f59adf /security/keys/user_defined.c | |
parent | 9093ba53b7f26dbb5210de1157769e59e34bbe23 (diff) |
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>
Diffstat (limited to 'security/keys/user_defined.c')
-rw-r--r-- | security/keys/user_defined.c | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/security/keys/user_defined.c b/security/keys/user_defined.c index e9aa07929656..02807fb16340 100644 --- a/security/keys/user_defined.c +++ b/security/keys/user_defined.c | |||
@@ -35,7 +35,6 @@ struct key_type key_type_user = { | |||
35 | 35 | ||
36 | EXPORT_SYMBOL_GPL(key_type_user); | 36 | EXPORT_SYMBOL_GPL(key_type_user); |
37 | 37 | ||
38 | /*****************************************************************************/ | ||
39 | /* | 38 | /* |
40 | * instantiate a user defined key | 39 | * instantiate a user defined key |
41 | */ | 40 | */ |
@@ -65,12 +64,10 @@ int user_instantiate(struct key *key, const void *data, size_t datalen) | |||
65 | 64 | ||
66 | error: | 65 | error: |
67 | return ret; | 66 | return ret; |
68 | 67 | } | |
69 | } /* end user_instantiate() */ | ||
70 | 68 | ||
71 | EXPORT_SYMBOL_GPL(user_instantiate); | 69 | EXPORT_SYMBOL_GPL(user_instantiate); |
72 | 70 | ||
73 | /*****************************************************************************/ | ||
74 | /* | 71 | /* |
75 | * dispose of the old data from an updated user defined key | 72 | * dispose of the old data from an updated user defined key |
76 | */ | 73 | */ |
@@ -81,10 +78,8 @@ static void user_update_rcu_disposal(struct rcu_head *rcu) | |||
81 | upayload = container_of(rcu, struct user_key_payload, rcu); | 78 | upayload = container_of(rcu, struct user_key_payload, rcu); |
82 | 79 | ||
83 | kfree(upayload); | 80 | kfree(upayload); |
81 | } | ||
84 | 82 | ||
85 | } /* end user_update_rcu_disposal() */ | ||
86 | |||
87 | /*****************************************************************************/ | ||
88 | /* | 83 | /* |
89 | * update a user defined key | 84 | * update a user defined key |
90 | * - the key's semaphore is write-locked | 85 | * - the key's semaphore is write-locked |
@@ -123,24 +118,20 @@ int user_update(struct key *key, const void *data, size_t datalen) | |||
123 | 118 | ||
124 | error: | 119 | error: |
125 | return ret; | 120 | return ret; |
126 | 121 | } | |
127 | } /* end user_update() */ | ||
128 | 122 | ||
129 | EXPORT_SYMBOL_GPL(user_update); | 123 | EXPORT_SYMBOL_GPL(user_update); |
130 | 124 | ||
131 | /*****************************************************************************/ | ||
132 | /* | 125 | /* |
133 | * match users on their name | 126 | * match users on their name |
134 | */ | 127 | */ |
135 | int user_match(const struct key *key, const void *description) | 128 | int user_match(const struct key *key, const void *description) |
136 | { | 129 | { |
137 | return strcmp(key->description, description) == 0; | 130 | return strcmp(key->description, description) == 0; |
138 | 131 | } | |
139 | } /* end user_match() */ | ||
140 | 132 | ||
141 | EXPORT_SYMBOL_GPL(user_match); | 133 | EXPORT_SYMBOL_GPL(user_match); |
142 | 134 | ||
143 | /*****************************************************************************/ | ||
144 | /* | 135 | /* |
145 | * dispose of the links from a revoked keyring | 136 | * dispose of the links from a revoked keyring |
146 | * - called with the key sem write-locked | 137 | * - called with the key sem write-locked |
@@ -156,12 +147,10 @@ void user_revoke(struct key *key) | |||
156 | rcu_assign_pointer(key->payload.data, NULL); | 147 | rcu_assign_pointer(key->payload.data, NULL); |
157 | call_rcu(&upayload->rcu, user_update_rcu_disposal); | 148 | call_rcu(&upayload->rcu, user_update_rcu_disposal); |
158 | } | 149 | } |
159 | 150 | } | |
160 | } /* end user_revoke() */ | ||
161 | 151 | ||
162 | EXPORT_SYMBOL(user_revoke); | 152 | EXPORT_SYMBOL(user_revoke); |
163 | 153 | ||
164 | /*****************************************************************************/ | ||
165 | /* | 154 | /* |
166 | * dispose of the data dangling from the corpse of a user key | 155 | * dispose of the data dangling from the corpse of a user key |
167 | */ | 156 | */ |
@@ -170,12 +159,10 @@ void user_destroy(struct key *key) | |||
170 | struct user_key_payload *upayload = key->payload.data; | 159 | struct user_key_payload *upayload = key->payload.data; |
171 | 160 | ||
172 | kfree(upayload); | 161 | kfree(upayload); |
173 | 162 | } | |
174 | } /* end user_destroy() */ | ||
175 | 163 | ||
176 | EXPORT_SYMBOL_GPL(user_destroy); | 164 | EXPORT_SYMBOL_GPL(user_destroy); |
177 | 165 | ||
178 | /*****************************************************************************/ | ||
179 | /* | 166 | /* |
180 | * describe the user key | 167 | * describe the user key |
181 | */ | 168 | */ |
@@ -184,12 +171,10 @@ void user_describe(const struct key *key, struct seq_file *m) | |||
184 | seq_puts(m, key->description); | 171 | seq_puts(m, key->description); |
185 | 172 | ||
186 | seq_printf(m, ": %u", key->datalen); | 173 | seq_printf(m, ": %u", key->datalen); |
187 | 174 | } | |
188 | } /* end user_describe() */ | ||
189 | 175 | ||
190 | EXPORT_SYMBOL_GPL(user_describe); | 176 | EXPORT_SYMBOL_GPL(user_describe); |
191 | 177 | ||
192 | /*****************************************************************************/ | ||
193 | /* | 178 | /* |
194 | * read the key data | 179 | * read the key data |
195 | * - the key's semaphore is read-locked | 180 | * - the key's semaphore is read-locked |
@@ -213,7 +198,6 @@ long user_read(const struct key *key, char __user *buffer, size_t buflen) | |||
213 | } | 198 | } |
214 | 199 | ||
215 | return ret; | 200 | return ret; |
216 | 201 | } | |
217 | } /* end user_read() */ | ||
218 | 202 | ||
219 | EXPORT_SYMBOL_GPL(user_read); | 203 | EXPORT_SYMBOL_GPL(user_read); |