diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-10-18 08:44:09 (GMT) |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-10-27 12:11:54 (GMT) |
commit | 225f1eaed00255bf25351d1749bfd23e0ff4ce7c (patch) | |
tree | daa46b011144e5cc6bf655695e74d50916ad1e4e /drivers/ata/sata_highbank.c | |
parent | 89dafa20f3daab5b3e0c13d0068a28e8e64e2102 (diff) | |
download | linux-225f1eaed00255bf25351d1749bfd23e0ff4ce7c.tar.xz |
sata_highbank: clear whole array in highbank_initialize_phys()
The original code used the wrong parameter to clear tx_atten[]. It
passed the number of elements instead of sizeof() the array to memset.
The other potential issue was that cphy_base[] wasn't cleared. I'm not
sure if that was a real problem or not, but I have cleared it in my
patch.
Instead of using memset(), this patch uses empty initializers as a
cleanup.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata/sata_highbank.c')
-rw-r--r-- | drivers/ata/sata_highbank.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c index 7f5e5d9..ea3b3dc 100644 --- a/drivers/ata/sata_highbank.c +++ b/drivers/ata/sata_highbank.c @@ -343,13 +343,11 @@ static int highbank_initialize_phys(struct device *dev, void __iomem *addr) { struct device_node *sata_node = dev->of_node; int phy_count = 0, phy, port = 0, i; - void __iomem *cphy_base[CPHY_PHY_COUNT]; - struct device_node *phy_nodes[CPHY_PHY_COUNT]; - u32 tx_atten[CPHY_PORT_COUNT]; + void __iomem *cphy_base[CPHY_PHY_COUNT] = {}; + struct device_node *phy_nodes[CPHY_PHY_COUNT] = {}; + u32 tx_atten[CPHY_PORT_COUNT] = {}; memset(port_data, 0, sizeof(struct phy_lane_info) * CPHY_PORT_COUNT); - memset(phy_nodes, 0, sizeof(struct device_node*) * CPHY_PHY_COUNT); - memset(tx_atten, 0xff, CPHY_PORT_COUNT); do { u32 tmp; |