fsl/fman: remove unused struct member
authorMadalin Bucur <madalin.bucur@nxp.com>
Wed, 23 Oct 2019 09:08:45 +0000 (12:08 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Oct 2019 22:21:58 +0000 (15:21 -0700)
Remove unused struct member second_largest_buf_size. Also, an out of
bounds access would have occurred in the removed code if there was only
one buffer pool in use.

Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fman/fman_port.c

index bd76c973069215d0ba2fc0ea33da1949c0b6325f..87b26f063cc828df066655d85598cada8cfd034c 100644 (file)
@@ -435,7 +435,6 @@ struct fman_port_cfg {
 
 struct fman_port_rx_pools_params {
        u8 num_of_pools;
-       u16 second_largest_buf_size;
        u16 largest_buf_size;
 };
 
@@ -946,8 +945,6 @@ static int set_ext_buffer_pools(struct fman_port *port)
        port->rx_pools_params.num_of_pools = ext_buf_pools->num_of_pools_used;
        port->rx_pools_params.largest_buf_size =
            sizes_array[ordered_array[ext_buf_pools->num_of_pools_used - 1]];
-       port->rx_pools_params.second_largest_buf_size =
-           sizes_array[ordered_array[ext_buf_pools->num_of_pools_used - 2]];
 
        /* FMBM_RMPD reg. - pool depletion */
        if (buf_pool_depletion->pools_grp_mode_enable) {