nvethernet: Resolve "Wframe-larger-than" warning

-Use dynamic structure pointer to eliminate
"Wframe-larger-than" warning.

-Modify "-Wframe-larger-than" flag from 4096 bytes to 2048 bytes

Bug 4213870

Change-Id: I9dc3df951290415ce587b1fe2440ee52dd985b62
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2954775
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Revanth Kumar Uppala
2023-08-10 20:00:33 +05:30
committed by mobile promotions
parent 2360391866
commit 7a01b01e88
2 changed files with 13 additions and 6 deletions

View File

@@ -15,7 +15,7 @@ endif
ifeq ($(findstring ack_src,$(NV_BUILD_KERNEL_OPTIONS)),)
# These CFLAGS must not be shared/used in OSI. These are local to Linux
ccflags-y += -DLINUX_OS -DNET30 -DNVPKCS_MACSEC -DLINUX_IVC -mno-outline-atomics -Werror=frame-larger-than=4096 \
ccflags-y += -DLINUX_OS -DNET30 -DNVPKCS_MACSEC -DLINUX_IVC -mno-outline-atomics -Werror=frame-larger-than=2048 \
-I$(srctree.nvidia-oot)/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/include \
-I$(srctree.nvidia-oot)/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/common/include
else

View File

@@ -6460,7 +6460,7 @@ static int ether_probe(struct platform_device *pdev)
unsigned int num_dma_chans, mac, num_mtl_queues, chan;
struct osi_core_priv_data *osi_core;
struct osi_dma_priv_data *osi_dma;
struct osi_ioctl ioctl_data = {};
struct osi_ioctl *ioctl_data;
struct net_device *ndev;
int ret = 0, i;
const char *if_name;
@@ -6558,14 +6558,20 @@ static int ether_probe(struct platform_device *pdev)
goto err_init_res;
}
ioctl_data.cmd = OSI_CMD_GET_HW_FEAT;
ret = osi_handle_ioctl(osi_core, &ioctl_data);
ioctl_data = devm_kzalloc(&pdev->dev, sizeof(struct osi_ioctl),
GFP_KERNEL);
if (ioctl_data == NULL) {
ret = -ENOMEM;
goto err_kzalloc;
}
ioctl_data->cmd = OSI_CMD_GET_HW_FEAT;
ret = osi_handle_ioctl(osi_core, ioctl_data);
if (ret < 0) {
dev_err(&pdev->dev, "failed to get HW features\n");
goto err_dma_mask;
}
osi_core->mac_ver = ioctl_data.arg1_u32;
memcpy(&pdata->hw_feat, &ioctl_data.hw_feat,
osi_core->mac_ver = ioctl_data->arg1_u32;
memcpy(&pdata->hw_feat, &ioctl_data->hw_feat,
sizeof(struct osi_hw_features));
ret = ether_get_mac_address(pdata);
@@ -6721,6 +6727,7 @@ err_init_res:
err_parse_dt:
err_core_ops:
err_dma_ops:
err_kzalloc:
ether_stop_ivc(pdata);
free_netdev(ndev);
return ret;