lkml.org 
[lkml]   [2016]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] mellanox: mlx5: Use logging functions to reduce text ~10k/5%
On Wed, Jun 22, 2016 at 9:23 PM, Joe Perches <joe@perches.com> wrote:
[...]
> --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
> @@ -1557,3 +1557,37 @@ static void __exit cleanup(void)
>
> module_init(init);
> module_exit(cleanup);
> +
> +void mlx5_core_err(struct mlx5_core_dev *dev, const char *fmt, ...)
> +{
> + struct va_format vaf;
> + va_list args;
> +
> + va_start(args, fmt);
> +
> + vaf.fmt = fmt;
> + vaf.va = &args;
> +
> + dev_err(&dev->pdev->dev, "%s:%pS:(pid %d): %pV",
> + dev->priv.name, __builtin_return_address(0), current->pid,
> + &vaf);
> +
> + va_end(args);
> +}
> +
> +void mlx5_core_warn(struct mlx5_core_dev *dev, const char *fmt, ...)
> +{
> + struct va_format vaf;
> + va_list args;
> +
> + va_start(args, fmt);
> +
> + vaf.fmt = fmt;
> + vaf.va = &args;
> +
> + dev_warn(&dev->pdev->dev, "%s:%pS:(pid %d): %pV",
> + dev->priv.name, __builtin_return_address(0), current->pid,
> + &vaf);
> +
> + va_end(args);
> +}

Hi Joe,

I like to keep the file organized in a bottom-up fashion. Those
functions need to appear as early as possible in the file, just move
them up to appear after the MACROs defines and static fields
declarations.

\
 
 \ /
  Last update: 2016-06-23 10:41    [W:0.218 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site