From: "George Spelvin" <linux@horizon.com>
To: arend@broadcom.com, linux@horizon.com
Cc: akpm@linux-foundation.org, error27@gmail.com,
linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org,
linville@tuxdriver.com
Subject: Re: [RFC] lib: crc8: add new library module providing crc8 algorithm
Date: 25 May 2011 01:46:34 -0400 [thread overview]
Message-ID: <20110525054634.5033.qmail@science.horizon.com> (raw)
In-Reply-To: <4DDC91E1.40104@broadcom.com>
> On 05/25/2011 12:52 AM, George Spelvin wrote:
>> May I suggest that crc8_create is A Stupid Idea. Since the bit order
>> (and polynomial) will always be compile-time constants, just let the
>> call sites call crc8_create_[lm]sb_first() directly.
> Thanks for be subtle in your suggestion.
Since you are obviously being ironic in your phrasing, I hope I did not
give serious offense. What I wrote is a fairly accurate description of
my reflex reaction, but I could have phrased it more diplomatically.
> If callers use the specific function they can not specify a bit order so
> no compile-time error.
What I meant was, the bit order is specified by the function name.
An invalid bit order translates to an invalid function name, which the
linker will complain about.
If you feel ambitious, you can fold the crc7 code into yours. Its an
msbit-first CRC. The resultant table will be left-justified rather
than the current right-justified, but if you look at all the call sites,
you'll notice that they all shift the result left 1 bit!
I have a pending bug report about some of the calling code which I
noticed when trying to update it myself, but it doesn't actally
prevent updating the crc7() call sites:
http://marc.info/?l=linux-wireless&m=130616050311698
next prev parent reply other threads:[~2011-05-25 5:46 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-24 20:23 [RFC] lib: crc8: add new library module providing crc8 algorithm Arend van Spriel
2011-05-24 22:52 ` George Spelvin
2011-05-25 5:21 ` Arend van Spriel
2011-05-25 5:46 ` George Spelvin [this message]
2011-05-25 6:49 ` Arend van Spriel
-- strict thread matches above, loose matches on Subject: below --
2011-05-22 8:08 Arend van Spriel
2011-05-22 8:59 ` Nicolas Kaiser
2011-05-22 12:49 ` Arend van Spriel
2011-05-21 20:49 Arend van Spriel
2011-05-21 22:37 ` Johannes Berg
2011-05-22 8:23 ` Arend van Spriel
2011-05-22 11:23 ` Alan Cox
2011-05-22 12:47 ` Arend van Spriel
[not found] ` <20110522151959.7fd6e87e@lxorguk.ukuu.org.uk>
2011-05-22 15:38 ` Arend van Spriel
2011-05-24 7:45 ` Arend van Spriel
2011-05-24 8:30 ` Arend van Spriel
2011-05-24 9:44 ` Alan Cox
2011-05-24 10:01 ` Arend van Spriel
2011-05-24 10:25 ` Rafał Miłecki
2011-05-24 10:40 ` Arend van Spriel
2011-05-24 10:27 ` Alan Cox
2011-05-24 10:38 ` Arend van Spriel
2011-05-24 12:57 ` Alan Cox
2011-05-24 17:00 ` Arend van Spriel
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=20110525054634.5033.qmail@science.horizon.com \
--to=linux@horizon.com \
--cc=akpm@linux-foundation.org \
--cc=arend@broadcom.com \
--cc=error27@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.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).