diff mbox

nfsd: make strdup_if_nonnull static

Message ID 1490259456-15858-1-git-send-email-yanaijie@huawei.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jason Yan March 23, 2017, 8:57 a.m. UTC
Fixes the following sparse warning:

fs/nfsd/nfs4state.c:1915:5: warning: symbol 'strdup_if_nonnull' was not
declared. Should it be static?

Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
 fs/nfsd/nfs4state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

J. Bruce Fields March 29, 2017, 9:51 p.m. UTC | #1
Thanks, applying for 4.12.--b.

On Thu, Mar 23, 2017 at 04:57:36PM +0800, Jason Yan wrote:
> Fixes the following sparse warning:
> 
> fs/nfsd/nfs4state.c:1915:5: warning: symbol 'strdup_if_nonnull' was not
> declared. Should it be static?
> 
> Signed-off-by: Jason Yan <yanaijie@huawei.com>
> ---
>  fs/nfsd/nfs4state.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index e9ef50a..59a9e30 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -1912,7 +1912,7 @@ static void copy_clid(struct nfs4_client *target, struct nfs4_client *source)
>  	target->cl_clientid.cl_id = source->cl_clientid.cl_id; 
>  }
>  
> -int strdup_if_nonnull(char **target, char *source)
> +static int strdup_if_nonnull(char **target, char *source)
>  {
>  	if (source) {
>  		*target = kstrdup(source, GFP_KERNEL);
> -- 
> 2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index e9ef50a..59a9e30 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1912,7 +1912,7 @@  static void copy_clid(struct nfs4_client *target, struct nfs4_client *source)
 	target->cl_clientid.cl_id = source->cl_clientid.cl_id; 
 }
 
-int strdup_if_nonnull(char **target, char *source)
+static int strdup_if_nonnull(char **target, char *source)
 {
 	if (source) {
 		*target = kstrdup(source, GFP_KERNEL);