mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
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>
This commit is contained in:
parent
9093ba53b7
commit
a8b17ed019
10 changed files with 80 additions and 248 deletions
|
@ -35,7 +35,6 @@ struct key_type key_type_user = {
|
|||
|
||||
EXPORT_SYMBOL_GPL(key_type_user);
|
||||
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
* instantiate a user defined key
|
||||
*/
|
||||
|
@ -65,12 +64,10 @@ int user_instantiate(struct key *key, const void *data, size_t datalen)
|
|||
|
||||
error:
|
||||
return ret;
|
||||
|
||||
} /* end user_instantiate() */
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL_GPL(user_instantiate);
|
||||
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
* dispose of the old data from an updated user defined key
|
||||
*/
|
||||
|
@ -81,10 +78,8 @@ static void user_update_rcu_disposal(struct rcu_head *rcu)
|
|||
upayload = container_of(rcu, struct user_key_payload, rcu);
|
||||
|
||||
kfree(upayload);
|
||||
}
|
||||
|
||||
} /* end user_update_rcu_disposal() */
|
||||
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
* update a user defined key
|
||||
* - the key's semaphore is write-locked
|
||||
|
@ -123,24 +118,20 @@ int user_update(struct key *key, const void *data, size_t datalen)
|
|||
|
||||
error:
|
||||
return ret;
|
||||
|
||||
} /* end user_update() */
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL_GPL(user_update);
|
||||
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
* match users on their name
|
||||
*/
|
||||
int user_match(const struct key *key, const void *description)
|
||||
{
|
||||
return strcmp(key->description, description) == 0;
|
||||
|
||||
} /* end user_match() */
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL_GPL(user_match);
|
||||
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
* dispose of the links from a revoked keyring
|
||||
* - called with the key sem write-locked
|
||||
|
@ -156,12 +147,10 @@ void user_revoke(struct key *key)
|
|||
rcu_assign_pointer(key->payload.data, NULL);
|
||||
call_rcu(&upayload->rcu, user_update_rcu_disposal);
|
||||
}
|
||||
|
||||
} /* end user_revoke() */
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(user_revoke);
|
||||
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
* dispose of the data dangling from the corpse of a user key
|
||||
*/
|
||||
|
@ -170,12 +159,10 @@ void user_destroy(struct key *key)
|
|||
struct user_key_payload *upayload = key->payload.data;
|
||||
|
||||
kfree(upayload);
|
||||
|
||||
} /* end user_destroy() */
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL_GPL(user_destroy);
|
||||
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
* describe the user key
|
||||
*/
|
||||
|
@ -184,12 +171,10 @@ void user_describe(const struct key *key, struct seq_file *m)
|
|||
seq_puts(m, key->description);
|
||||
|
||||
seq_printf(m, ": %u", key->datalen);
|
||||
|
||||
} /* end user_describe() */
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL_GPL(user_describe);
|
||||
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
* read the key data
|
||||
* - the key's semaphore is read-locked
|
||||
|
@ -213,7 +198,6 @@ long user_read(const struct key *key, char __user *buffer, size_t buflen)
|
|||
}
|
||||
|
||||
return ret;
|
||||
|
||||
} /* end user_read() */
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL_GPL(user_read);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue