linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
To: 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>,
	David Laight <David.Laight@aculab.com>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH] staging: rtl8188eu: Replace a custom function with crc32_le()
Date: Thu, 01 Jul 2021 17:23:38 +0200	[thread overview]
Message-ID: <2058378.BL2Rai63ie@linux.local> (raw)
In-Reply-To: <2fac9d8813374e95bcc04134a0f40f45@AcuMS.aculab.com>

On Thursday, July 1, 2021 4:52:08 PM CEST David Laight wrote:
> From: Fabio M. De Francesco
> 
> > Sent: 01 July 2021 14:38
> > 
> > Use crc32_le in place of the custom getcrc32. This change makes GCC
> > to warn about incorrect castings to the restricted type __le32, but
> > they can be safely ignored because crc32_le calculates bitwise
> > little-endian Ethernet AUTODIN II CRC32.
> 
> ...
> 
> > -					*((__le32 *)crc) = 
getcrc32(payload, length);/* modified by Amy*/
> > +					*((__le32 *)crc) = 
~crc32_le(~0, payload, length);
> 
> Haven't we been round this before?
>
No, I don't think so. At least, not you and I.

Unfortunately, I don't get paid to read every conversation sent to the Linux 
related mailing lists.

However, since you pointed out that somewhere, in an unspecified time, this 
topic had already been discussed I've just found an email of yours: https://
lore.kernel.org/lkml/bdc0c31a7d28426995d229eb9014cd2b@AcuMS.aculab.com/

I think that there you are talking of something else.

Perhaps, in the same thread there's an email from Al Viro that seems to be 
more pertinent: https://lore.kernel.org/lkml/YMz0DH0+v39xsCYU@zeniv-ca.linux.org.uk/

In particular, Al Viro writes "[...] Either make crc __le32 (and turn 
assignment into crc = cpu_to_le32(...)), or
make that *(__le32 *)crc = ...".

> You need to get rid of these crappy casts.

So, what am I missing?

Thanks,

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





  reply	other threads:[~2021-07-01 15:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01 13:38 [PATCH] staging: rtl8188eu: Replace a custom function with crc32_le() Fabio M. De Francesco
2021-07-01 14:52 ` David Laight
2021-07-01 15:23   ` Fabio M. De Francesco [this message]
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
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=2058378.BL2Rai63ie@linux.local \
    --to=fmdefrancesco@gmail.com \
    --cc=David.Laight@aculab.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=viro@zeniv.linux.org.uk \
    /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).