[PATCH] fix flags length in net 9p

From: Steven Rostedt
Date: Thu May 01 2008 - 17:08:19 EST



Some files in the net/9p directory uses "int" for flags. This can
cause hard to find bugs on some architectures. This patch converts the
flags to use "long" instead.

This bug was discovered by doing an allyesconfig make on the -rt kernel
where checks are done to ensure all flags are of size sizeof(long).

Signed-off-by: Steven Rostedt <srostedt@xxxxxxxxxx>
---
net/9p/trans_virtio.c | 2 +-
net/9p/util.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

Index: linux-compile.git/net/9p/trans_virtio.c
===================================================================
--- linux-compile.git.orig/net/9p/trans_virtio.c 2008-04-09 18:45:15.000000000 -0400
+++ linux-compile.git/net/9p/trans_virtio.c 2008-05-01 17:02:25.000000000 -0400
@@ -134,7 +134,7 @@ static void p9_virtio_close(struct p9_tr
{
struct virtio_chan *chan = trans->priv;
int count;
- unsigned int flags;
+ unsigned long flags;

spin_lock_irqsave(&chan->lock, flags);
p9_idpool_destroy(chan->tagpool);
Index: linux-compile.git/net/9p/util.c
===================================================================
--- linux-compile.git.orig/net/9p/util.c 2008-02-14 23:09:39.000000000 -0500
+++ linux-compile.git/net/9p/util.c 2008-05-01 17:02:35.000000000 -0400
@@ -71,7 +71,7 @@ int p9_idpool_get(struct p9_idpool *p)
{
int i = 0;
int error;
- unsigned int flags;
+ unsigned long flags;

retry:
if (idr_pre_get(&p->pool, GFP_KERNEL) == 0)
@@ -102,7 +102,7 @@ EXPORT_SYMBOL(p9_idpool_get);

void p9_idpool_put(int id, struct p9_idpool *p)
{
- unsigned int flags;
+ unsigned long flags;
spin_lock_irqsave(&p->lock, flags);
idr_remove(&p->pool, id);
spin_unlock_irqrestore(&p->lock, flags);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/