Commit 27fa107d authored by Ivan Mikhaylov's avatar Ivan Mikhaylov Committed by David S. Miller

net/ncsi: fix restricted cast warning of sparse

Sparse reports:
net/ncsi/ncsi-rsp.c:406:24: warning: cast to restricted __be32
net/ncsi/ncsi-manage.c:732:33: warning: cast to restricted __be32
net/ncsi/ncsi-manage.c:756:25: warning: cast to restricted __be32
net/ncsi/ncsi-manage.c:779:25: warning: cast to restricted __be32
Signed-off-by: default avatarIvan Mikhaylov <i.mikhaylov@yadro.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 96248d6d
...@@ -700,7 +700,7 @@ static int ncsi_oem_gma_handler_bcm(struct ncsi_cmd_arg *nca) ...@@ -700,7 +700,7 @@ static int ncsi_oem_gma_handler_bcm(struct ncsi_cmd_arg *nca)
nca->payload = NCSI_OEM_BCM_CMD_GMA_LEN; nca->payload = NCSI_OEM_BCM_CMD_GMA_LEN;
memset(data, 0, NCSI_OEM_BCM_CMD_GMA_LEN); memset(data, 0, NCSI_OEM_BCM_CMD_GMA_LEN);
*(unsigned int *)data = ntohl(NCSI_OEM_MFR_BCM_ID); *(unsigned int *)data = ntohl((__force __be32)NCSI_OEM_MFR_BCM_ID);
data[5] = NCSI_OEM_BCM_CMD_GMA; data[5] = NCSI_OEM_BCM_CMD_GMA;
nca->data = data; nca->data = data;
...@@ -724,7 +724,7 @@ static int ncsi_oem_gma_handler_mlx(struct ncsi_cmd_arg *nca) ...@@ -724,7 +724,7 @@ static int ncsi_oem_gma_handler_mlx(struct ncsi_cmd_arg *nca)
nca->payload = NCSI_OEM_MLX_CMD_GMA_LEN; nca->payload = NCSI_OEM_MLX_CMD_GMA_LEN;
memset(&u, 0, sizeof(u)); memset(&u, 0, sizeof(u));
u.data_u32[0] = ntohl(NCSI_OEM_MFR_MLX_ID); u.data_u32[0] = ntohl((__force __be32)NCSI_OEM_MFR_MLX_ID);
u.data_u8[5] = NCSI_OEM_MLX_CMD_GMA; u.data_u8[5] = NCSI_OEM_MLX_CMD_GMA;
u.data_u8[6] = NCSI_OEM_MLX_CMD_GMA_PARAM; u.data_u8[6] = NCSI_OEM_MLX_CMD_GMA_PARAM;
...@@ -747,7 +747,7 @@ static int ncsi_oem_smaf_mlx(struct ncsi_cmd_arg *nca) ...@@ -747,7 +747,7 @@ static int ncsi_oem_smaf_mlx(struct ncsi_cmd_arg *nca)
int ret = 0; int ret = 0;
memset(&u, 0, sizeof(u)); memset(&u, 0, sizeof(u));
u.data_u32[0] = ntohl(NCSI_OEM_MFR_MLX_ID); u.data_u32[0] = ntohl((__force __be32)NCSI_OEM_MFR_MLX_ID);
u.data_u8[5] = NCSI_OEM_MLX_CMD_SMAF; u.data_u8[5] = NCSI_OEM_MLX_CMD_SMAF;
u.data_u8[6] = NCSI_OEM_MLX_CMD_SMAF_PARAM; u.data_u8[6] = NCSI_OEM_MLX_CMD_SMAF_PARAM;
memcpy(&u.data_u8[MLX_SMAF_MAC_ADDR_OFFSET], memcpy(&u.data_u8[MLX_SMAF_MAC_ADDR_OFFSET],
......
...@@ -403,7 +403,7 @@ static int ncsi_rsp_handler_ev(struct ncsi_request *nr) ...@@ -403,7 +403,7 @@ static int ncsi_rsp_handler_ev(struct ncsi_request *nr)
/* Update to VLAN mode */ /* Update to VLAN mode */
cmd = (struct ncsi_cmd_ev_pkt *)skb_network_header(nr->cmd); cmd = (struct ncsi_cmd_ev_pkt *)skb_network_header(nr->cmd);
ncm->enable = 1; ncm->enable = 1;
ncm->data[0] = ntohl(cmd->mode); ncm->data[0] = ntohl((__force __be32)cmd->mode);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment