public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix flags length in net 9p
@ 2008-05-01 21:08 Steven Rostedt
  2008-05-01 21:19 ` Andrew Morton
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Steven Rostedt @ 2008-05-01 21:08 UTC (permalink / raw)
  To: LKML; +Cc: akpm, Latchesar Ionkov, Eric Van Hensbergen


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@redhat.com>
---
 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);


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2008-05-02 11:40 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-01 21:08 [PATCH] fix flags length in net 9p Steven Rostedt
2008-05-01 21:19 ` Andrew Morton
2008-05-01 21:25   ` Steven Rostedt
2008-05-01 21:26   ` Daniel Walker
2008-05-01 21:38     ` Steven Rostedt
2008-05-01 21:41     ` Adrian Bunk
2008-05-01 22:01       ` Daniel Walker
2008-05-01 22:07     ` Andrew Morton
2008-05-01 22:32     ` Alexey Dobriyan
2008-05-01 21:46       ` Steven Rostedt
2008-05-01 22:29   ` Alexey Dobriyan
2008-05-01 21:50     ` Steven Rostedt
2008-05-01 22:15       ` Andrew Morton
2008-05-01 22:03 ` Christoph Hellwig
2008-05-02 11:39 ` Enrico Weigelt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox