lkml.org 
[lkml]   [2023]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] net: sched: Fix restricted __be16 degrades to integer
Date
net/sched/cls_api.c:2010:25: warning: restricted __be16 degrades to integer
net/sched/cls_api.c:2695:50: warning: restricted __be16 degrades to integer

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
---
net/sched/cls_api.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index f73f39f61f66..4c47490eb0c1 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -2007,7 +2007,7 @@ static int tcf_fill_node(struct net *net, struct sk_buff *skb,
tcm->tcm_ifindex = TCM_IFINDEX_MAGIC_BLOCK;
tcm->tcm_block_index = block->index;
}
- tcm->tcm_info = TC_H_MAKE(tp->prio, tp->protocol);
+ tcm->tcm_info = TC_H_MAKE(tp->prio, be16_to_cpu(tp->protocol));
if (nla_put_string(skb, TCA_KIND, tp->ops->kind))
goto nla_put_failure;
if (nla_put_u32(skb, TCA_CHAIN, tp->chain->index))
@@ -2692,7 +2692,7 @@ static bool tcf_chain_dump(struct tcf_chain *chain, struct Qdisc *q, u32 parent,
TC_H_MAJ(tcm->tcm_info) != tp->prio)
continue;
if (TC_H_MIN(tcm->tcm_info) &&
- TC_H_MIN(tcm->tcm_info) != tp->protocol)
+ TC_H_MIN(tcm->tcm_info) != be16_to_cpu(tp->protocol))
continue;
if (*p_index > index_start)
memset(&cb->args[1], 0,
--
2.34.1
\
 
 \ /
  Last update: 2023-11-20 14:02    [W:0.097 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site