Skip to contentSkip to conversation

NFS: Fix up compiler warnings in super.c

PATCH In review Chuck Lever 2 participants 2 messages May 25, 2007 – May 26, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/10 NFS: Fix up compiler warnings in super.c

---

 fs/nfs/super.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
fs/nfs/super.c +6 -4
index ca20d3c..79a07b5 100644
@@ -263,11 +263,11 @@ static const char *nfs_pseudoflavour_to_name(rpc_authflavor_t flavour)
 		{ RPC_AUTH_GSS_SPKM, "spkm" },
 		{ RPC_AUTH_GSS_SPKMI, "spkmi" },
 		{ RPC_AUTH_GSS_SPKMP, "spkmp" },
-		{ -1, "unknown" }
+		{ UINT_MAX, "unknown" }
 	};
 	int i;
 
-	for (i=0; sec_flavours[i].flavour != -1; i++) {
+	for (i = 0; sec_flavours[i].flavour != UINT_MAX; i++) {
 		if (sec_flavours[i].flavour == flavour)
 			break;
 	}
@@ -355,7 +355,9 @@ static int nfs_show_stats(struct seq_file *m, struct vfsmount *mnt)
 	int i, cpu;
 	struct nfs_server *nfss = NFS_SB(mnt->mnt_sb);
 	struct rpc_auth *auth = nfss->client->cl_auth;
-	struct nfs_iostats totals = { };
+	struct nfs_iostats totals;
+
+	memset(&totals, 0, sizeof(struct nfs_iostats));
 
 	seq_printf(m, "statvers=%s", NFS_IOSTAT_VERS);
 
@@ -772,7 +774,7 @@ static void nfs4_fill_super(struct super_block *sb)
 	nfs_initialise_sb(sb);
 }
 
-static void *nfs_copy_user_string(char *dst, struct nfs_string *src, int maxlen)
+static void *nfs_copy_user_string(char *dst, struct nfs_string *src, size_t maxlen)
 {
 	void *p = NULL;
 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#1 lore raw
Quoted 25 lines · Chuck Lever

---

 fs/nfs/super.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
fs/nfs/super.c +2 -2
index ca20d3c..79a07b5 100644
@@ -263,11 +263,11 @@ static const char *nfs_pseudoflavour_to_name(rpc_authflavor_t flavour)
 		{ RPC_AUTH_GSS_SPKM, "spkm" },
 		{ RPC_AUTH_GSS_SPKMI, "spkmi" },
 		{ RPC_AUTH_GSS_SPKMP, "spkmp" },
-		{ -1, "unknown" }
+		{ UINT_MAX, "unknown" }
 	};
 	int i;
 
-	for (i=0; sec_flavours[i].flavour != -1; i++) {
+	for (i = 0; sec_flavours[i].flavour != UINT_MAX; i++) {
 		if (sec_flavours[i].flavour == flavour)
 			break;
 	}

fs/nfs/super.c static int nfs_show_stats(struct seq_file *m, struct vfsmount *mnt) · line 360

Quoted 7 lines
fs/nfs/super.c +3 -1
@@ -355,7 +355,9 @@ static int nfs_show_stats(struct seq_file *m, struct vfsmount *mnt)
 	int i, cpu;
 	struct nfs_server *nfss = NFS_SB(mnt->mnt_sb);
 	struct rpc_auth *auth = nfss->client->cl_auth;
-	struct nfs_iostats totals = { };
+	struct nfs_iostats totals;
+
+	memset(&totals, 0, sizeof(struct nfs_iostats));

Urgh. What is the purpose of this?

fs/nfs/super.c static void nfs4_fill_super(struct super_block *sb) · line 780

Quoted 12 lines
fs/nfs/super.c +1 -1
 	seq_printf(m, "statvers=%s", NFS_IOSTAT_VERS);
 
@@ -772,7 +774,7 @@ static void nfs4_fill_super(struct super_block *sb)
 	nfs_initialise_sb(sb);
 }
 
-static void *nfs_copy_user_string(char *dst, struct nfs_string *src, int maxlen)
+static void *nfs_copy_user_string(char *dst, struct nfs_string *src, size_t maxlen)
 {
 	void *p = NULL;
 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs