public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: scalar tests on pointers
@ 2009-04-26 14:56 Roel Kluin
  0 siblings, 0 replies; only message in thread
From: Roel Kluin @ 2009-04-26 14:56 UTC (permalink / raw)
  To: Greg KH; +Cc: lkml, Andrew Morton

RTUSBCmdThr_pid, TimerQThr_pid and MLMEThr_pid are pointers.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
I think this is correct, right?

diff --git a/drivers/staging/rt3070/2870_main_dev.c b/drivers/staging/rt3070/2870_main_dev.c
index 401ddb0..6f405f9 100644
--- a/drivers/staging/rt3070/2870_main_dev.c
+++ b/drivers/staging/rt3070/2870_main_dev.c
@@ -976,7 +976,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();
@@ -998,7 +998,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;
 
diff --git a/drivers/staging/rt3070/common/rtusb_io.c b/drivers/staging/rt3070/common/rtusb_io.c
index a6a52e3..aa6eecc 100644
--- a/drivers/staging/rt3070/common/rtusb_io.c
+++ b/drivers/staging/rt3070/common/rtusb_io.c
@@ -873,7 +873,7 @@ NDIS_STATUS	RTUSBEnqueueCmdFromNdis(
 	POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
 
 
-	if (pObj->RTUSBCmdThr_pid < 0)
+	if (pid_nr(pObj->RTUSBCmdThr_pid) < 0)
 		return (NDIS_STATUS_RESOURCES);
 
 	status = RTMPAllocateMemory((PVOID *)&cmdqelmt, sizeof(CmdQElmt));
diff --git a/drivers/staging/rt3070/rt2870.h b/drivers/staging/rt3070/rt2870.h
index d32a2bf..193bff4 100644
--- a/drivers/staging/rt3070/rt2870.h
+++ b/drivers/staging/rt3070/rt2870.h
@@ -567,18 +567,18 @@ VOID RTUSBBulkOutPsPollComplete(purbb_t pUrb, struct pt_regs *pt_regs);
 VOID RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs);
 
 
-#define RTUSBMlmeUp(pAd)	        \
-{								    \
+#define RTUSBMlmeUp(pAd)				\
+{							\
 	POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;	\
-	if(pObj->MLMEThr_pid>0)		    \
-        up(&(pAd->mlme_semaphore)); \
+	if (pid_nr(pObj->MLMEThr_pid) > 0)		\
+		up(&(pAd->mlme_semaphore));		\
 }
 
-#define RTUSBCMDUp(pAd)	                \
-{									    \
+#define RTUSBCMDUp(pAd)					\
+{							\
 	POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;	\
-	if(pObj->RTUSBCmdThr_pid>0)		    \
-	    up(&(pAd->RTUSBCmd_semaphore)); \
+	if (pid_nr(pObj->RTUSBCmdThr_pid) > 0)		\
+		up(&(pAd->RTUSBCmd_semaphore));		\
 }
 
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-04-26 14:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-26 14:56 [PATCH] staging: scalar tests on pointers Roel Kluin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox