* [PATCH net-next] net: constify is_skb_forwardable's arguments
@ 2016-04-28 15:59 Nikolay Aleksandrov
2016-04-29 20:15 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Nikolay Aleksandrov @ 2016-04-28 15:59 UTC (permalink / raw)
To: netdev; +Cc: davem, roopa, Nikolay Aleksandrov
is_skb_forwardable is not supposed to change anything so constify its
arguments
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
Hit this while working on the bridge per-vlan stats and needed to pass a
constified skb down. skb_is_gso() already takes a const skb.
include/linux/netdevice.h | 3 ++-
net/core/dev.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 18d8394f2e5d..f9d573e26db3 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3260,7 +3260,8 @@ struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
struct netdev_queue *txq, int *ret);
int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
int dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
-bool is_skb_forwardable(struct net_device *dev, struct sk_buff *skb);
+bool is_skb_forwardable(const struct net_device *dev,
+ const struct sk_buff *skb);
extern int netdev_budget;
diff --git a/net/core/dev.c b/net/core/dev.c
index 6324bc9267f7..36f0170a0754 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1741,7 +1741,7 @@ static inline void net_timestamp_set(struct sk_buff *skb)
__net_timestamp(SKB); \
} \
-bool is_skb_forwardable(struct net_device *dev, struct sk_buff *skb)
+bool is_skb_forwardable(const struct net_device *dev, const struct sk_buff *skb)
{
unsigned int len;
--
2.4.11
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: constify is_skb_forwardable's arguments
2016-04-28 15:59 [PATCH net-next] net: constify is_skb_forwardable's arguments Nikolay Aleksandrov
@ 2016-04-29 20:15 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-04-29 20:15 UTC (permalink / raw)
To: nikolay; +Cc: netdev, roopa
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Date: Thu, 28 Apr 2016 17:59:28 +0200
> is_skb_forwardable is not supposed to change anything so constify its
> arguments
>
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-04-29 20:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-28 15:59 [PATCH net-next] net: constify is_skb_forwardable's arguments Nikolay Aleksandrov
2016-04-29 20:15 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).