Commit d6fbaea5 authored by Yaowei Bai's avatar Yaowei Bai Committed by David S. Miller

net/can: can_dropped_invalid_skb can be boolean

This patch makes can_dropped_invalid_skb return bool due to this
particular function only using either one or zero as its return
value.

No functional change.
Signed-off-by: default avatarYaowei Bai <bywxiaobai@163.com>
Acked-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 875e0829
...@@ -78,7 +78,7 @@ struct can_priv { ...@@ -78,7 +78,7 @@ struct can_priv {
#define get_canfd_dlc(i) (min_t(__u8, (i), CANFD_MAX_DLC)) #define get_canfd_dlc(i) (min_t(__u8, (i), CANFD_MAX_DLC))
/* Drop a given socketbuffer if it does not contain a valid CAN frame. */ /* Drop a given socketbuffer if it does not contain a valid CAN frame. */
static inline int can_dropped_invalid_skb(struct net_device *dev, static inline bool can_dropped_invalid_skb(struct net_device *dev,
struct sk_buff *skb) struct sk_buff *skb)
{ {
const struct canfd_frame *cfd = (struct canfd_frame *)skb->data; const struct canfd_frame *cfd = (struct canfd_frame *)skb->data;
...@@ -94,12 +94,12 @@ static inline int can_dropped_invalid_skb(struct net_device *dev, ...@@ -94,12 +94,12 @@ static inline int can_dropped_invalid_skb(struct net_device *dev,
} else } else
goto inval_skb; goto inval_skb;
return 0; return false;
inval_skb: inval_skb:
kfree_skb(skb); kfree_skb(skb);
dev->stats.tx_dropped++; dev->stats.tx_dropped++;
return 1; return true;
} }
static inline bool can_is_canfd_skb(const struct sk_buff *skb) static inline bool can_is_canfd_skb(const struct sk_buff *skb)
......
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