Netdev List
 help / color / mirror / Atom feed
* [PATCH 03/10] net: hisilicon: Cleanup for cast to restricted __be32
@ 2019-07-05  6:10 Jiangfeng Xiao
  0 siblings, 0 replies; only message in thread
From: Jiangfeng Xiao @ 2019-07-05  6:10 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, dingtianhong, xiaojiangfeng
  Cc: davem, robh+dt, mark.rutland, netdev, devicetree, linux-kernel,
	leeyou.li, xiekunxun, jianping.liu, nixiaoming

This patch fixes the following warning from sparse:
hip04_eth.c:533:23: warning: cast to restricted __be16
hip04_eth.c:533:23: warning: cast to restricted __be16
hip04_eth.c:533:23: warning: cast to restricted __be16
hip04_eth.c:533:23: warning: cast to restricted __be16
hip04_eth.c:534:23: warning: cast to restricted __be32
hip04_eth.c:534:23: warning: cast to restricted __be32
hip04_eth.c:534:23: warning: cast to restricted __be32
hip04_eth.c:534:23: warning: cast to restricted __be32
hip04_eth.c:534:23: warning: cast to restricted __be32
hip04_eth.c:534:23: warning: cast to restricted __be32

Signed-off-by: Jiangfeng Xiao <xiaojiangfeng@huawei.com>
---
 drivers/net/ethernet/hisilicon/hip04_eth.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c
index 31f13cf..d8f0619 100644
--- a/drivers/net/ethernet/hisilicon/hip04_eth.c
+++ b/drivers/net/ethernet/hisilicon/hip04_eth.c
@@ -530,8 +530,8 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget)
 		priv->rx_phys[priv->rx_head] = 0;
 
 		desc = (struct rx_desc *)skb->data;
-		len = be16_to_cpu(desc->pkt_len);
-		err = be32_to_cpu(desc->pkt_err);
+		len = be16_to_cpu((__force __be16)desc->pkt_len);
+		err = be32_to_cpu((__force __be32)desc->pkt_err);
 
 		if (0 == len) {
 			dev_kfree_skb_any(skb);
-- 
1.8.5.6


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-05  6:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-05  6:10 [PATCH 03/10] net: hisilicon: Cleanup for cast to restricted __be32 Jiangfeng Xiao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox