net: dsa: sja1105: remove empty structures from config table ops
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sat, 20 Jun 2020 17:18:30 +0000 (20:18 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Jun 2020 23:01:28 +0000 (16:01 -0700)
Sparse is complaining and giving the following warning message:
'Using plain integer as NULL pointer'.

This is not what's going on, instead {0} is used as a zero initializer
for the structure members, to indicate that the particular chip revision
does not support those particular config tables.

But since the config tables are declared globally, the unpopulated
elements are zero-initialized anyway. So, to make sparse shut up, let's
remove the zero initializers.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/sja1105/sja1105_dynamic_config.c
drivers/net/dsa/sja1105/sja1105_static_config.c

index 4471eeccc2939afd67375822447dd27a189954a5..331593ace2157c6d863422dd79a3a0f24ccbeff2 100644 (file)
@@ -639,8 +639,6 @@ static size_t sja1105pqrs_cbs_entry_packing(void *buf, void *entry_ptr,
 
 /* SJA1105E/T: First generation */
 struct sja1105_dynamic_table_ops sja1105et_dyn_ops[BLK_IDX_MAX_DYN] = {
-       [BLK_IDX_SCHEDULE] = {0},
-       [BLK_IDX_SCHEDULE_ENTRY_POINTS] = {0},
        [BLK_IDX_VL_LOOKUP] = {
                .entry_packing = sja1105et_vl_lookup_entry_packing,
                .cmd_packing = sja1105_vl_lookup_cmd_packing,
@@ -649,8 +647,6 @@ struct sja1105_dynamic_table_ops sja1105et_dyn_ops[BLK_IDX_MAX_DYN] = {
                .packed_size = SJA1105ET_SJA1105_SIZE_VL_LOOKUP_DYN_CMD,
                .addr = 0x35,
        },
-       [BLK_IDX_VL_POLICING] = {0},
-       [BLK_IDX_VL_FORWARDING] = {0},
        [BLK_IDX_L2_LOOKUP] = {
                .entry_packing = sja1105et_dyn_l2_lookup_entry_packing,
                .cmd_packing = sja1105et_l2_lookup_cmd_packing,
@@ -667,7 +663,6 @@ struct sja1105_dynamic_table_ops sja1105et_dyn_ops[BLK_IDX_MAX_DYN] = {
                .packed_size = SJA1105ET_SIZE_L2_LOOKUP_DYN_CMD,
                .addr = 0x20,
        },
-       [BLK_IDX_L2_POLICING] = {0},
        [BLK_IDX_VLAN_LOOKUP] = {
                .entry_packing = sja1105_vlan_lookup_entry_packing,
                .cmd_packing = sja1105_vlan_lookup_cmd_packing,
@@ -692,9 +687,6 @@ struct sja1105_dynamic_table_ops sja1105et_dyn_ops[BLK_IDX_MAX_DYN] = {
                .packed_size = SJA1105ET_SIZE_MAC_CONFIG_DYN_CMD,
                .addr = 0x36,
        },
-       [BLK_IDX_SCHEDULE_PARAMS] = {0},
-       [BLK_IDX_SCHEDULE_ENTRY_POINTS_PARAMS] = {0},
-       [BLK_IDX_VL_FORWARDING_PARAMS] = {0},
        [BLK_IDX_L2_LOOKUP_PARAMS] = {
                .entry_packing = sja1105et_l2_lookup_params_entry_packing,
                .cmd_packing = sja1105et_l2_lookup_params_cmd_packing,
@@ -703,8 +695,6 @@ struct sja1105_dynamic_table_ops sja1105et_dyn_ops[BLK_IDX_MAX_DYN] = {
                .packed_size = SJA1105ET_SIZE_L2_LOOKUP_PARAMS_DYN_CMD,
                .addr = 0x38,
        },
-       [BLK_IDX_L2_FORWARDING_PARAMS] = {0},
-       [BLK_IDX_AVB_PARAMS] = {0},
        [BLK_IDX_GENERAL_PARAMS] = {
                .entry_packing = sja1105et_general_params_entry_packing,
                .cmd_packing = sja1105et_general_params_cmd_packing,
@@ -729,13 +719,10 @@ struct sja1105_dynamic_table_ops sja1105et_dyn_ops[BLK_IDX_MAX_DYN] = {
                .packed_size = SJA1105ET_SIZE_CBS_DYN_CMD,
                .addr = 0x2c,
        },
-       [BLK_IDX_XMII_PARAMS] = {0},
 };
 
 /* SJA1105P/Q/R/S: Second generation */
 struct sja1105_dynamic_table_ops sja1105pqrs_dyn_ops[BLK_IDX_MAX_DYN] = {
-       [BLK_IDX_SCHEDULE] = {0},
-       [BLK_IDX_SCHEDULE_ENTRY_POINTS] = {0},
        [BLK_IDX_VL_LOOKUP] = {
                .entry_packing = sja1105_vl_lookup_entry_packing,
                .cmd_packing = sja1105_vl_lookup_cmd_packing,
@@ -744,8 +731,6 @@ struct sja1105_dynamic_table_ops sja1105pqrs_dyn_ops[BLK_IDX_MAX_DYN] = {
                .packed_size = SJA1105PQRS_SJA1105_SIZE_VL_LOOKUP_DYN_CMD,
                .addr = 0x47,
        },
-       [BLK_IDX_VL_POLICING] = {0},
-       [BLK_IDX_VL_FORWARDING] = {0},
        [BLK_IDX_L2_LOOKUP] = {
                .entry_packing = sja1105pqrs_dyn_l2_lookup_entry_packing,
                .cmd_packing = sja1105pqrs_l2_lookup_cmd_packing,
@@ -762,7 +747,6 @@ struct sja1105_dynamic_table_ops sja1105pqrs_dyn_ops[BLK_IDX_MAX_DYN] = {
                .packed_size = SJA1105PQRS_SIZE_L2_LOOKUP_DYN_CMD,
                .addr = 0x24,
        },
-       [BLK_IDX_L2_POLICING] = {0},
        [BLK_IDX_VLAN_LOOKUP] = {
                .entry_packing = sja1105_vlan_lookup_entry_packing,
                .cmd_packing = sja1105_vlan_lookup_cmd_packing,
@@ -787,9 +771,6 @@ struct sja1105_dynamic_table_ops sja1105pqrs_dyn_ops[BLK_IDX_MAX_DYN] = {
                .packed_size = SJA1105PQRS_SIZE_MAC_CONFIG_DYN_CMD,
                .addr = 0x4B,
        },
-       [BLK_IDX_SCHEDULE_PARAMS] = {0},
-       [BLK_IDX_SCHEDULE_ENTRY_POINTS_PARAMS] = {0},
-       [BLK_IDX_VL_FORWARDING_PARAMS] = {0},
        [BLK_IDX_L2_LOOKUP_PARAMS] = {
                .entry_packing = sja1105pqrs_l2_lookup_params_entry_packing,
                .cmd_packing = sja1105pqrs_l2_lookup_params_cmd_packing,
@@ -798,7 +779,6 @@ struct sja1105_dynamic_table_ops sja1105pqrs_dyn_ops[BLK_IDX_MAX_DYN] = {
                .packed_size = SJA1105PQRS_SIZE_L2_LOOKUP_PARAMS_DYN_CMD,
                .addr = 0x54,
        },
-       [BLK_IDX_L2_FORWARDING_PARAMS] = {0},
        [BLK_IDX_AVB_PARAMS] = {
                .entry_packing = sja1105pqrs_avb_params_entry_packing,
                .cmd_packing = sja1105pqrs_avb_params_cmd_packing,
@@ -831,7 +811,6 @@ struct sja1105_dynamic_table_ops sja1105pqrs_dyn_ops[BLK_IDX_MAX_DYN] = {
                .packed_size = SJA1105PQRS_SIZE_CBS_DYN_CMD,
                .addr = 0x32,
        },
-       [BLK_IDX_XMII_PARAMS] = {0},
 };
 
 /* Provides read access to the settings through the dynamic interface
index ff3fe471efc228746389bd6e3eb66423d7b66983..fb44c0a722859126062c7efbe768721c533293ba 100644 (file)
@@ -839,11 +839,6 @@ sja1105_static_config_get_length(const struct sja1105_static_config *config)
 
 /* SJA1105E: First generation, no TTEthernet */
 struct sja1105_table_ops sja1105e_table_ops[BLK_IDX_MAX] = {
-       [BLK_IDX_SCHEDULE] = {0},
-       [BLK_IDX_SCHEDULE_ENTRY_POINTS] = {0},
-       [BLK_IDX_VL_LOOKUP] = {0},
-       [BLK_IDX_VL_POLICING] = {0},
-       [BLK_IDX_VL_FORWARDING] = {0},
        [BLK_IDX_L2_LOOKUP] = {
                .packing = sja1105et_l2_lookup_entry_packing,
                .unpacked_entry_size = sizeof(struct sja1105_l2_lookup_entry),
@@ -874,9 +869,6 @@ struct sja1105_table_ops sja1105e_table_ops[BLK_IDX_MAX] = {
                .packed_entry_size = SJA1105ET_SIZE_MAC_CONFIG_ENTRY,
                .max_entry_count = SJA1105_MAX_MAC_CONFIG_COUNT,
        },
-       [BLK_IDX_SCHEDULE_PARAMS] = {0},
-       [BLK_IDX_SCHEDULE_ENTRY_POINTS_PARAMS] = {0},
-       [BLK_IDX_VL_FORWARDING_PARAMS] = {0},
        [BLK_IDX_L2_LOOKUP_PARAMS] = {
                .packing = sja1105et_l2_lookup_params_entry_packing,
                .unpacked_entry_size = sizeof(struct sja1105_l2_lookup_params_entry),
@@ -1035,11 +1027,6 @@ struct sja1105_table_ops sja1105t_table_ops[BLK_IDX_MAX] = {
 
 /* SJA1105P: Second generation, no TTEthernet, no SGMII */
 struct sja1105_table_ops sja1105p_table_ops[BLK_IDX_MAX] = {
-       [BLK_IDX_SCHEDULE] = {0},
-       [BLK_IDX_SCHEDULE_ENTRY_POINTS] = {0},
-       [BLK_IDX_VL_LOOKUP] = {0},
-       [BLK_IDX_VL_POLICING] = {0},
-       [BLK_IDX_VL_FORWARDING] = {0},
        [BLK_IDX_L2_LOOKUP] = {
                .packing = sja1105pqrs_l2_lookup_entry_packing,
                .unpacked_entry_size = sizeof(struct sja1105_l2_lookup_entry),
@@ -1070,9 +1057,6 @@ struct sja1105_table_ops sja1105p_table_ops[BLK_IDX_MAX] = {
                .packed_entry_size = SJA1105PQRS_SIZE_MAC_CONFIG_ENTRY,
                .max_entry_count = SJA1105_MAX_MAC_CONFIG_COUNT,
        },
-       [BLK_IDX_SCHEDULE_PARAMS] = {0},
-       [BLK_IDX_SCHEDULE_ENTRY_POINTS_PARAMS] = {0},
-       [BLK_IDX_VL_FORWARDING_PARAMS] = {0},
        [BLK_IDX_L2_LOOKUP_PARAMS] = {
                .packing = sja1105pqrs_l2_lookup_params_entry_packing,
                .unpacked_entry_size = sizeof(struct sja1105_l2_lookup_params_entry),
@@ -1231,11 +1215,6 @@ struct sja1105_table_ops sja1105q_table_ops[BLK_IDX_MAX] = {
 
 /* SJA1105R: Second generation, no TTEthernet, SGMII */
 struct sja1105_table_ops sja1105r_table_ops[BLK_IDX_MAX] = {
-       [BLK_IDX_SCHEDULE] = {0},
-       [BLK_IDX_SCHEDULE_ENTRY_POINTS] = {0},
-       [BLK_IDX_VL_LOOKUP] = {0},
-       [BLK_IDX_VL_POLICING] = {0},
-       [BLK_IDX_VL_FORWARDING] = {0},
        [BLK_IDX_L2_LOOKUP] = {
                .packing = sja1105pqrs_l2_lookup_entry_packing,
                .unpacked_entry_size = sizeof(struct sja1105_l2_lookup_entry),
@@ -1266,9 +1245,6 @@ struct sja1105_table_ops sja1105r_table_ops[BLK_IDX_MAX] = {
                .packed_entry_size = SJA1105PQRS_SIZE_MAC_CONFIG_ENTRY,
                .max_entry_count = SJA1105_MAX_MAC_CONFIG_COUNT,
        },
-       [BLK_IDX_SCHEDULE_PARAMS] = {0},
-       [BLK_IDX_SCHEDULE_ENTRY_POINTS_PARAMS] = {0},
-       [BLK_IDX_VL_FORWARDING_PARAMS] = {0},
        [BLK_IDX_L2_LOOKUP_PARAMS] = {
                .packing = sja1105pqrs_l2_lookup_params_entry_packing,
                .unpacked_entry_size = sizeof(struct sja1105_l2_lookup_params_entry),