[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d53fb195104a4b269a7cd320049a133b@AcuMS.aculab.com>
Date: Sat, 10 Jul 2021 20:42:02 +0000
From: David Laight <David.Laight@...LAB.COM>
To: "'Fabio M. De Francesco'" <fmdefrancesco@...il.com>,
Larry Finger <Larry.Finger@...inger.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"linux-staging@...ts.linux.dev" <linux-staging@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kernel test robot" <lkp@...el.com>
CC: "kbuild-all@...ts.01.org" <kbuild-all@...ts.01.org>,
"fabioaiuto83@...il.com" <fabioaiuto83@...il.com>
Subject: RE: [PATCH] staging: rtl8188eu: Replace a custom function with
crc32_le()
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)
Powered by blists - more mailing lists