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]
Message-ID: <552572DD.6030105@cogentembedded.com>
Date:	Wed, 08 Apr 2015 21:26:37 +0300
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Amir Vadai <amirv@...lanox.com>,
	"David S. Miller" <davem@...emloft.net>
CC:	netdev@...r.kernel.org, Yevgeny Petrilin <yevgenyp@...lanox.com>,
	Saeed Mahameed <saeedm@...lanox.com>,
	Or Gerlitz <ogerlitz@...lanox.com>,
	Achiad Shochat <achiad@...lanox.com>,
	Ido Shamay <idos@...lanox.com>,
	Rana Shahout <ranas@...lanox.com>
Subject: Re: [PATCH net-next 07/11] net/mlx5_core: Implement get/set port
 status

Hello.

On 04/08/2015 05:51 PM, Amir Vadai wrote:

> From: Rana Shahout <ranas@...lanox.com>

> Signed-off-by: Rana Shahout <ranas@...lanox.com>
> Signed-off-by: Saeed Mahameed <saeedm@...lanox.com>
> Signed-off-by: Amir Vadai <amirv@...lanox.com>
> ---
>   drivers/net/ethernet/mellanox/mlx5/core/port.c | 34 ++++++++++++++++++++++++++
>   include/linux/mlx5/driver.h                    |  8 ++++++
>   2 files changed, 42 insertions(+)

> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/port.c b/drivers/net/ethernet/mellanox/mlx5/core/port.c
> index 6e2d99c..7c394c0 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/port.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/port.c
> @@ -179,3 +179,37 @@ int mlx5_set_port_proto(struct mlx5_core_dev *dev, u32 proto_admin,
>   	return err;
>   }
>   EXPORT_SYMBOL_GPL(mlx5_set_port_proto);
> +
> +int mlx5_set_port_status(struct mlx5_core_dev *dev,
> +			 enum mlx5_port_status status)
> +{
> +	u32 in[MLX5_ST_SZ_DW(paos_reg)];
> +	u32 out[MLX5_ST_SZ_DW(paos_reg)];
> +	int err;
> +
> +	memset(in, 0, sizeof(in));
> +
> +	MLX5_SET(paos_reg, in, admin_status, status);
> +	MLX5_SET(paos_reg, in, ase, 1);
> +
> +	err = mlx5_core_access_reg(dev, in, sizeof(in), out,
> +				   sizeof(out), MLX5_REG_PAOS, 0, 1);
> +	return err;

    Why not just direct return of the function's result?

[...]

WBR, Sergei

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ