All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Walker <dwalker@mvista.com>
To: akpm@linux-foundation.org
Cc: mingo@elte.hu, linux-kernel@vger.kernel.org, linux@bohmer.net,
	jonathan@jonmasters.org, matthias.kaehlcke@gmail.com,
	kjwinchester@gmail.com
Subject: [PATCH 2/4] prism54: remove questionable down_interruptible usage
Date: Fri, 21 Dec 2007 00:00:02 -0800	[thread overview]
Message-ID: <20071221205858.857235223@mvista.com> (raw)
In-Reply-To: 20071221205848.989157559@mvista.com

[-- Attachment #1: wireless-prism54-fix-down_interruptible-usage.patch --]
[-- Type: text/plain, Size: 1781 bytes --]

Reviewing the semaphore usage I noticed these down_interruptible
calls. Most of these aren't returning anything, so a caller can't
tell if the operation completed or not. prism54_wpa_bss_ie_get()
returns zero, but it's treated as the function failing which doesn't
seem correct.

Signed-off-by: Daniel Walker <dwalker@mvista.com>
---
 drivers/net/wireless/prism54/isl_ioctl.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Index: linux-2.6.23/drivers/net/wireless/prism54/isl_ioctl.c
===================================================================
--- linux-2.6.23.orig/drivers/net/wireless/prism54/isl_ioctl.c
+++ linux-2.6.23/drivers/net/wireless/prism54/isl_ioctl.c
@@ -165,8 +165,7 @@ prism54_update_stats(struct work_struct 
 	struct obj_bss bss, *bss2;
 	union oid_res_t r;
 
-	if (down_interruptible(&priv->stats_sem))
-		return;
+	down(&priv->stats_sem);
 
 /* Noise floor.
  * I'm not sure if the unit is dBm.
@@ -1793,8 +1792,7 @@ prism54_clear_mac(struct islpci_acl *acl
 	struct list_head *ptr, *next;
 	struct mac_entry *entry;
 
-	if (down_interruptible(&acl->sem))
-		return;
+	down(&acl->sem);
 
 	if (acl->size == 0) {
 		up(&acl->sem);
@@ -2116,8 +2114,7 @@ prism54_wpa_bss_ie_add(islpci_private *p
 	if (wpa_ie_len > MAX_WPA_IE_LEN)
 		wpa_ie_len = MAX_WPA_IE_LEN;
 
-	if (down_interruptible(&priv->wpa_sem))
-		return;
+	down(&priv->wpa_sem);
 
 	/* try to use existing entry */
 	list_for_each(ptr, &priv->bss_wpa_list) {
@@ -2178,8 +2175,7 @@ prism54_wpa_bss_ie_get(islpci_private *p
 	struct islpci_bss_wpa_ie *bss = NULL;
 	size_t len = 0;
 
-	if (down_interruptible(&priv->wpa_sem))
-		return 0;
+	down(&priv->wpa_sem);
 
 	list_for_each(ptr, &priv->bss_wpa_list) {
 		bss = list_entry(ptr, struct islpci_bss_wpa_ie, list);

-- 

  parent reply	other threads:[~2007-12-21 21:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-21  8:00 [PATCH 1/4] usb microtek: remove unused semaphore Daniel Walker
2007-12-21  8:00 ` Daniel Walker
2007-12-21  8:00 ` Daniel Walker [this message]
2007-12-21  8:00 ` [PATCH 3/4] docs: convert kref semaphore to mutex Daniel Walker
2007-12-21 21:33   ` Corey Minyard
2007-12-21  8:00 ` [PATCH 4/4] usb: libusual: locking cleanup Daniel Walker
2007-12-22  4:22   ` Andrew Morton
2007-12-22  6:24   ` Pete Zaitcev
2007-12-22  6:31     ` Andrew Morton
2007-12-22 17:01     ` Daniel Walker
2007-12-23  7:37       ` Pete Zaitcev
2007-12-23 16:46         ` Daniel Walker
2007-12-24 14:12           ` Pete Zaitcev
2007-12-24 16:04             ` Daniel Walker

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=20071221205858.857235223@mvista.com \
    --to=dwalker@mvista.com \
    --cc=akpm@linux-foundation.org \
    --cc=jonathan@jonmasters.org \
    --cc=kjwinchester@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@bohmer.net \
    --cc=matthias.kaehlcke@gmail.com \
    --cc=mingo@elte.hu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.