net: nvethernet: Fix CONFIG_TEGRA_NVPPS not defined warning

Compiling the nvethernet driver without the ccflag CONFIG_TEGRA_NVPPS
defined generates the following warning ...

 drivers/net/ethernet/nvidia/nvethernet/ether_linux.c:2936:5:
 warning: "CONFIG_TEGRA_NVPPS" is not defined, evaluates to 0 [-Wundef]
  2936 | #if CONFIG_TEGRA_NVPPS
       |     ^~~~~~~~~~~~~~~~~~

Fix this by using '#ifdef' to determine if CONFIG_TEGRA_NVPPS is
defined instead of '#if'.

Bug 4190030

Change-Id: Id1523de6f9ef9f4c72669584efb77ffd9ddf20f3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2938375
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jon Hunter
2023-07-17 15:07:20 +01:00
committed by mobile promotions
parent b970ad45ec
commit 9655b8c6b0
2 changed files with 3 additions and 3 deletions

View File

@@ -2933,7 +2933,7 @@ static int ether_close(struct net_device *ndev)
/* TODO: purge the queues */ /* TODO: purge the queues */
#endif #endif
#if CONFIG_TEGRA_NVPPS #ifdef CONFIG_TEGRA_NVPPS
/* Unregister broadcasting MAC timestamp to clients */ /* Unregister broadcasting MAC timestamp to clients */
tegra_unregister_hwtime_source(ndev); tegra_unregister_hwtime_source(ndev);
#endif #endif

View File

@@ -395,7 +395,7 @@ int ether_handle_hwtstamp_ioctl(struct ether_priv_data *pdata,
{ {
struct osi_core_priv_data *osi_core = pdata->osi_core; struct osi_core_priv_data *osi_core = pdata->osi_core;
struct osi_dma_priv_data *osi_dma = pdata->osi_dma; struct osi_dma_priv_data *osi_dma = pdata->osi_dma;
#if CONFIG_TEGRA_NVPPS #ifdef CONFIG_TEGRA_NVPPS
struct net_device *ndev = pdata->ndev; struct net_device *ndev = pdata->ndev;
#endif #endif
struct osi_ioctl ioctl_data = {}; struct osi_ioctl ioctl_data = {};
@@ -598,7 +598,7 @@ int ether_handle_hwtstamp_ioctl(struct ether_priv_data *pdata,
dev_err(pdata->dev, "Failure to enable CONFIG_PTP\n"); dev_err(pdata->dev, "Failure to enable CONFIG_PTP\n");
return -EFAULT; return -EFAULT;
} }
#if CONFIG_TEGRA_NVPPS #ifdef CONFIG_TEGRA_NVPPS
/* Register broadcasting MAC timestamp to clients */ /* Register broadcasting MAC timestamp to clients */
tegra_register_hwtime_source(ether_get_hw_time, ndev); tegra_register_hwtime_source(ether_get_hw_time, ndev);
#endif #endif