[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1372883397.1886.9.camel@joe-AO722>
Date: Wed, 03 Jul 2013 13:29:57 -0700
From: Joe Perches <joe@...ches.com>
To: Or Gerlitz <ogerlitz@...lanox.com>
Cc: roland@...nel.org, linux-rdma@...r.kernel.org,
netdev@...r.kernel.org, davem@...emloft.net,
jackm@....mellanox.co.il, eli@....mellanox.co.il,
moshel@...lanox.com, Eli Cohen <eli@...lanox.com>
Subject: Re: [PATCH V2 1/9] net/mlx5: Mellanox Connect-IB, core driver part
1/3
On Wed, 2013-07-03 at 20:13 +0300, Or Gerlitz wrote:
> From: Eli Cohen <eli@...lanox.com>
trivial comments:
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
[]
> +static const char *deliv_status_to_str(u8 status)
> +{
> + switch (status) {
> + case MLX5_CMD_DELIVERY_STAT_OK:
> + return "no errors";
[]
> + default:
> + return "unknown status code\n";
> + }
> +}
Likely unnecessary newline for default case
> +static struct mlx5_cmd_mailbox *alloc_cmd_box(struct mlx5_core_dev *dev,
> + gfp_t flags)
> +{
> + struct mlx5_cmd_mailbox *mailbox;
> +
> + mailbox = kmalloc(sizeof(*mailbox), flags);
> + if (!mailbox) {
> + mlx5_core_dbg(dev, "failed allocation\n");
> + return ERR_PTR(-ENOMEM);
> + }
unnecessary OOM message.
> +static void set_wqname(struct mlx5_core_dev *dev)
> +{
> + struct mlx5_cmd *cmd = &dev->cmd;
> +
> + strcpy(cmd->wq_name, "mlx5_cmd_");
> + strcat(cmd->wq_name, dev_name(&dev->pdev->dev));
More likely snprintf might be better.
snprintf(cmd->wq_name, sizeof(cmd->wq_name), "mlx5_cmd_%s",
dev_name(&dev->pdev->dev));
How big is wq_name? Will a maximum length dev_name always fit?
--
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