diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index d23ed60483c37b38b77f933a52bd71b4ee1b4794..42adc052b149251a46e3ac8a1bf039c91f00417f 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -201,7 +201,7 @@ static void p9_virtio_close(struct p9_trans *trans)
 {
 	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);
diff --git a/net/9p/util.c b/net/9p/util.c
index 4d564604533052124e168365395cbad546e5ccbc..958fc58cd1ffbb0723552b180302c569387adfb4 100644
--- a/net/9p/util.c
+++ b/net/9p/util.c
@@ -88,7 +88,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)
@@ -120,7 +120,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);