"unsigned char"/"char" consistency?
Subsystems (2)
PATCH 1/1 "unsigned char"/"char" consistency?
Hi there,
I was just nosing around and I noticed a minor inconsistency in the usage of unsigned chars in skbuff push/pull functions. Almost all of these functions return unsigned chars, but there are two that return regular chars. Of course, this might be intentional, but AFAICS it probably isn't. If nobody has a reason why this must be like this, I suggest changing those two functions to return unsigned char as well. I've attached a patch that does this, it's against 2.6.2-rc1.
-- Bart
include/linux/skbuff.h +2 -2
@@ -871,7 +871,7 @@return skb->data; } -static inline char *__skb_pull (struct sk_buff *skb,unsigned int len) +static inline unsigned char *__skb_pull (struct sk_buff *skb,unsigned int len) { skb->len -= len;BUG_ON (skb->len < skb->data_len);
@@ -895,7 +895,7 @@extern unsigned char *__pskb_pull_tail (struct sk_buff *skb,int delta); -static inline char *__pskb_pull (struct sk_buff *skb,unsigned int len) +static inline unsigned char *__pskb_pull (struct sk_buff *skb,unsigned int len) {if (len >skb_headlen (skb) && !__pskb_pull_tail (skb, len-skb_headlen (skb)))
From: Bart Samwel <[email protected]>
Date: Sat, 24 Jan 2004 18:05:57 +0100
I was just nosing around and I noticed a minor inconsistency in the usage of unsigned chars in skbuff push/pull functions. Almost all of these functions return unsigned chars, but there are two that return regular chars. Of course, this might be intentional, but AFAICS it probably isn't. If nobody has a reason why this must be like this, I suggest changing those two functions to return unsigned char as well. I've attached a patch that does this, it's against 2.6.2-rc1.
Patch applied, thanks Bart.