netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: sony.chacko@qlogic.com
Cc: netdev@vger.kernel.org, Dept_NX_Linux_NIC_Driver@qlogic.com
Subject: Re: [PATCH v1 13/19] qlcnic: 83xx hardware access and data path routines
Date: Thu, 20 Sep 2012 18:45:07 -0400 (EDT)	[thread overview]
Message-ID: <20120920.184507.1693343817853439763.davem@davemloft.net> (raw)
In-Reply-To: <1348098373-20745-14-git-send-email-sony.chacko@qlogic.com>

From: Sony Chacko <sony.chacko@qlogic.com>
Date: Wed, 19 Sep 2012 19:46:07 -0400

> +	for (i = QLCNIC_DEV_INFO_SIZE + 1;
> +		j < ARRAY_SIZE(qlcnic_83xx_reg_tbl); i++, j++)

The 'j' on the second line should be at the first column after the
openning parenthesis on the first line.

> +	ahw->intr_tbl = vmalloc(num_msix *
> +			sizeof(struct qlcnic_intrpt_config));

Same problem here.

> +	if (!(adapter->flags & QLCNIC_MSI_ENABLED) &&
> +		!(adapter->flags & QLCNIC_MSIX_ENABLED)) {

And here.

> +		if (ret) {
> +				dev_info(&adapter->pdev->dev,
> +					 "Error getting Rx stats\n");

This dev_info() call is indented one TAB too deeply.

> +	npar_info->max_mtu = le16_to_cpu(nic_info->max_mtu);
> +
> +}

Please remove this extraneous empty line.

> +		if (!((ADDR_IN_RANGE(addr, QLCNIC_ADDR_QDR_NET,
> +			QLCNIC_ADDR_QDR_NET_MAX)) ||
> +				(ADDR_IN_RANGE(addr, QLCNIC_ADDR_DDR_NET,
> +					QLCNIC_ADDR_DDR_NET_MAX)))){

This is improperly indented, function arguments split up into
subsequent lines should line up with the first column after
the openning parenthesis that they are a part of.

On the last line, there needs to be a space between the closing
parenthesis and the openning curly brace.

> +		} else if ((mbx_err_code == QLCNIC_MBX_RSP_OK)
> +				|| (mbx_err_code == QLCNIC_MBX_PORT_RSP_OK)) {

Incorrect indentation, and the "||" should appear at the end of the
first line rather than at the beginning of the second line.

> +			mbx->req.arg[0] = (type | (mbx->req.num << 16) |
> +			(adapter->ahw->fw_hal_version << 29));

This second line needs to be indented properly.  If it makes the line too
long then split the expression up using temporary variables or create
a helper function so you can put the expression at a less deep indentation
level.

> +	cmd.req.arg[1] = cpu_to_le32((mode ? 1 : 0) |
> +		(adapter->recv_ctx->context_id) << 16);

This is not properly indented (and it's extremely tiring explaining
this same thing more than a dozen times during this review)

The first "(" on the second line must line up with the first column
after the openning parenthesis of cpu_to_le32( on the previous
line.

> +		cmd.req.arg[1] = cpu_to_le32(1 |
> +				adapter->recv_ctx->context_id << 16);

Same problem.

> +		cmd.req.arg[1] = cpu_to_le32(2 |
> +				adapter->recv_ctx->context_id << 16);

Same problem.

> +	cmd.req.arg[1] = cpu_to_le32((mode ? (BIT_0 | BIT_1 | BIT_3) : 0) |
> +				     ((adapter->recv_ctx->context_id) << 16));

By some strange miracle you are able to get it correct in this case.

> +	cmd.req.arg[1] = cpu_to_le32(op | (1 << 8) |
> +			(adapter->recv_ctx->context_id << 16));

Again, same problem.

> +	cmd.req.arg[2] = cpu_to_le32(coal->rx_packets |
> +		(coal->rx_time_us << 16));

And here too.

> +		cmd.req.arg[1] = cpu_to_le32(op | BIT_31 |
> +			(func_id << 16));
And again.

> +	for (i = 0, index = 2; i < max_ints; i++, index += 2) {
> +
> +		val = le32_to_cpu(cmd.rsp.arg[index]);

Please remove this unnecessary blank line.

> +	}
> +
> +
> +	th->psh = push;

There is no need for two blank lines here, remove at least one of them.

  reply	other threads:[~2012-09-20 22:45 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-19 23:45 [PATCH v1 0/19] qlcnic: patches for new adapter - Qlogic 83XX CNA Sony Chacko
2012-09-19 23:45 ` [PATCH v1 01/19] qlcnic: remove 82xx specific register dump utility Sony Chacko
2012-09-19 23:45 ` [PATCH v1 02/19] qlcnic: move HW specific data to seperate structure Sony Chacko
2012-09-19 23:45 ` [PATCH v1 03/19] qlcnic: create seperate file for data path routines Sony Chacko
2012-09-19 23:45 ` [PATCH v1 04/19] qlcnic: change IO and PCI register acccess routines Sony Chacko
2012-09-19 23:45 ` [PATCH v1 05/19] qlcnic: change driver hardware interface mechanism Sony Chacko
2012-09-20  0:57   ` David Miller
2012-09-19 23:46 ` [PATCH v1 06/19] qlcnic: driver resource allocation Sony Chacko
2012-09-19 23:46 ` [PATCH v1 07/19] qlcnic: get board name API Sony Chacko
2012-09-19 23:46 ` [PATCH v1 08/19] qlcnic: update NIC partition interface routines Sony Chacko
2012-09-19 23:46 ` [PATCH v1 09/19] qlcnic: cleanup unused register interfaces Sony Chacko
2012-09-19 23:46 ` [PATCH v1 10/19] qlcnic: rename module params with module_param_named Sony Chacko
2012-09-19 23:46 ` [PATCH v1 11/19] qlcnic: sysfs interface routine updates Sony Chacko
2012-09-20 22:31   ` David Miller
2012-09-19 23:46 ` [PATCH v1 12/19] qlcnic: update irq management routines Sony Chacko
2012-09-20 22:32   ` David Miller
2012-09-19 23:46 ` [PATCH v1 13/19] qlcnic: 83xx hardware access and data path routines Sony Chacko
2012-09-20 22:45   ` David Miller [this message]
2012-09-19 23:46 ` [PATCH v1 14/19] qlcnic: 83xx adpater flash interface routines Sony Chacko
2012-09-19 23:46 ` [PATCH v1 15/19] qlcnic: 83xx CNA inter driver communication mechanism Sony Chacko
2012-09-19 23:46 ` [PATCH v1 16/19] qlcnic: enable 83xx virtual NIC mode Sony Chacko
2012-09-19 23:46 ` [PATCH v1 17/19] qlcnic: common register dump utility Sony Chacko
2012-09-19 23:46 ` [PATCH v1 18/19] qlcnic: 83xx adpater ethtool Sony Chacko
2012-09-19 23:46 ` [PATCH v1 19/19] qlcnic: update driver version - 5.1.30 Sony Chacko
2012-09-20 22:47 ` [PATCH v1 0/19] qlcnic: patches for new adapter - Qlogic 83XX CNA David Miller
  -- strict thread matches above, loose matches on Subject: below --
2012-09-19 19:29 Sony Chacko
2012-09-19 19:29 ` [PATCH v1 13/19] qlcnic: 83xx hardware access and data path routines Sony Chacko

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=20120920.184507.1693343817853439763.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=Dept_NX_Linux_NIC_Driver@qlogic.com \
    --cc=netdev@vger.kernel.org \
    --cc=sony.chacko@qlogic.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).