Re: [PATCH V1 2/3] net/mlx4_core: Read HCA frequency and map internal clock
flat view
From: Or Gerlitz <hidden>
Date: 2012-10-09 19:31:20
On Tue, Oct 9, 2012 at 6:54 PM, Joe Perches [off-list ref] wrote:
On Tue, 2012-10-09 at 17:20 +0200, Or Gerlitz wrote:quoted
Read HCA frequency, read PCI clock bar and offset, map internal clock to PCI bar.trivial comments below:quoted
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c[]quoted
@@ -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); []quoted
+ /* 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