lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 23 Jun 2016 11:09:41 +0300
From:	Saeed Mahameed <saeedm@....mellanox.co.il>
To:	Joe Perches <joe@...ches.com>
Cc:	Matan Barak <matanb@...lanox.com>,
	Leon Romanovsky <leonro@...lanox.com>,
	Linux Netdev List <netdev@...r.kernel.org>,
	linux-rdma@...r.kernel.org,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mellanox: mlx5: Use logging functions to reduce text ~10k/5%

On Wed, Jun 22, 2016 at 9:23 PM, Joe Perches <joe@...ches.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.

Powered by blists - more mailing lists