Re: Some cleanup patches for: '...lvalues is deprecated'

From: Joel Soete
Date: Fri Jul 30 2004 - 07:54:10 EST


Sorry but previous time included file were well readable and not this time?
too bad.

So here there are (cut and past? sorry in advance if bad wrapping will occurs)

--- linux-2.4.27-rc3-pa6mm/kernel/sysctl.c.Orig 2004-06-29 09:03:42.000000000
+0200
+++ linux-2.4.27-rc3-pa6mm/kernel/sysctl.c 2004-07-29 11:41:30.021094824
+0200
@@ -883,14 +883,15 @@

for (; left && vleft--; i++, first=0) {
if (write) {
+ p = buffer;
while (left) {
char c;
- if (get_user(c, (char *) buffer))
+ if (get_user(c, p))
return -EFAULT;
if (!isspace(c))
break;
left--;
- ((char *) buffer)++;
+ p++;
}
if (!left)
break;
@@ -1036,14 +1037,15 @@

for (; left && vleft--; i++, min++, max++, first=0) {
if (write) {
+ p = buffer;
while (left) {
char c;
- if (get_user(c, (char *) buffer))
+ if (get_user(c, p))
return -EFAULT;
if (!isspace(c))
break;
left--;
- ((char *) buffer)++;
+ p++;
}
if (!left)
break;
@@ -1137,14 +1139,15 @@

for (; left && vleft--; i++, first=0) {
if (write) {
+ p = (char *)buffer;
while (left) {
char c;
- if (get_user(c, (char *) buffer))
+ if (get_user(c, p))
return -EFAULT;
if (!isspace(c))
break;
left--;
- ((char *) buffer)++;
+ p++;
}
if (!left)
break;
--- linux-2.4.27-rc3-pa6mm/fs/readdir.c.Orig 2004-06-29 11:18:46.000000000
+0200
+++ linux-2.4.27-rc3-pa6mm/fs/readdir.c 2004-07-29 12:54:45.000000000 +0200
@@ -264,7 +264,7 @@
put_user(reclen, &dirent->d_reclen);
copy_to_user(dirent->d_name, name, namlen);
put_user(0, dirent->d_name + namlen);
- ((char *) dirent) += reclen;
+ dirent = (struct linux_dirent *)((char *)dirent + reclen);
buf->current_dir = dirent;
buf->count -= reclen;
return 0;
@@ -347,7 +347,7 @@
copy_to_user(dirent, &d, NAME_OFFSET(&d));
copy_to_user(dirent->d_name, name, namlen);
put_user(0, dirent->d_name + namlen);
- ((char *) dirent) += reclen;
+ dirent = (struct linux_dirent64 *)((char *)dirent + reclen);
buf->current_dir = dirent;
buf->count -= reclen;
return 0;
--- linux-2.4.27-rc3-pa6mm/drivers/video/fbcon.c.Orig 2004-06-29 10:47:31.000000000
+0200
+++ linux-2.4.27-rc3-pa6mm/drivers/video/fbcon.c 2004-07-30 09:21:43.295828520
+0200
@@ -1877,7 +1877,10 @@
font length must be multiple of 256, at least. And 256 is multiple
of 4 */
k = 0;
- while (p > new_data) k += *--(u32 *)p;
+ while (p > new_data) {
+ p -= 4;
+ k += *(u32 *)p;
+ }
FNTSUM(new_data) = k;
/* Check if the same font is on some other console already */
for (i = 0; i < MAX_NR_CONSOLES; i++) {
=========><=========

> -- Original Message --
> Date: Fri, 30 Jul 2004 11:11:32 +0200
> From: "Joel Soete" <soete.joel@xxxxxxxxxx>
> Subject: Re: Some cleanup patches for: '...lvalues is deprecated'
> To: "Jon Oberheide" <jon@xxxxxxxxxxxxx>
> Cc: "Marcelo Tosatti" <marcelo.tosatti@xxxxxxxxxxxx>,
> "Daniel Jacobowitz" <dan@xxxxxxxxxx>,
> "Vojtech Pavlik" <vojtech@xxxxxxx>,
> "Linux Kernel" <linux-kernel@xxxxxxxxxxxxxxx>
>
>
> Hello *,
>
> >
> > FYI, lvalue casts are treated as errors in gcc 3.5.
> >
> According to this kind remark, I think so that following attachement patches
> would be interesting.
> Thanks for all relevant remarks to help me to make stuff cleaner.
>
> Joel
>
> PS: I don't yet review the lib/crc32.c (sorry I need more effort to review)
>
>
> ---------------------------------------------------------------------------
> 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: drivers-video-fbcon.diff
>
>
> Attachment: fs-readdir.diff
>
>
> Attachment: kernel-sysctl.diff
>


---------------------------------------------------------------------------
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




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/