From: Or Gerlitz <or.gerlitz@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: Or Gerlitz <ogerlitz@mellanox.com>,
davem@davemloft.net, netdev@vger.kernel.org,
Eugenia Emantayev <eugenia@mellanox.com>
Subject: Re: [PATCH V1 2/3] net/mlx4_core: Read HCA frequency and map internal clock
Date: Tue, 9 Oct 2012 21:31:19 +0200 [thread overview]
Message-ID: <CAJZOPZJYWighk5sq9naa7zfCEi5oLSNEoo6fMVF5AQ290DHLWw@mail.gmail.com> (raw)
In-Reply-To: <1349801661.2386.8.camel@joe-AO722>
On Tue, Oct 9, 2012 at 6:54 PM, Joe Perches <joe@perches.com> wrote:
> On Tue, 2012-10-09 at 17:20 +0200, Or Gerlitz wrote:
>> Read HCA frequency, read PCI clock bar and offset, map internal clock to PCI bar.
>
> trivial comments below:
>
>> diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
> []
>> @@ -1193,8 +1195,31 @@ static void unmap_bf_area(struct mlx4_dev *dev)
>> io_mapping_free(mlx4_priv(dev)->bf_mapping);
>> }
>>
>> +static int map_internal_clock(struct mlx4_dev *dev)
>> +{
>> + struct mlx4_priv *priv = mlx4_priv(dev);
>> +
>> + priv->clock_mapping = ioremap(pci_resource_start(dev->pdev,
>> + priv->fw.clock_bar) +
>> + priv->fw.clock_offset, MLX4_CLOCK_SIZE);
>
> I think this is misleading indentation style.
sure, we know what needs to be here, I was under a probably
misconception that checkpatch --strict catches this, thanks for
pointing out
> Perhaps this'd be nicer as something like:
>
> priv->clock_mapping =
> ioremap(pci_resource_start(dev->pdev, priv->fw.clock_bar) +
> priv->fw.clock_offset, MLX4_CLOCK_SIZE);
>
> []
>
>> + /* In case we got HCA frequency 0 - disable timestamping
>> + * to avoid dividing by zero
>> + */
>> + if (!dev->caps.hca_core_clock) {
>> + dev->caps.flags2 &= ~MLX4_DEV_CAP_FLAG2_TS;
>> + mlx4_err(dev, "HCA frequency is 0. " \
>> + "Timestamping is not supported.");
>
> These are missing terminating newlines.
OK, will fix
> Please don't split format strings like this. It's hard to grep.
> Especially please don't use unnecessary line continuations.
> The compiler will concatenate these strings without the \.
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-10-09 19:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-09 15:20 [PATCH V1 0/3] net/mlx4: HW timestamping support Or Gerlitz
2012-10-09 15:20 ` [PATCH V1 1/3] net/mlx4_core: Add timestamping device capability Or Gerlitz
2012-10-09 15:20 ` [PATCH V1 2/3] net/mlx4_core: Read HCA frequency and map internal clock Or Gerlitz
2012-10-09 16:54 ` Joe Perches
2012-10-09 19:31 ` Or Gerlitz [this message]
2012-10-09 15:20 ` [PATCH V1 3/3] net/mlx4_en: Add HW timestamping (TS) support Or Gerlitz
2012-10-10 3:37 ` Richard Cochran
2012-10-10 14:06 ` Or Gerlitz
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=CAJZOPZJYWighk5sq9naa7zfCEi5oLSNEoo6fMVF5AQ290DHLWw@mail.gmail.com \
--to=or.gerlitz@gmail.com \
--cc=davem@davemloft.net \
--cc=eugenia@mellanox.com \
--cc=joe@perches.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.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).