linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Grant Likely <grant.likely@linaro.org>,
	Rob Herring <rob.herring@calxeda.com>,
	linux-ide@vger.kernel.org, devicetree@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] sata, highbank: clear whole array in highbank_initialize_phys()
Date: Fri, 16 Aug 2013 12:53:50 -0400	[thread overview]
Message-ID: <20130816165350.GL2505@htj.dyndns.org> (raw)
In-Reply-To: <20130816073336.GA9881@elgon.mountain>

Hello, Dan.

On Fri, Aug 16, 2013 at 10:33:36AM +0300, Dan Carpenter wrote:
> @@ -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));

Ugh... why would anybody name a global variable port_data[]?  So,
port_data is global and the other two are local.  Wouldn't it be
better to just do "= { }" on declaration for the local ones?

Thanks.

-- 
tejun

      reply	other threads:[~2013-08-16 16:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-16  7:33 [patch] sata, highbank: clear whole array in highbank_initialize_phys() Dan Carpenter
2013-08-16 16:53 ` Tejun Heo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130816165350.GL2505@htj.dyndns.org \
    --to=tj@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).