mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: linux1394-devel@lists.sourceforge.net
Cc: Jeff Garzik <jeff@garzik.org>, linux-kernel@vger.kernel.org
Subject: [PATCH 2.6.19-rc1 1/3] ieee1394: lock smaller region by host_num_alloc mutex
Date: Tue, 10 Oct 2006 21:11:43 +0200 (CEST)	[thread overview]
Message-ID: <tkrat.f3f45c410340f9b2@s5r6.in-berlin.de> (raw)
In-Reply-To: <452B979C.9030001@garzik.org>

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;
 }
 



  reply	other threads:[~2006-10-10 19:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-10  6:48 [PATCH] firewire: handle sysfs errors Jeff Garzik
2006-10-10  8:38 ` Stefan Richter
2006-10-10 12:52   ` Jeff Garzik
2006-10-10 19:11     ` Stefan Richter [this message]
2006-10-10 19:12       ` [PATCH 2.6.19-rc1 2/3] ieee1394: coding style in hosts.c Stefan Richter
2006-10-10 19:19         ` [PATCH 2.6.19-rc1 3/3] ieee1394: handle sysfs errors Stefan Richter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tkrat.f3f45c410340f9b2@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®