Skip to contentSkip to conversation

Staging: vt6656: Remove the ULONG_PTR and DWORD_PTR defines from ttype.h

PATCH In review Roel Van Nyen 3 participants 5 messages Jul 12, 2010 – Aug 31, 2010 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: vt6656: Remove the ULONG_PTR and DWORD_PTR defines from ttype.h

Remove the ULONG and DWORD PTR defines from ttype.h

---
 drivers/staging/vt6656/bssdb.c |    8 ++++----
 drivers/staging/vt6656/ttype.h |    3 ---
 2 files changed, 4 insertions(+), 7 deletions(-)
drivers/staging/vt6656/bssdb.c +4 -4
index 830dd23..0b8584b 100644
@@ -469,7 +469,7 @@ BOOL BSSbInsertToBSSList(void *hDeviceContext,
 	unsigned int uLen = pRSNWPA->len + 2;
 
 	if (uLen <= (uIELength -
-		     (unsigned int) (ULONG_PTR) ((PBYTE) pRSNWPA - pbyIEs))) {
+		     (unsigned int) (unsigned long) ((PBYTE) pRSNWPA - pbyIEs))) {
 		pBSSList->wWPALen = uLen;
 		memcpy(pBSSList->byWPAIE, pRSNWPA, uLen);
 		WPA_ParseRSN(pBSSList, pRSNWPA);
@@ -482,7 +482,7 @@ BOOL BSSbInsertToBSSList(void *hDeviceContext,
 	unsigned int uLen = pRSN->len + 2;
 
 	if (uLen <= (uIELength -
-		     (unsigned int) (ULONG_PTR) ((PBYTE) pRSN - pbyIEs))) {
+		     (unsigned int) (unsigned long) ((PBYTE) pRSN - pbyIEs))) {
 		pBSSList->wRSNLen = uLen;
 		memcpy(pBSSList->byRSNIE, pRSN, uLen);
 		WPA2vParseRSN(pBSSList, pRSN);
@@ -674,7 +674,7 @@ BOOL BSSbUpdateToBSSList(void *hDeviceContext,
    if (pRSNWPA != NULL) {
 	unsigned int uLen = pRSNWPA->len + 2;
 	if (uLen <= (uIELength -
-		     (unsigned int) (ULONG_PTR) ((PBYTE) pRSNWPA - pbyIEs))) {
+		     (unsigned int) (unsigned long) ((PBYTE) pRSNWPA - pbyIEs))) {
 		pBSSList->wWPALen = uLen;
 		memcpy(pBSSList->byWPAIE, pRSNWPA, uLen);
 		WPA_ParseRSN(pBSSList, pRSNWPA);
@@ -686,7 +686,7 @@ BOOL BSSbUpdateToBSSList(void *hDeviceContext,
     if (pRSN != NULL) {
 	unsigned int uLen = pRSN->len + 2;
 	if (uLen <= (uIELength -
-			(unsigned int) (ULONG_PTR) ((PBYTE) pRSN - pbyIEs))) {
+			(unsigned int) (unsigned long) ((PBYTE) pRSN - pbyIEs))) {
 		pBSSList->wRSNLen = uLen;
 		memcpy(pBSSList->byRSNIE, pRSN, uLen);
 		WPA2vParseRSN(pBSSList, pRSN);
drivers/staging/vt6656/ttype.h +0 -3
index 3425773..42091c4 100644
@@ -83,9 +83,6 @@ typedef UQuadWord       QWORD;          // 64-bit
 
 /****** Common pointer types ***********************************************/
 
-typedef unsigned long   ULONG_PTR;      // 32-bit
-typedef unsigned long   DWORD_PTR;      // 32-bit
-
 // boolean pointer
 typedef unsigned int *   PUINT;
 
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 65 lines · Roel Van Nyen

Remove the ULONG and DWORD PTR defines from ttype.h

---
 drivers/staging/vt6656/bssdb.c |    8 ++++----
 drivers/staging/vt6656/ttype.h |    3 ---
 2 files changed, 4 insertions(+), 7 deletions(-)
drivers/staging/vt6656/bssdb.c +4 -4
index 830dd23..0b8584b 100644
@@ -469,7 +469,7 @@ BOOL BSSbInsertToBSSList(void *hDeviceContext,
 	unsigned int uLen = pRSNWPA->len + 2;
 
 	if (uLen <= (uIELength -
-		     (unsigned int) (ULONG_PTR) ((PBYTE) pRSNWPA - pbyIEs))) {
+		     (unsigned int) (unsigned long) ((PBYTE) pRSNWPA - pbyIEs))) {
 		pBSSList->wWPALen = uLen;
 		memcpy(pBSSList->byWPAIE, pRSNWPA, uLen);
 		WPA_ParseRSN(pBSSList, pRSNWPA);
@@ -482,7 +482,7 @@ BOOL BSSbInsertToBSSList(void *hDeviceContext,
 	unsigned int uLen = pRSN->len + 2;
 
 	if (uLen <= (uIELength -
-		     (unsigned int) (ULONG_PTR) ((PBYTE) pRSN - pbyIEs))) {
+		     (unsigned int) (unsigned long) ((PBYTE) pRSN - pbyIEs))) {
 		pBSSList->wRSNLen = uLen;
 		memcpy(pBSSList->byRSNIE, pRSN, uLen);
 		WPA2vParseRSN(pBSSList, pRSN);
@@ -674,7 +674,7 @@ BOOL BSSbUpdateToBSSList(void *hDeviceContext,
    if (pRSNWPA != NULL) {
 	unsigned int uLen = pRSNWPA->len + 2;
 	if (uLen <= (uIELength -
-		     (unsigned int) (ULONG_PTR) ((PBYTE) pRSNWPA - pbyIEs))) {
+		     (unsigned int) (unsigned long) ((PBYTE) pRSNWPA - pbyIEs))) {
 		pBSSList->wWPALen = uLen;
 		memcpy(pBSSList->byWPAIE, pRSNWPA, uLen);
 		WPA_ParseRSN(pBSSList, pRSNWPA);
@@ -686,7 +686,7 @@ BOOL BSSbUpdateToBSSList(void *hDeviceContext,
     if (pRSN != NULL) {
 	unsigned int uLen = pRSN->len + 2;
 	if (uLen <= (uIELength -
-			(unsigned int) (ULONG_PTR) ((PBYTE) pRSN - pbyIEs))) {
+			(unsigned int) (unsigned long) ((PBYTE) pRSN - pbyIEs))) {
 		pBSSList->wRSNLen = uLen;
 		memcpy(pBSSList->byRSNIE, pRSN, uLen);
 		WPA2vParseRSN(pBSSList, pRSN);
drivers/staging/vt6656/ttype.h +0 -3
index 3425773..42091c4 100644
@@ -83,9 +83,6 @@ typedef UQuadWord       QWORD;          // 64-bit
 
 /****** Common pointer types ***********************************************/
 
-typedef unsigned long   ULONG_PTR;      // 32-bit
-typedef unsigned long   DWORD_PTR;      // 32-bit
-
 // boolean pointer
 typedef unsigned int *   PUINT;
 
Signature · 1 line
1.7.0.4

Hi Greg,

I have re-done my patch and this time without any checkpatch.pl errors.

Remove DWORD_PTR and ULONG_PTR from ttype.h

---
 drivers/staging/vt6656/bssdb.c |    8 ++++----
 drivers/staging/vt6656/ttype.h |    4 ----
 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/staging/vt6656/bssdb.c +4 -4
index a9f68bd..024dff3 100644
@@ -466,7 +466,7 @@ BOOL BSSbInsertToBSSList(void *hDeviceContext,
 	unsigned int uLen = pRSNWPA->len + 2;
 
 	if (uLen <= (uIELength -
-		     (unsigned int) (ULONG_PTR) ((PBYTE) pRSNWPA - pbyIEs))) {
+	(unsigned int) (unsigned long) ((PBYTE) pRSNWPA - pbyIEs))) {
 		pBSSList->wWPALen = uLen;
 		memcpy(pBSSList->byWPAIE, pRSNWPA, uLen);
 		WPA_ParseRSN(pBSSList, pRSNWPA);
@@ -479,7 +479,7 @@ BOOL BSSbInsertToBSSList(void *hDeviceContext,
 	unsigned int uLen = pRSN->len + 2;
 
 	if (uLen <= (uIELength -
-		     (unsigned int) (ULONG_PTR) ((PBYTE) pRSN - pbyIEs))) {
+	(unsigned int) (unsigned long) ((PBYTE) pRSN - pbyIEs))) {
 		pBSSList->wRSNLen = uLen;
 		memcpy(pBSSList->byRSNIE, pRSN, uLen);
 		WPA2vParseRSN(pBSSList, pRSN);
@@ -671,7 +671,7 @@ BOOL BSSbUpdateToBSSList(void *hDeviceContext,
    if (pRSNWPA != NULL) {
 	unsigned int uLen = pRSNWPA->len + 2;
 	if (uLen <= (uIELength -
-		     (unsigned int) (ULONG_PTR) ((PBYTE) pRSNWPA - pbyIEs))) {
+	(unsigned int) (unsigned long) ((PBYTE) pRSNWPA - pbyIEs))) {
 		pBSSList->wWPALen = uLen;
 		memcpy(pBSSList->byWPAIE, pRSNWPA, uLen);
 		WPA_ParseRSN(pBSSList, pRSNWPA);
@@ -683,7 +683,7 @@ BOOL BSSbUpdateToBSSList(void *hDeviceContext,
     if (pRSN != NULL) {
 	unsigned int uLen = pRSN->len + 2;
 	if (uLen <= (uIELength -
-			(unsigned int) (ULONG_PTR) ((PBYTE) pRSN - pbyIEs))) {
+	(unsigned int) (unsigned long) ((PBYTE) pRSN - pbyIEs))) {
 		pBSSList->wRSNLen = uLen;
 		memcpy(pBSSList->byRSNIE, pRSN, uLen);
 		WPA2vParseRSN(pBSSList, pRSN);
drivers/staging/vt6656/ttype.h +0 -4
index 8e9450e..e8ed3ff 100644
@@ -59,10 +59,6 @@ typedef union tagUQuadWord {
 typedef UQuadWord       QWORD;          // 64-bit
 
 /****** Common pointer types ***********************************************/
-
-typedef unsigned long   ULONG_PTR;      // 32-bit
-typedef unsigned long   DWORD_PTR;      // 32-bit
-
 // boolean pointer
 
 typedef BYTE *           PBYTE;
Signature · 1 line
1.7.0.4
#2 lore raw

Hi greg,

Did you see my previous mail with this patch or did it get lost in the noise ?

Thanks,
Roel

2010/8/5 Roel Van Nyen <[email protected]>:

Quoted 138 lines · Roel Van Nyen
Quoted 63 lines

Remove the ULONG and DWORD PTR defines from ttype.h

---
 drivers/staging/vt6656/bssdb.c |    8 ++++----
 drivers/staging/vt6656/ttype.h |    3 ---

 2 files changed, 4 insertions(+), 7 deletions(-)
drivers/staging/vt6656/bssdb.c +0 -0
index 830dd23..0b8584b 100644
@@ -469,7 +469,7 @@ BOOL BSSbInsertToBSSList(void *hDeviceContext,
       unsigned int uLen = pRSNWPA->len + 2;
 

      if (uLen <= (uIELength -
-                  (unsigned int) (ULONG_PTR) ((PBYTE) pRSNWPA - pbyIEs))) {
+                  (unsigned int) (unsigned long) ((PBYTE) pRSNWPA - pbyIEs))) { pBSSList->wWPALen = uLen;
              memcpy(pBSSList->byWPAIE, pRSNWPA, uLen); WPA_ParseRSN(pBSSList, pRSNWPA);

drivers/staging/vt6656/bssdb.c +0 -0
@@ -482,7 +482,7 @@ BOOL BSSbInsertToBSSList(void *hDeviceContext,
       unsigned int uLen = pRSN->len + 2;
 

      if (uLen <= (uIELength -
-                  (unsigned int) (ULONG_PTR) ((PBYTE) pRSN - pbyIEs))) {
+                  (unsigned int) (unsigned long) ((PBYTE) pRSN - pbyIEs))) { pBSSList->wRSNLen = uLen;
              memcpy(pBSSList->byRSNIE, pRSN, uLen); WPA2vParseRSN(pBSSList, pRSN);

drivers/staging/vt6656/bssdb.c +0 -0
@@ -674,7 +674,7 @@ BOOL BSSbUpdateToBSSList(void *hDeviceContext,
     if (pRSNWPA != NULL) {
       unsigned int uLen = pRSNWPA->len + 2;

      if (uLen <= (uIELength -
-                  (unsigned int) (ULONG_PTR) ((PBYTE) pRSNWPA - pbyIEs))) {
+                  (unsigned int) (unsigned long) ((PBYTE) pRSNWPA - pbyIEs))) { pBSSList->wWPALen = uLen;
              memcpy(pBSSList->byWPAIE, pRSNWPA, uLen); WPA_ParseRSN(pBSSList, pRSNWPA);

drivers/staging/vt6656/bssdb.c +0 -0
@@ -686,7 +686,7 @@ BOOL BSSbUpdateToBSSList(void *hDeviceContext,
      if (pRSN != NULL) {
       unsigned int uLen = pRSN->len + 2;

      if (uLen <= (uIELength -
-                     (unsigned int) (ULONG_PTR) ((PBYTE) pRSN - pbyIEs))) {
+                     (unsigned int) (unsigned long) ((PBYTE) pRSN - pbyIEs))) { pBSSList->wRSNLen = uLen;
              memcpy(pBSSList->byRSNIE, pRSN, uLen); WPA2vParseRSN(pBSSList, pRSN);

drivers/staging/vt6656/ttype.h +0 -4
index 3425773..42091c4 100644
@@ -83,9 +83,6 @@ typedef UQuadWord       QWORD;          // 64-bit
 
  /****** Common pointer types ***********************************************/
 
-typedef unsigned long   ULONG_PTR;      // 32-bit
-typedef unsigned long   DWORD_PTR;      // 32-bit
-
  // boolean pointer
  typedef unsigned int *   PUINT;
 
--
Quoted 2 lines

1.7.0.4

Hi Greg,

I have re-done my patch and this time without any checkpatch.pl errors.

Remove DWORD_PTR and ULONG_PTR from ttype.h

---
 drivers/staging/vt6656/bssdb.c |    8 ++++----
 drivers/staging/vt6656/ttype.h |    4 ----

 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/staging/vt6656/bssdb.c +0 -0
index a9f68bd..024dff3 100644
@@ -466,7 +466,7 @@ BOOL BSSbInsertToBSSList(void *hDeviceContext,
        unsigned int uLen = pRSNWPA->len + 2;
 

       if (uLen <= (uIELength -
-                    (unsigned int) (ULONG_PTR) ((PBYTE) pRSNWPA - pbyIEs))) {
+       (unsigned int) (unsigned long) ((PBYTE) pRSNWPA - pbyIEs))) { pBSSList->wWPALen = uLen; memcpy(pBSSList->byWPAIE, pRSNWPA, uLen); WPA_ParseRSN(pBSSList, pRSNWPA);

drivers/staging/vt6656/bssdb.c +0 -0
@@ -479,7 +479,7 @@ BOOL BSSbInsertToBSSList(void *hDeviceContext,
        unsigned int uLen = pRSN->len + 2;
 

       if (uLen <= (uIELength -
-                    (unsigned int) (ULONG_PTR) ((PBYTE) pRSN - pbyIEs))) {
+       (unsigned int) (unsigned long) ((PBYTE) pRSN - pbyIEs))) { pBSSList->wRSNLen = uLen; memcpy(pBSSList->byRSNIE, pRSN, uLen); WPA2vParseRSN(pBSSList, pRSN);

drivers/staging/vt6656/bssdb.c +0 -0
@@ -671,7 +671,7 @@ BOOL BSSbUpdateToBSSList(void *hDeviceContext,
    if (pRSNWPA != NULL) {
        unsigned int uLen = pRSNWPA->len + 2;

       if (uLen <= (uIELength -
-                    (unsigned int) (ULONG_PTR) ((PBYTE) pRSNWPA - pbyIEs))) {
+       (unsigned int) (unsigned long) ((PBYTE) pRSNWPA - pbyIEs))) { pBSSList->wWPALen = uLen; memcpy(pBSSList->byWPAIE, pRSNWPA, uLen); WPA_ParseRSN(pBSSList, pRSNWPA);

drivers/staging/vt6656/bssdb.c +0 -0
@@ -683,7 +683,7 @@ BOOL BSSbUpdateToBSSList(void *hDeviceContext,
     if (pRSN != NULL) {
        unsigned int uLen = pRSN->len + 2;

       if (uLen <= (uIELength -
-                       (unsigned int) (ULONG_PTR) ((PBYTE) pRSN - pbyIEs))) {
+       (unsigned int) (unsigned long) ((PBYTE) pRSN - pbyIEs))) { pBSSList->wRSNLen = uLen; memcpy(pBSSList->byRSNIE, pRSN, uLen); WPA2vParseRSN(pBSSList, pRSN);

drivers/staging/vt6656/ttype.h +0 -0
index 8e9450e..e8ed3ff 100644
@@ -59,10 +59,6 @@ typedef union tagUQuadWord {

 typedef UQuadWord       QWORD;          // 64-bit

 /****** Common pointer types ***********************************************/

drivers/staging/vt6656/ttype.h +0 -4
-
-typedef unsigned long   ULONG_PTR;      // 32-bit
-typedef unsigned long   DWORD_PTR;      // 32-bit
-

 // boolean pointer

 typedef BYTE *           PBYTE;
--
1.7.0.4

#3 lore raw
Quoted 3 lines · Roel Van Nyen

Hi greg,

Did you see my previous mail with this patch or did it get lost in the noise ?

I have it, but it was during the merge window so I will queue it up in a few days for the next major merge window.

thanks for your patience.

greg k-h

#4 lore raw
In reply to Roel Van Nyen
Quoted 1 line · Roel Van Nyen

I have re-done my patch and this time without any checkpatch.pl errors.

Well, some you can ignore:

Quoted 14 lines

Remove DWORD_PTR and ULONG_PTR from ttype.h

---
 drivers/staging/vt6656/bssdb.c |    8 ++++----
 drivers/staging/vt6656/ttype.h |    4 ----
 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/staging/vt6656/bssdb.c +0 -0
index a9f68bd..024dff3 100644

drivers/staging/vt6656/bssdb.c BOOL BSSbInsertToBSSList(void *hDeviceContext, · line 469

Quoted 5 lines
drivers/staging/vt6656/bssdb.c +1 -1
@@ -466,7 +466,7 @@ BOOL BSSbInsertToBSSList(void *hDeviceContext,
 	unsigned int uLen = pRSNWPA->len + 2;
 
 	if (uLen <= (uIELength -
-		     (unsigned int) (ULONG_PTR) ((PBYTE) pRSNWPA - pbyIEs))) {
+	(unsigned int) (unsigned long) ((PBYTE) pRSNWPA - pbyIEs))) {

That's just horrible, move it to the right like it was, just don't add the extra spaces where they are not needed. And think, why would you want to cast from an unsigned long and then to an unsigned int, something is really wrong with that code, it should be fixed properly.

Care to try again?

thanks,

greg k-h