mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: "'Fabio M. De Francesco'" <fmdefrancesco@gmail.com>,
	Larry Finger <Larry.Finger@lwfinger.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-staging@lists.linux.dev" <linux-staging@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kernel test robot" <lkp@intel.com>
Cc: "kbuild-all@lists.01.org" <kbuild-all@lists.01.org>,
	"fabioaiuto83@gmail.com" <fabioaiuto83@gmail.com>
Subject: RE: [PATCH] staging: rtl8188eu: Replace a custom function with crc32_le()
Date: Sat, 10 Jul 2021 20:42:02 +0000	[thread overview]
Message-ID: <d53fb195104a4b269a7cd320049a133b@AcuMS.aculab.com> (raw)
In-Reply-To: <1790135.9ZQ2ZFNHWj@linux.local>

From: Fabio M. De Francesco
> Sent: 10 July 2021 15:39
...
> [CUT]
[PASTE}
> 597						*((__le32 *)crc) = ~crc32_le(~0, payload, length);
> 
> I suppose that these warnings are false positives for the reasons explained in
> my patch.

No they are an indication you aren't doing things 'right'.
You shouldn't need an __le32 cast in this code.
'crc' should be defined as __le32 (not u8[4]) and IIRC
get_unaligned_le32() used in the latter check.

Actually what is this code actually doing.
ISTR it is doing a crc32() and then comparing the result with the
crc in the buffer?
No hardware ever does that.
What happens is the receiver does the crc of the whole buffer
including the transmitted crc and then checks the value is the
required 'magic' constant'.
This all works because the crc is inverted before transmission.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


  reply	other threads:[~2021-07-10 20:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01 13:38 Fabio M. De Francesco
2021-07-01 14:52 ` David Laight
2021-07-01 15:23   ` Fabio M. De Francesco
2021-07-01 15:54     ` David Laight
2021-07-01 16:10       ` Fabio M. De Francesco
2021-07-10  0:25 ` kernel test robot
2021-07-10 14:38   ` Fabio M. De Francesco
2021-07-10 20:42     ` David Laight [this message]
2021-07-13 12:50 ` Greg Kroah-Hartman
2021-07-13 17:52   ` Fabio M. De Francesco

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=d53fb195104a4b269a7cd320049a133b@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=fabioaiuto83@gmail.com \
    --cc=fmdefrancesco@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=lkp@intel.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

Powered by JetHome