All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Joel Soete" <soete.joel@tiscali.be>
To: "Jon Oberheide" <jon@oberheide.org>
Cc: "Marcelo Tosatti" <marcelo.tosatti@cyclades.com>,
	"Daniel Jacobowitz" <dan@debian.org>,
	"Vojtech Pavlik" <vojtech@suse.cz>,
	"Linux Kernel" <linux-kernel@vger.kernel.org>
Subject: Re: Some cleanup patches for: '...lvalues is deprecated'
Date: Fri, 30 Jul 2004 19:29:40 +0200	[thread overview]
Message-ID: <40FB9ACA00005770@ocpmta1.freegates.net> (raw)
In-Reply-To: <40FB9ACA00005567@ocpmta1.freegates.net>

[-- Attachment #1: Type: text/plain, Size: 1520 bytes --]

And finaly may be lib/crc32.c diff like:
--- linux-2.4.27-rc3-pa6mm/lib/crc32.c.Orig	2004-06-29 11:29:31.000000000
+0200
+++ linux-2.4.27-rc3-pa6mm/lib/crc32.c	2004-07-30 17:17:56.143095488 +0200
@@ -99,7 +99,9 @@
 	/* Align it */
 	if(unlikely(((long)b)&3 && len)){
 		do {
-			DO_CRC(*((u8 *)b)++);
+			u8 *pb = (u8 *)b;
+			DO_CRC(*pb++);
+			b = (u32 *)pb;
 		} while ((--len) && ((long)b)&3 );
 	}
 	if(likely(len >= 4)){
@@ -120,7 +122,9 @@
 	/* And the last few bytes */
 	if(len){
 		do {
-			DO_CRC(*((u8 *)b)++);
+			u8 *pb = (u8 *)b;
+			DO_CRC(*pb++);
+			b = (u32 *)pb;
 		} while (--len);
 	}

@@ -200,7 +204,9 @@
 	/* Align it */
 	if(unlikely(((long)b)&3 && len)){
 		do {
-			DO_CRC(*((u8 *)b)++);
+			u8 *pb = (u8 *)b;
+			DO_CRC(*pb++);
+			b = (u32 *)pb;
 		} while ((--len) && ((long)b)&3 );
 	}
 	if(likely(len >= 4)){
@@ -221,7 +227,9 @@
 	/* And the last few bytes */
 	if(len){
 		do {
-			DO_CRC(*((u8 *)b)++);
+			u8 *pb = (u8 *)b;
+			DO_CRC(*pb++);
+			b = (u32 *)pb;
 		} while (--len);
 	}
 	return __be32_to_cpu(crc);
=========><=========

(i prefer pb to avoid possible reading confusion with outer p parameter?
and replace usage of (void *) by (u32 *) as the actual b type)

Thanks for additional attention,
    Joel

---------------------------------------------------------------------------
Tiscali ADSL LIGHT, 19,95 EUR/mois pendant 6 mois, c'est le moment de faire
le pas!
http://reg.tiscali.be/default.asp?lg=fr





[-- Attachment #2: lib-crc32.c.diff --]
[-- Type: application/octet-stream, Size: 1010 bytes --]

--- linux-2.4.27-rc3-pa6mm/lib/crc32.c.Orig	2004-06-29 11:29:31.000000000 +0200
+++ linux-2.4.27-rc3-pa6mm/lib/crc32.c	2004-07-30 17:17:56.143095488 +0200
@@ -99,7 +99,9 @@
 	/* Align it */
 	if(unlikely(((long)b)&3 && len)){
 		do {
-			DO_CRC(*((u8 *)b)++);
+			u8 *pb = (u8 *)b;
+			DO_CRC(*pb++);
+			b = (u32 *)pb;
 		} while ((--len) && ((long)b)&3 );
 	}
 	if(likely(len >= 4)){
@@ -120,7 +122,9 @@
 	/* And the last few bytes */
 	if(len){
 		do {
-			DO_CRC(*((u8 *)b)++);
+			u8 *pb = (u8 *)b;
+			DO_CRC(*pb++);
+			b = (u32 *)pb;
 		} while (--len);
 	}
 
@@ -200,7 +204,9 @@
 	/* Align it */
 	if(unlikely(((long)b)&3 && len)){
 		do {
-			DO_CRC(*((u8 *)b)++);
+			u8 *pb = (u8 *)b;
+			DO_CRC(*pb++);
+			b = (u32 *)pb;
 		} while ((--len) && ((long)b)&3 );
 	}
 	if(likely(len >= 4)){
@@ -221,7 +227,9 @@
 	/* And the last few bytes */
 	if(len){
 		do {
-			DO_CRC(*((u8 *)b)++);
+			u8 *pb = (u8 *)b;
+			DO_CRC(*pb++);
+			b = (u32 *)pb;
 		} while (--len);
 	}
 	return __be32_to_cpu(crc);

  reply	other threads:[~2004-07-30 17:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-03 12:53 Some cleanup patches for: '...lvalues is deprecated' Joel Soete
2004-07-03 20:56 ` Vojtech Pavlik
2004-07-03 21:39   ` Joel Soete
2004-07-03 21:45     ` Vojtech Pavlik
2004-07-05  5:10   ` Daniel Jacobowitz
2004-07-05  8:59     ` David Vrabel
2004-07-05 11:59     ` Joel Soete
2004-07-27 12:54       ` Marcelo Tosatti
2004-07-27 15:59         ` Joel Soete
2004-07-27 16:31           ` Jon Oberheide
2004-07-30  9:11             ` Joel Soete
2004-07-30 12:51               ` Joel Soete
2004-07-30 17:29                 ` Joel Soete [this message]
2004-07-27 15:59         ` Joel Soete
  -- strict thread matches above, loose matches on Subject: below --
2004-07-31  8:41 Mikael Pettersson
2004-08-01 10:40 ` Adrian Bunk
2004-08-02 11:34 Mikael Pettersson
2004-08-02 23:08 ` Adrian Bunk

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=40FB9ACA00005770@ocpmta1.freegates.net \
    --to=soete.joel@tiscali.be \
    --cc=dan@debian.org \
    --cc=jon@oberheide.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.com \
    --cc=vojtech@suse.cz \
    /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.