All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giacomo Lozito <city_hunter@azzurra.org>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] fix for userspace usage of include/linux/crc-ccitt.h in 2.6.9-rc1
Date: Sat, 28 Aug 2004 20:12:46 +0200	[thread overview]
Message-ID: <200408282012.47295.city_hunter@azzurra.org> (raw)

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


This patch solves the issue described in this post:
http://lkml.org/lkml/2004/8/26/119
by using __u16 and __u8 in place of u16 and u8, that aren't exported outside 
the kernel.

If it's really trivial to use u16 and u8 for crc-ccitt.h, another way of 
solving this could be to use #ifdef __KERNEL__
in crc-ccitt.h to separate userspace usage from kernel matters.

Regards,
Giacomo Lozito

[-- Attachment #2: crc-ccitt.h.2.6.9-rc1.userspace.patch --]
[-- Type: text/x-diff, Size: 579 bytes --]

--- a/include/linux/crc-ccitt.h	2004-08-28 19:40:39.000000000 +0200
+++ b/include/linux/crc-ccitt.h	2004-08-28 19:38:10.000000000 +0200
@@ -3,11 +3,11 @@
 
 #include <linux/types.h>
 
-extern u16 const crc_ccitt_table[256];
+extern __u16 const crc_ccitt_table[256];
 
-extern u16 crc_ccitt(u16 crc, const u8 *buffer, size_t len);
+extern __u16 crc_ccitt(__u16 crc, const __u8 *buffer, size_t len);
 
-static inline u16 crc_ccitt_byte(u16 crc, const u8 c)
+static inline __u16 crc_ccitt_byte(__u16 crc, const __u8 c)
 {
 	return (crc >> 8) ^ crc_ccitt_table[(crc ^ c) & 0xff];
 }

                 reply	other threads:[~2004-08-28 18:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200408282012.47295.city_hunter@azzurra.org \
    --to=city_hunter@azzurra.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.