lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 15 Oct 2014 05:26:39 -0700
From:	Jeff Kirsher <jeffrey.t.kirsher@...el.com>
To:	gregkh@...uxfoundation.org
Cc:	Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
	linux-kernel@...r.kernel.org, mail@...ermatthias.de,
	devel@...verdev.osuosl.org
Subject: [PATCH] bcm/CmHost.c: Fix noisy compile warnings

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@...el.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ