mlxsw: spectrum_ptp: Fix compilation warnings
authorAmit Cohen <amcohen@nvidia.com>
Fri, 12 Aug 2022 15:32:00 +0000 (17:32 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Aug 2022 10:49:58 +0000 (11:49 +0100)
commit12e091389b29cddf26279fdf182b13b3a1583d0d
treefaf45766ae77a824c440c70e8f5ce90492e5ea35
parent02799571714dc5dd6948824b9d080b44a295f695
mlxsw: spectrum_ptp: Fix compilation warnings

In case that 'CONFIG_PTP_1588_CLOCK' is not enabled in the config file,
there are implementations for the functions
mlxsw_{sp,sp2}_ptp_txhdr_construct() as part of 'spectrum_ptp.h'. In this
case, they should be defined as 'static' as they are not supposed to be
used out of this file. Make the functions 'static', otherwise the following
warnings are returned:

"warning: no previous prototype for 'mlxsw_sp_ptp_txhdr_construct'"
"warning: no previous prototype for 'mlxsw_sp2_ptp_txhdr_construct'"

In addition, make the functions 'inline' for case that 'spectrum_ptp.h'
will be included anywhere else and the functions would probably not be
used, so compilation warnings about unused static will be returned.

Fixes: 24157bc69f45 ("mlxsw: Send PTP packets as data packets to overcome a limitation")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h