All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-wireless@vger.kernel.org, slapin@ossfans.org,
	maxim.osipov@siemens.com, dmitry.baryshkov@siemens.com,
	oliver.fendt@siemens.com, linux@youmustbejoking.demon.co.uk
Subject: Re: [PATCH 01/10] crc-itu-t: add bit-reversed calculation
Date: Wed, 3 Jun 2009 17:05:06 -0700	[thread overview]
Message-ID: <20090603170506.a10cc38f.akpm@linux-foundation.org> (raw)
In-Reply-To: <1243868091-5315-2-git-send-email-dbaryshkov@gmail.com>

On Mon,  1 Jun 2009 18:54:42 +0400
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> wrote:

> From: Darren Salt <linux@youmustbejoking.demon.co.uk>
> 
> ..
>
>  static inline u16 crc_itu_t_byte(u16 crc, const u8 data)
>  {
>  	return (crc << 8) ^ crc_itu_t_table[((crc >> 8) ^ data) & 0xff];
>  }
>  
> +static inline u16 crc_itu_t_bitreversed_byte(u16 crc, const u8 data)
> +{
> +	return (crc << 8) ^ crc_itu_t_table[((crc >> 8) ^ bitrev8(data)) & 0xff];
> +}

I suspect that inlining these was a mistake, but one which we make often.

>  #endif /* CRC_ITU_T_H */
>  
> diff --git a/lib/crc-itu-t.c b/lib/crc-itu-t.c
> index a63472b..5562fdd 100644
> --- a/lib/crc-itu-t.c
> +++ b/lib/crc-itu-t.c
> @@ -64,6 +64,24 @@ u16 crc_itu_t(u16 crc, const u8 *buffer, size_t len)
>  }
>  EXPORT_SYMBOL(crc_itu_t);
>  
> +/**
> + * crc_itu_t_bitreversed - Compute the CRC-ITU-T for the data buffer;
> + * the buffer content is assumed to be bit-reversed

kerneldoc doesn't support the breaking of this information across
multiple lines.  It'll need to be done as a single 120-column line.


> + * @crc:     previous CRC value
> + * @buffer:  data pointer
> + * @len:     number of bytes in the buffer
> + *
> + * Returns the updated CRC value
> + */
> +u16 crc_itu_t_bitreversed(u16 crc, const u8 *buffer, size_t len)
> +{
> +	while (len--)
> +		crc = crc_itu_t_bitreversed_byte(crc, *buffer++);
> +	return crc;
> +}
> +EXPORT_SYMBOL(crc_itu_t_bitreversed);


  parent reply	other threads:[~2009-06-04  0:05 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-01 14:54 [RFC][WIP] IEEE 802.15.4 implementation for Linux v1 Dmitry Eremin-Solenikov
2009-06-01 14:54 ` [PATCH 01/10] crc-itu-t: add bit-reversed calculation Dmitry Eremin-Solenikov
2009-06-01 14:54   ` [PATCH 02/10] Add constants for the ieee 802.15.4/ZigBee stack Dmitry Eremin-Solenikov
2009-06-01 14:54     ` [PATCH 03/10] net: add IEEE 802.15.4 socket family implementation Dmitry Eremin-Solenikov
2009-06-01 14:54       ` [PATCH 04/10] net: add NL802154 interface for configuration of 802.15.4 devices Dmitry Eremin-Solenikov
2009-06-01 14:54         ` [PATCH 05/10] ieee802154: add simple HardMAC driver sample Dmitry Eremin-Solenikov
2009-06-01 14:54           ` [PATCH 06/10] mac802154: add a software MAC 802.15.4 implementation Dmitry Eremin-Solenikov
2009-06-01 14:54             ` [PATCH 07/10] ieee802154: add virtual loopback driver Dmitry Eremin-Solenikov
2009-06-01 14:54               ` [PATCH 08/10] tty_io: export tty_class Dmitry Eremin-Solenikov
2009-06-01 14:54                 ` [PATCH 09/10] ieee802154: add serial dongle driver Dmitry Eremin-Solenikov
2009-06-01 14:54                   ` [PATCH 10/10] ieee802154: add at86rf230/rf231 spi driver Dmitry Eremin-Solenikov
2009-06-01 16:21                     ` Gábor Stefanik
2009-06-01 20:33                       ` Dmitry Eremin-Solenikov
2009-06-02  8:10                         ` Holger Schurig
2009-06-02  8:21                           ` Marcel Holtmann
2009-06-02  8:29                             ` Ответ: " Dmitry Eremin-Solenikov
2009-06-02  8:36                               ` Marcel Holtmann
2009-06-02  8:46                                 ` Florian Fainelli
2009-06-02  8:49                                 ` Maxim Osipov
2009-06-02  9:15                                   ` Holger Schurig
2009-06-02  9:29                                   ` ?????: " Jonathan Cameron
2009-06-02 11:42                                     ` Dmitry Eremin-Solenikov
2009-06-02  8:52                                 ` Ответ: " Sergey Lapin
2009-06-01 15:27                   ` [PATCH 09/10] ieee802154: add serial dongle driver Alan Cox
2009-06-01 20:29                     ` Dmitry Eremin-Solenikov
2009-06-01 21:52                       ` Alan Cox
2009-06-02 14:43                         ` Sergey Lapin
2009-06-01 15:07                 ` [PATCH 08/10] tty_io: export tty_class Alan Cox
2009-06-01 15:10                   ` Dmitry Eremin-Solenikov
2009-06-01 15:34                     ` Alan Cox
2009-06-02 14:22                       ` Dmitry Eremin-Solenikov
2009-06-02 14:35                         ` Alan Cox
2009-06-05 12:24             ` [PATCH 06/10] mac802154: add a software MAC 802.15.4 implementation Pavel Machek
2009-06-04  0:32       ` [PATCH 03/10] net: add IEEE 802.15.4 socket family implementation Andrew Morton
2009-06-04 11:16         ` Dmitry Eremin-Solenikov
2009-06-04 13:46           ` John W. Linville
2009-06-04 14:10             ` Dmitry Eremin-Solenikov
2009-06-04 14:15               ` Johannes Berg
2009-06-04  0:05   ` Andrew Morton [this message]
2009-06-05  4:03 ` [RFC][WIP] IEEE 802.15.4 implementation for Linux v1 Jon Smirl
2009-06-05  4:49   ` Dmitry Eremin-Solenikov
2009-06-05 12:58     ` Jon Smirl
2009-06-13  3:21 ` Jon Smirl
2009-06-13  5:37   ` Maxim Osipov
2009-06-13 12:39     ` Jon Smirl
2009-06-21  6:40   ` Pavel Machek

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=20090603170506.a10cc38f.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=dbaryshkov@gmail.com \
    --cc=dmitry.baryshkov@siemens.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linux@youmustbejoking.demon.co.uk \
    --cc=maxim.osipov@siemens.com \
    --cc=netdev@vger.kernel.org \
    --cc=oliver.fendt@siemens.com \
    --cc=slapin@ossfans.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.