Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cred: remove unused get_new_cred()

This helper is not used anymore so remove it.

Link: https://lore.kernel.org/r/20241125-work-cred-v2-29-68b9d38bb5b2@kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Christian Brauner <brauner@kernel.org>

-18
-5
Documentation/security/credentials.rst
··· 527 527 This gets a reference on a live set of credentials, returning a pointer to 528 528 that set of credentials. 529 529 530 - - ``struct cred *get_new_cred(struct cred *cred);`` 531 - 532 - This gets a reference on a set of credentials that is under construction 533 - and is thus still mutable, returning a pointer to that set of credentials. 534 - 535 530 536 531 Open File Credentials 537 532 =====================
-13
include/linux/cred.h
··· 201 201 } 202 202 203 203 /** 204 - * get_new_cred - Get a reference on a new set of credentials 205 - * @cred: The new credentials to reference 206 - * 207 - * Get a reference on the specified set of new credentials. The caller must 208 - * release the reference. 209 - */ 210 - static inline struct cred *get_new_cred(const struct cred *cred) 211 - { 212 - struct cred *nonconst_cred = (struct cred *) cred; 213 - return get_new_cred_many(nonconst_cred, 1); 214 - } 215 - 216 - /** 217 204 * get_cred_many - Get references on a set of credentials 218 205 * @cred: The credentials to reference 219 206 * @nr: Number of references to acquire