netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Samwel <bart@samwel.tk>
To: linux-net@vger.kernel.org, netdev@oss.sgi.com
Subject: [PATCH] [TRIVIAL] "unsigned char"/"char" consistency?
Date: Sat, 24 Jan 2004 18:05:57 +0100	[thread overview]
Message-ID: <4012A5F5.2000804@samwel.tk> (raw)

[-- Attachment #1: Type: text/plain, Size: 500 bytes --]

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

[-- Attachment #2: unsigned_char_skbuff_pull.patch --]
[-- Type: text/x-patch, Size: 866 bytes --]

diff -Naur linux-2.6.2-rc1/include/linux/skbuff.h linux-2.6.2-rc1-withunsigneds/include/linux/skbuff.h
--- linux-2.6.2-rc1/include/linux/skbuff.h	2004-01-09 07:59:44.000000000 +0100
+++ linux-2.6.2-rc1-withunsigneds/include/linux/skbuff.h	2004-01-24 16:40:42.000000000 +0100
@@ -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)))

             reply	other threads:[~2004-01-24 17:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-24 17:05 Bart Samwel [this message]
2004-01-24 18:02 ` [PATCH] [TRIVIAL] "unsigned char"/"char" consistency? David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4012A5F5.2000804@samwel.tk \
    --to=bart@samwel.tk \
    --cc=linux-net@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).