Skip to contentSkip to conversation

netpoll: Use 'bool' for netpoll_rx() return type.

PATCH In review David Miller 2 participants 3 messages May 6, 2010

Subsystems (2)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 1/1 netpoll: Use 'bool' for netpoll_rx() return type.

---

I noticed this while validating and auditing Eric Dumazet's vnet fix... applied to net-next-2.6

 include/linux/netpoll.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
include/linux/netpoll.h +4 -4
index 017e604..3688c83 100644
@@ -55,19 +55,19 @@ void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb);
 
 
 #ifdef CONFIG_NETPOLL
-static inline int netpoll_rx(struct sk_buff *skb)
+static inline bool netpoll_rx(struct sk_buff *skb)
 {
 	struct netpoll_info *npinfo = skb->dev->npinfo;
 	unsigned long flags;
-	int ret = 0;
+	int ret = false;
 
 	if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags))
-		return 0;
+		return false;
 
 	spin_lock_irqsave(&npinfo->rx_lock, flags);
 	/* check rx_flags again with the lock held */
 	if (npinfo->rx_flags && __netpoll_rx(skb))
-		ret = 1;
+		ret = true;
 	spin_unlock_irqrestore(&npinfo->rx_lock, flags);
 
 	return ret;
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 16 lines · David Miller

---

I noticed this while validating and auditing Eric Dumazet's vnet fix...  applied to net-next-2.6

 include/linux/netpoll.h |    8 ++++----

 1 files changed, 4 insertions(+), 4 deletions(-)
include/linux/netpoll.h +0 -0
index 017e604..3688c83 100644
@@ -55,19 +55,19 @@ void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb);
 

include/linux/netpoll.h void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb); · line 63

Quoted 10 lines
include/linux/netpoll.h +2 -2
 
  #ifdef CONFIG_NETPOLL
-static inline int netpoll_rx(struct sk_buff *skb)
+static inline bool netpoll_rx(struct sk_buff *skb)
  {
        struct netpoll_info *npinfo = skb->dev->npinfo;
        unsigned long flags;
-       int ret = 0;
+       int ret = false;
 

bool ret = false.

Signature · 2 lines
Regards,
Changli Gao([email protected])
author maintainer
#2 lore raw

From: Changli Gao <[email protected]>
Date: Thu, 6 May 2010 16:27:44 +0800

Quoted 1 line

bool ret = false.

Thanks for catching that, fixed.