lkml.org 
[lkml]   [2006]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2.6.19-rc1 1/3] ieee1394: lock smaller region by host_num_alloc mutex
We need the mutex only around the iteration over existing hosts.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
This prepares hosts.c for the following patch which adds checks of
driver core errors.

Index: linux-2.6.19-rc1/drivers/ieee1394/hosts.c
===================================================================
--- linux-2.6.19-rc1.orig/drivers/ieee1394/hosts.c 2006-10-10 19:06:06.000000000 +0200
+++ linux-2.6.19-rc1/drivers/ieee1394/hosts.c 2006-10-10 19:07:36.000000000 +0200
@@ -156,10 +156,9 @@ struct hpsb_host *hpsb_alloc_host(struct
h->speed_map = (u8 *)(h->csr.speed_map + 2);

mutex_lock(&host_num_alloc);
-
while (nodemgr_for_each_host(&hostnum, alloc_hostnum_cb))
hostnum++;
-
+ mutex_unlock(&host_num_alloc);
h->id = hostnum;

memcpy(&h->device, &nodemgr_dev_template_host, sizeof(h->device));
@@ -174,8 +173,6 @@ struct hpsb_host *hpsb_alloc_host(struct
class_device_register(&h->class_dev);
get_device(&h->device);

- mutex_unlock(&host_num_alloc);
-
return h;
}


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

\
 
 \ /
  Last update: 2006-10-10 21:15    [W:0.074 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site