From: namratajanawade <namrata.janawade@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com,
bfields@fieldses.org, chuck.lever@oracle.com,
davem@davemloft.net, kuba@kernel.org, linux-nfs@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
namratajanawade <namrata.janawade@gmail.com>
Subject: [PATCH] net: sunrpc: fixed function and extra line coding styles
Date: Tue, 16 Mar 2021 12:58:33 -0700 [thread overview]
Message-ID: <20210316195833.5063-1-namrata.janawade@gmail.com> (raw)
Block comments written in format suggested by checkpatch.pl.
Removed trailing semicolon in macros definition as macros should not use a trailing semicolon.
Open braces shifted to new line (as suggested by checkpatch.pl).
Signed-off-by: namratajanawade <namrata.janawade@gmail.com>
---
net/sunrpc/auth.c | 36 ++++++++++++++----------------------
1 file changed, 14 insertions(+), 22 deletions(-)
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index a9f0d17fdb0d..6ef9481a0d2d 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -45,8 +45,7 @@ static struct cred machine_cred = {
#endif
};
-/*
- * Return the machine_cred pointer to be used whenever
+/* Return the machine_cred pointer to be used whenever
* the a generic machine credential is needed.
*/
const struct cred *rpc_machine_cred(void)
@@ -84,7 +83,7 @@ static int param_get_hashtbl_sz(char *buffer, const struct kernel_param *kp)
return sprintf(buffer, "%u\n", 1U << nbits);
}
-#define param_check_hashtbl_sz(name, p) __param_check(name, p, unsigned int);
+#define param_check_hashtbl_sz(name, p) __param_check(name, p, unsigned int)
static const struct kernel_param_ops param_ops_hashtbl_sz = {
.set = param_set_hashtbl_sz,
@@ -99,7 +98,8 @@ module_param(auth_max_cred_cachesize, ulong, 0644);
MODULE_PARM_DESC(auth_max_cred_cachesize, "RPC credential maximum total cache size");
static u32
-pseudoflavor_to_flavor(u32 flavor) {
+pseudoflavor_to_flavor(u32 flavor)
+{
if (flavor > RPC_AUTH_MAXFLAVOR)
return RPC_AUTH_GSS;
return flavor;
@@ -256,8 +256,7 @@ rpcauth_release(struct rpc_auth *auth)
static DEFINE_SPINLOCK(rpc_credcache_lock);
-/*
- * On success, the caller is responsible for freeing the reference
+/* On success, the caller is responsible for freeing the reference
* held by the hashtable
*/
static bool
@@ -284,8 +283,7 @@ rpcauth_unhash_cred(struct rpc_cred *cred)
return ret;
}
-/*
- * Initialize RPC credential cache
+/* Initialize RPC credential cache
*/
int
rpcauth_init_credcache(struct rpc_auth *auth)
@@ -320,8 +318,7 @@ rpcauth_stringify_acceptor(struct rpc_cred *cred)
}
EXPORT_SYMBOL_GPL(rpcauth_stringify_acceptor);
-/*
- * Destroy a list of credentials
+/* Destroy a list of credentials
*/
static inline
void rpcauth_destroy_credlist(struct list_head *head)
@@ -373,8 +370,7 @@ rpcauth_lru_remove(struct rpc_cred *cred)
spin_unlock(&rpc_credcache_lock);
}
-/*
- * Clear the RPC credential cache, and delete those credentials
+/* Clear the RPC credential cache, and delete those credentials
* that are not referenced.
*/
void
@@ -403,8 +399,7 @@ rpcauth_clear_credcache(struct rpc_cred_cache *cache)
rpcauth_destroy_credlist(&free);
}
-/*
- * Destroy the RPC credential cache
+/* Destroy the RPC credential cache
*/
void
rpcauth_destroy_credcache(struct rpc_auth *auth)
@@ -423,8 +418,7 @@ EXPORT_SYMBOL_GPL(rpcauth_destroy_credcache);
#define RPC_AUTH_EXPIRY_MORATORIUM (60 * HZ)
-/*
- * Remove stale credentials. Avoid sleeping inside the loop.
+/* Remove stale credentials. Avoid sleeping inside the loop.
*/
static long
rpcauth_prune_expired(struct list_head *free, int nr_to_scan)
@@ -441,8 +435,7 @@ rpcauth_prune_expired(struct list_head *free, int nr_to_scan)
rpcauth_lru_remove_locked(cred);
continue;
}
- /*
- * Enforce a 60 second garbage collection moratorium
+ /* Enforce a 60 second garbage collection moratorium
* Note that the cred_unused list must be time-ordered.
*/
if (!time_in_range(cred->cr_expire, expired, jiffies))
@@ -471,8 +464,7 @@ rpcauth_cache_do_shrink(int nr_to_scan)
return freed;
}
-/*
- * Run memory cache shrinker.
+/* Run memory cache shrinker.
*/
static unsigned long
rpcauth_cache_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
@@ -510,8 +502,7 @@ rpcauth_cache_enforce_limit(void)
rpcauth_cache_do_shrink(nr_to_scan);
}
-/*
- * Look up a process' credentials in the authentication cache
+/* Look up a process' credentials in the authentication cache
*/
struct rpc_cred *
rpcauth_lookup_credcache(struct rpc_auth *auth, struct auth_cred * acred,
@@ -566,6 +557,7 @@ rpcauth_lookup_credcache(struct rpc_auth *auth, struct auth_cred * acred,
cred->cr_ops->cr_init != NULL &&
!(flags & RPCAUTH_LOOKUP_NEW)) {
int res = cred->cr_ops->cr_init(auth, cred);
+
if (res < 0) {
put_rpccred(cred);
cred = ERR_PTR(res);
--
2.25.1
next reply other threads:[~2021-03-16 19:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-16 19:58 namratajanawade [this message]
2021-03-16 20:38 ` Trond Myklebust
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210316195833.5063-1-namrata.janawade@gmail.com \
--to=namrata.janawade@gmail.com \
--cc=anna.schumaker@netapp.com \
--cc=bfields@fieldses.org \
--cc=chuck.lever@oracle.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=trond.myklebust@hammerspace.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®