mlxsw: spectrum_ptp: Fix build warnings
authorIdo Schimmel <idosch@mellanox.com>
Mon, 30 Mar 2020 18:08:20 +0000 (21:08 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 30 Mar 2020 18:20:33 +0000 (11:20 -0700)
commitea315c55074e1a50df391b9ddba92260216b0e98
treedd803c993454559c45d05d35334fbb7bfb104fd5
parent307b4e0b37281e1d286417524c1c25422ea48891
mlxsw: spectrum_ptp: Fix build warnings

Cited commit extended the enums 'hwtstamp_tx_types' and
'hwtstamp_rx_filters' with values that were not accounted for in the
switch statements, resulting in the build warnings below.

Fix by adding a default case.

drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c: In function ‘mlxsw_sp_ptp_get_message_types’:
drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c:915:2: warning: enumeration value ‘__HWTSTAMP_TX_CNT’ not handled in switch [-Wswitch]
  915 |  switch (tx_type) {
      |  ^~~~~~
drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c:927:2: warning: enumeration value ‘__HWTSTAMP_FILTER_CNT’ not handled in switch [-Wswitch]
  927 |  switch (rx_filter) {
      |  ^~~~~~

Fixes: f76510b458a5 ("ethtool: add timestamping related string sets")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reported-by: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c