From patchwork Fri Aug 16 07:33:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 267563 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A0E3D2C023B for ; Fri, 16 Aug 2013 17:33:53 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754178Ab3HPHdw (ORCPT ); Fri, 16 Aug 2013 03:33:52 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:22494 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752511Ab3HPHdv (ORCPT ); Fri, 16 Aug 2013 03:33:51 -0400 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r7G7XjpY019299 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 Aug 2013 07:33:46 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7G7XibL004638 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 16 Aug 2013 07:33:45 GMT Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7G7Xi61008993; Fri, 16 Aug 2013 07:33:44 GMT Received: from elgon.mountain (/41.202.233.180) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 16 Aug 2013 00:33:43 -0700 Date: Fri, 16 Aug 2013 10:33:36 +0300 From: Dan Carpenter To: Tejun Heo Cc: Grant Likely , Rob Herring , linux-ide@vger.kernel.org, devicetree@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] sata, highbank: clear whole array in highbank_initialize_phys() Message-ID: <20130816073336.GA9881@elgon.mountain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org The problem is that we use "CPHY_PORT_COUNT" as the size of the tx_atten[] array, but that's the number of elements and not the number of bytes. I've changed it to use sizeof(tx_atten) instead. The other two calls to memset() were correct but I changed them as well for consistency. Signed-off-by: Dan Carpenter --- We don't clear the cphy_base[] array. I don't know the code well enough to say if that is intentional or not. -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c index 7f5e5d9..6abe2d5 100644 --- a/drivers/ata/sata_highbank.c +++ b/drivers/ata/sata_highbank.c @@ -347,9 +347,9 @@ static int highbank_initialize_phys(struct device *dev, void __iomem *addr) 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); + memset(port_data, 0, sizeof(port_data)); + memset(phy_nodes, 0, sizeof(phy_nodes)); + memset(tx_atten, 0xff, sizeof(tx_atten)); do { u32 tmp;