From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: "Greg Kroah-Hartman" <gregkh@suse.de>
Cc: devel@driverdev.osuosl.org,
Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 06/22] Staging: rtxxx0: PID checking fixes
Date: Sun, 16 Aug 2009 21:30:12 +0200 [thread overview]
Message-ID: <20090816193012.3789.83965.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20090816192934.3789.3648.sendpatchset@localhost.localdomain>
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] Staging: rtxxx0: PID checking fixes
* rt3070:
- add missing pid_nr() invocations
* rt{28,30}70:
- do not treat PID 0 as valid
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/staging/rt2860/rt_linux.h | 2 +-
drivers/staging/rt2870/2870_main_dev.c | 6 +++---
drivers/staging/rt2870/rt2870.h | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
Index: b/drivers/staging/rt2860/rt_linux.h
===================================================================
--- a/drivers/staging/rt2860/rt_linux.h
+++ b/drivers/staging/rt2860/rt_linux.h
@@ -166,7 +166,7 @@ typedef struct pid * THREAD_PID;
#define THREAD_PID_INIT_VALUE NULL
#define GET_PID(_v) find_get_pid(_v)
#define GET_PID_NUMBER(_v) pid_nr(_v)
-#define CHECK_PID_LEGALITY(_pid) if (pid_nr(_pid) >= 0)
+#define CHECK_PID_LEGALITY(_pid) if (pid_nr(_pid) > 0)
#define KILL_THREAD_PID(_A, _B, _C) kill_pid(_A, _B, _C)
#endif
Index: b/drivers/staging/rt2870/2870_main_dev.c
===================================================================
--- a/drivers/staging/rt2870/2870_main_dev.c
+++ b/drivers/staging/rt2870/2870_main_dev.c
@@ -1061,7 +1061,7 @@ VOID RT28xxThreadTerminate(
}
#endif
#ifdef RT30xx
- if (pObj->MLMEThr_pid)
+ if (pid_nr(pObj->MLMEThr_pid) > 0)
{
printk("Terminate the MLMEThr_pid=%d!\n", pid_nr(pObj->MLMEThr_pid));
mb();
@@ -1082,7 +1082,7 @@ VOID RT28xxThreadTerminate(
}
}
- if (pObj->RTUSBCmdThr_pid >= 0)
+ if (pid_nr(pObj->RTUSBCmdThr_pid) > 0)
{
printk("Terminate the RTUSBCmdThr_pid=%d!\n", pid_nr(pObj->RTUSBCmdThr_pid));
mb();
@@ -1104,7 +1104,7 @@ VOID RT28xxThreadTerminate(
pObj->RTUSBCmdThr_pid = NULL;
}
}
- if (pObj->TimerQThr_pid >= 0)
+ if (pid_nr(pObj->TimerQThr_pid) > 0)
{
POS_COOKIE pObj = (POS_COOKIE)pAd->OS_Cookie;
printk("Terminate the TimerQThr_pid=%d!\n", pid_nr(pObj->TimerQThr_pid));
Index: b/drivers/staging/rt2870/rt2870.h
===================================================================
--- a/drivers/staging/rt2870/rt2870.h
+++ b/drivers/staging/rt2870/rt2870.h
@@ -456,14 +456,14 @@ VOID RTUSBBulkRxComplete(purbb_t pUrb, s
#define RTUSBMlmeUp(pAd) \
{ \
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; \
- if(pObj->MLMEThr_pid>0) \
+ if (pid_nr(pObj->MLMEThr_pid) > 0) \
up(&(pAd->mlme_semaphore)); \
}
#define RTUSBCMDUp(pAd) \
{ \
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; \
- if(pObj->RTUSBCmdThr_pid>0) \
+ if (pid_nr(pObj->RTUSBCmdThr_pid) > 0) \
up(&(pAd->RTUSBCmd_semaphore)); \
}
#endif
next prev parent reply other threads:[~2009-08-16 19:30 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-16 19:29 [PATCH 00/22] Staging: rt{286,287,307}0: various fixes/cleanups Bartlomiej Zolnierkiewicz
2009-08-16 19:29 ` [PATCH 01/22] Staging: rt2870: duplicated code is executed twice in AsicEvaluateRxAnt() Bartlomiej Zolnierkiewicz
2009-08-16 19:29 ` [PATCH 02/22] Staging: rt3070: fix build warnings Bartlomiej Zolnierkiewicz
2009-08-16 19:29 ` [PATCH 03/22] Staging: rtxxx0: remove support for older wireless extensions Bartlomiej Zolnierkiewicz
2009-08-16 19:29 ` [PATCH 04/22] Staging: rtxxx0: remove dead platform specific code Bartlomiej Zolnierkiewicz
2009-08-16 19:30 ` [PATCH 05/22] Staging: rtxxx0: kill RT8270_USB_DEVICES() macro Bartlomiej Zolnierkiewicz
2009-08-16 19:30 ` Bartlomiej Zolnierkiewicz [this message]
2009-08-16 19:30 ` [PATCH 07/22] Staging: rt3070: kill TimerQThr thread first in RT28xxThreadTerminate() Bartlomiej Zolnierkiewicz
2009-08-16 19:30 ` [PATCH 08/22] Staging: rtxxx0: kill PID macros Bartlomiej Zolnierkiewicz
2009-08-16 19:30 ` [PATCH 09/22] Staging: rtxxx0: remove unused defines Bartlomiej Zolnierkiewicz
2009-08-16 19:30 ` [PATCH 10/22] Staging: rtxxx0: unify different RT30xx{Read,Write}RFRegister() flavors Bartlomiej Zolnierkiewicz
2009-08-16 19:30 ` [PATCH 11/22] Staging: rtxxx0: remove superfluous RT30xx ifdefs Bartlomiej Zolnierkiewicz
2009-08-16 19:31 ` [PATCH 12/22] Staging: rtxxx0: unify RT{USB,MP}FilterCalibration() Bartlomiej Zolnierkiewicz
2009-08-16 19:31 ` [PATCH 13/22] Staging: rtxxx0: unify MlmeCheckPsmChange() Bartlomiej Zolnierkiewicz
2009-08-16 19:31 ` [PATCH 14/22] Staging: rtxxx0: unify AsicEvaluateRxAnt() Bartlomiej Zolnierkiewicz
2009-08-16 19:31 ` [PATCH 15/22] Staging: rtxxx0: remove dead DBG_DIAGNOSE code Bartlomiej Zolnierkiewicz
2009-08-16 19:31 ` [PATCH 16/22] Staging: rtxxx0: remove dead virtual adapter support Bartlomiej Zolnierkiewicz
2009-08-16 19:31 ` [PATCH 17/22] Staging: rtxxx0: debug messages fixes Bartlomiej Zolnierkiewicz
2009-08-16 19:31 ` [PATCH 18/22] Staging: rtxxx0: remove unused link_list.h Bartlomiej Zolnierkiewicz
2009-08-16 19:31 ` [PATCH 19/22] Staging: rtxxx0: remove superfluous function prototypes Bartlomiej Zolnierkiewicz
2009-08-16 19:31 ` [PATCH 20/22] Staging: rtxxx0: remove private debugging ioctls Bartlomiej Zolnierkiewicz
2009-08-16 19:32 ` [PATCH 21/22] Staging: rtxxx0: remove private ioctls Bartlomiej Zolnierkiewicz
2009-08-16 19:32 ` [PATCH 22/22] Staging: rtxxx0: remove unused code Bartlomiej Zolnierkiewicz
2009-08-17 3:47 ` [PATCH 00/22] Staging: rt{286,287,307}0: various fixes/cleanups Mike Galbraith
2009-08-17 3:57 ` Mike Galbraith
2009-08-17 4:20 ` Greg KH
2009-08-19 19:25 ` Bartlomiej Zolnierkiewicz
2009-08-20 5:44 ` Mike Galbraith
2009-08-23 13:18 ` Bartlomiej Zolnierkiewicz
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=20090816193012.3789.83965.sendpatchset@localhost.localdomain \
--to=bzolnier@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
/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