[PATCH v1 01/14] net/zxdh: add network processor registers ops

Stephen Hemminger stephen at networkplumber.org
Mon Feb 10 17:56:06 CET 2025


On Mon, 10 Feb 2025 09:19:24 +0800
Bingbin Chen <chen.bingbin at zte.com.cn> wrote:

> +ZXDH_REG_T g_dpp_reg_info[] = {
> +	{
> +		"cpu_ind_cmd",
> +		669,
> +		SMMU0,
> +		ZXDH_REG_FLAG_DIRECT,
> +		ZXDH_REG_NUL_ARRAY,
> +		ZXDH_SYS_SE_SMMU0_BASE_ADDR + ZXDH_MODULE_SE_SMMU0_BASE_ADDR + 0x00000014,
> +		(32 / 8),
> +		0,
> +		0,
> +		0,
> +		0,
> +		4,
> +		g_smmu0_smmu0_cpu_ind_cmd_reg,
> +		zxdh_np_se_smmu0_write,
> +		zxdh_np_se_smmu0_read,
> +	},

For complex initializers like this, it is better to use explicit field names.

	{
		.name = "cpu_ind_cmd",
...

The problem is that if you get something in wrong place only some analysis
tool many years later will notice.


More information about the dev mailing list