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]
Message-ID: <20130823094920.GP31293@elgon.mountain>
Date:	Fri, 23 Aug 2013 12:49:20 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Grant Likely <grant.likely@...aro.org>
Cc:	Rob Herring <rob.herring@...xeda.com>,
	"David S. Miller" <davem@...emloft.net>,
	Fabio Estevam <fabio.estevam@...escale.com>,
	Frank Li <Frank.Li@...escale.com>,
	Jim Baxter <jim_baxter@...tor.com>,
	Fugang Duan <B38611@...escale.com>, netdev@...r.kernel.org,
	devicetree@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [patch] net/fec: "u32" is more explicit than "unsigned long"

tmpaddr[] is a six byte array.  We want to set the first four bytes on
the first line and the remaining two on the next line.  The code assumes
that "unsigned long" is 32 bits and obviously that's not true on 64 bit
arches.  It's better to just use u32 instead.

Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
---
This is a static checker thing and I can't compile this file.

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index fdf9307..422b125 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1100,9 +1100,9 @@ static void fec_get_mac(struct net_device *ndev)
 	 * 4) FEC mac registers set by bootloader
 	 */
 	if (!is_valid_ether_addr(iap)) {
-		*((unsigned long *) &tmpaddr[0]) =
+		*((u32 *) &tmpaddr[0]) =
 			be32_to_cpu(readl(fep->hwp + FEC_ADDR_LOW));
-		*((unsigned short *) &tmpaddr[4]) =
+		*((u16 *) &tmpaddr[4]) =
 			be16_to_cpu(readl(fep->hwp + FEC_ADDR_HIGH) >> 16);
 		iap = &tmpaddr[0];
 	}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ