diff options
| author | Yaowei Bai <bywxiaobai@163.com> | 2015-10-08 09:28:57 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-10-09 10:49:01 -0400 |
| commit | d6fbaea5f635216c9861587c4e658086cf3b1b6b (patch) | |
| tree | aec4e0998c31fd5424da3426f9fde33e29d0e265 /include/linux/can | |
| parent | 875e08294911b3cb8c60416d64d990809421de29 (diff) | |
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: Yaowei Bai <bywxiaobai@163.com>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/can')
| -rw-r--r-- | include/linux/can/dev.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 56dcadd83716..735f9f8c4e43 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h | |||
| @@ -78,7 +78,7 @@ struct can_priv { | |||
| 78 | #define get_canfd_dlc(i) (min_t(__u8, (i), CANFD_MAX_DLC)) | 78 | #define get_canfd_dlc(i) (min_t(__u8, (i), CANFD_MAX_DLC)) |
| 79 | 79 | ||
| 80 | /* Drop a given socketbuffer if it does not contain a valid CAN frame. */ | 80 | /* Drop a given socketbuffer if it does not contain a valid CAN frame. */ |
| 81 | static inline int can_dropped_invalid_skb(struct net_device *dev, | 81 | static inline bool can_dropped_invalid_skb(struct net_device *dev, |
| 82 | struct sk_buff *skb) | 82 | struct sk_buff *skb) |
| 83 | { | 83 | { |
| 84 | const struct canfd_frame *cfd = (struct canfd_frame *)skb->data; | 84 | 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 | } else | 94 | } else |
| 95 | goto inval_skb; | 95 | goto inval_skb; |
| 96 | 96 | ||
| 97 | return 0; | 97 | return false; |
| 98 | 98 | ||
| 99 | inval_skb: | 99 | inval_skb: |
| 100 | kfree_skb(skb); | 100 | kfree_skb(skb); |
| 101 | dev->stats.tx_dropped++; | 101 | dev->stats.tx_dropped++; |
| 102 | return 1; | 102 | return true; |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | static inline bool can_is_canfd_skb(const struct sk_buff *skb) | 105 | static inline bool can_is_canfd_skb(const struct sk_buff *skb) |
