public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bcm/CmHost.c: Fix noisy compile warnings
@ 2014-10-15 12:26 Jeff Kirsher
  2014-10-15 12:33 ` Joe Perches
  2014-10-15 12:34 ` Dan Carpenter
  0 siblings, 2 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-10-15 12:26 UTC (permalink / raw)
  To: gregkh; +Cc: Jeff Kirsher, linux-kernel, mail, devel

The Beceem WIMAX was generating compile warnings on 64bit machines,
which were:

drivers/staging/bcm/CmHost.c: In function ‘StoreCmControlResponseMessage’:
drivers/staging/bcm/CmHost.c:1503:3: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   (struct bcm_connect_mgr_params *) ntohl(
   ^
drivers/staging/bcm/CmHost.c:1546:3: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   (struct bcm_connect_mgr_params *) ntohl(
   ^
drivers/staging/bcm/CmHost.c:1564:3: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   (struct bcm_connect_mgr_params *) ntohl(

This resolves the issue by generating 64bit friendly code.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/staging/bcm/CmHost.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index adca0ce..29fa05d 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -1499,9 +1499,15 @@ ULONG StoreCmControlResponseMessage(struct bcm_mini_adapter *Adapter,
 	}
 
 	/* this can't possibly be right */
+#ifdef CONFIG_32BIT
 	pstAddIndication->psfAuthorizedSet =
 		(struct bcm_connect_mgr_params *) ntohl(
 				(ULONG)pstAddIndication->psfAuthorizedSet);
+#else
+	pstAddIndication->psfAuthorizedSet =
+		(struct bcm_connect_mgr_params *)(u64)ntohl(
+				(ULONG)pstAddIndication->psfAuthorizedSet);
+#endif
 
 	if (pstAddIndicationAlt->u8Type == DSA_REQ) {
 		struct bcm_add_request AddRequest;
@@ -1542,9 +1548,15 @@ ULONG StoreCmControlResponseMessage(struct bcm_mini_adapter *Adapter,
 		return 0;
 	}
 
+#ifdef CONFIG_32BIT
 	pstAddIndication->psfAdmittedSet =
 		(struct bcm_connect_mgr_params *) ntohl(
 				(ULONG) pstAddIndication->psfAdmittedSet);
+#else
+	pstAddIndication->psfAdmittedSet =
+		(struct bcm_connect_mgr_params *)(u64)ntohl(
+				(ULONG) pstAddIndication->psfAdmittedSet);
+#endif
 
 	/* ACTIVE SET */
 	pstAddIndication->psfActiveSet = (struct bcm_connect_mgr_params *)
@@ -1560,9 +1572,15 @@ ULONG StoreCmControlResponseMessage(struct bcm_mini_adapter *Adapter,
 		return 0;
 	}
 
+#ifdef CONFIG_32BIT
 	pstAddIndication->psfActiveSet =
 		(struct bcm_connect_mgr_params *) ntohl(
 				(ULONG)pstAddIndication->psfActiveSet);
+#else
+	pstAddIndication->psfActiveSet =
+		(struct bcm_connect_mgr_params *)(u64)ntohl(
+				(ULONG)pstAddIndication->psfActiveSet);
+#endif
 
 	(*puBufferLength) = sizeof(struct bcm_add_indication);
 	*(struct bcm_add_indication *)pvBuffer = *pstAddIndication;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2014-10-16  7:55 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-15 12:26 [PATCH] bcm/CmHost.c: Fix noisy compile warnings Jeff Kirsher
2014-10-15 12:33 ` Joe Perches
2014-10-15 12:34 ` Dan Carpenter
2014-10-15 12:59   ` Dan Carpenter
2014-10-15 13:03     ` Jeff Kirsher
2014-10-15 16:11       ` Joe Perches
2014-10-15 17:42         ` Jeff Kirsher
2014-10-15 18:24           ` Fabio Estevam
2014-10-15 18:54             ` Jeff Kirsher
2014-10-15 18:56               ` Joe Perches
2014-10-15 18:56               ` Fabio Estevam
2014-10-15 19:53         ` Dan Carpenter
2014-10-15 20:03           ` Joe Perches
2014-10-16  7:48             ` Dan Carpenter
2014-10-16  7:54               ` Jeff Kirsher
2014-10-15 21:41       ` Matthias Beyer
2014-10-15 22:19         ` Jeff Kirsher
2014-10-15 22:24           ` Matthias Beyer
2014-10-15 22:41             ` Jeff Kirsher

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