tree a2d33495131b874e1cc4895ba21723e863ca63b4
parent 7ea6040b0eff07d3a9a4e2d248ac137c6ad02d42
author Max Kellermann <[EMAIL PROTECTED]> Wed, 07 Sep 2005 05:18:03 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Thu, 08 Sep 2005 06:57:39 -0700

[PATCH] sunrpc: print unsigned integers in stats

The sunrpc stats are collected in unsigned integers, but they are printed
with '%d'.  That can result in negative numbers in /proc/net/rpc when the
highest bit of a counter is set.  The following patch changes '%d' to '%u'
where appropriate.

Cc: "David S. Miller" <[EMAIL PROTECTED]>
Cc: Trond Myklebust <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 net/sunrpc/stats.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
--- a/net/sunrpc/stats.c
+++ b/net/sunrpc/stats.c
@@ -35,13 +35,13 @@ static int rpc_proc_show(struct seq_file
        int             i, j;
 
        seq_printf(seq,
-               "net %d %d %d %d\n",
+               "net %u %u %u %u\n",
                        statp->netcnt,
                        statp->netudpcnt,
                        statp->nettcpcnt,
                        statp->nettcpconn);
        seq_printf(seq,
-               "rpc %d %d %d\n",
+               "rpc %u %u %u\n",
                        statp->rpccnt,
                        statp->rpcretrans,
                        statp->rpcauthrefresh);
@@ -50,10 +50,10 @@ static int rpc_proc_show(struct seq_file
                const struct rpc_version *vers = prog->version[i];
                if (!vers)
                        continue;
-               seq_printf(seq, "proc%d %d",
+               seq_printf(seq, "proc%u %u",
                                        vers->number, vers->nrprocs);
                for (j = 0; j < vers->nrprocs; j++)
-                       seq_printf(seq, " %d",
+                       seq_printf(seq, " %u",
                                        vers->procs[j].p_count);
                seq_putc(seq, '\n');
        }
@@ -83,13 +83,13 @@ void svc_seq_show(struct seq_file *seq, 
        int             i, j;
 
        seq_printf(seq,
-               "net %d %d %d %d\n",
+               "net %u %u %u %u\n",
                        statp->netcnt,
                        statp->netudpcnt,
                        statp->nettcpcnt,
                        statp->nettcpconn);
        seq_printf(seq,
-               "rpc %d %d %d %d %d\n",
+               "rpc %u %u %u %u %u\n",
                        statp->rpccnt,
                        statp->rpcbadfmt+statp->rpcbadauth+statp->rpcbadclnt,
                        statp->rpcbadfmt,
@@ -99,9 +99,9 @@ void svc_seq_show(struct seq_file *seq, 
        for (i = 0; i < prog->pg_nvers; i++) {
                if (!(vers = prog->pg_vers[i]) || !(proc = vers->vs_proc))
                        continue;
-               seq_printf(seq, "proc%d %d", i, vers->vs_nproc);
+               seq_printf(seq, "proc%d %u", i, vers->vs_nproc);
                for (j = 0; j < vers->vs_nproc; j++, proc++)
-                       seq_printf(seq, " %d", proc->pc_count);
+                       seq_printf(seq, " %u", proc->pc_count);
                seq_putc(seq, '\n');
        }
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to