[PATCH v6 05/15] net/xsc: add PCT interfaces
Stephen Hemminger
stephen at networkplumber.org
Mon Jan 20 19:24:33 CET 2025
On Mon, 20 Jan 2025 19:14:42 +0800
"WanRenyong" <wanry at yunsilicon.com> wrote:
> +int
> +xsc_dev_create_ipat(struct xsc_dev *xdev, uint16_t logic_in_port, uint16_t dst_info)
> +{
> + struct xsc_np_ipat add;
> +
> + memset(&add, 0, sizeof(add));
> + add.key.logical_in_port = logic_in_port;
> + add.action.dst_info = dst_info;
> + add.action.vld = 1;
You could use initializer here, and avoid a few steps:
struct xsd_np_ipat add = {
.key.logical_in_port = logic_in_port,
.action = {
.dst_info = dst_info,
.vlid = 1,
},
};
And several other places.
This is purely a suggestion, either way is fine will accept it either way.
More information about the dev
mailing list