[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZOPZJYWighk5sq9naa7zfCEi5oLSNEoo6fMVF5AQ290DHLWw@mail.gmail.com>
Date: Tue, 9 Oct 2012 21:31:19 +0200
From: Or Gerlitz <or.gerlitz@...il.com>
To: Joe Perches <joe@...ches.com>
Cc: Or Gerlitz <ogerlitz@...lanox.com>, davem@...emloft.net,
netdev@...r.kernel.org, Eugenia Emantayev <eugenia@...lanox.com>
Subject: Re: [PATCH V1 2/3] net/mlx4_core: Read HCA frequency and map internal clock
On Tue, Oct 9, 2012 at 6:54 PM, Joe Perches <joe@...ches.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@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists