makefile bug and some cleanup
PATCH 1/1 makefile bug and some cleanup
--V88s5gaDVPzZ0KCq
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: inline
Here are two patches against current CVS; the first one fixes the utils/Makefile, the second one removes some warnings for erase.c.
Please apply.
Robert
Signature · 72 lines
Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
Pengutronix - Linux Solutions for Science and Industry
Braunschweiger Str. 79, 31134 Hildesheim, Germany
Handelsregister: Amtsgericht Hildesheim, HRA 2686
Phone: +49-5121-28619-0 | Fax: +49-5121-28619-4
--V88s5gaDVPzZ0KCq
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: attachment; filename="Makefile.diff"
Index: Makefile
===================================================================
RCS file: /home/cvs/mtd/util/Makefile,v
retrieving revision 1.28
diff -u -b -B -w -p -u -r1.28 Makefile
--- Makefile 18 Feb 2003 11:36:08 -0000 1.28
+++ Makefile 2 Mar 2003 09:17:40 -0000
@@ -24,12 +24,12 @@ $(SYMLINKS):
ln -sf ../fs/jffs2/$@ $@
mkfs.jffs2: crc32.o compr_rtime.o mkfs.jffs2.o compr_zlib.o
- $(CC) $(CFLAGS) -o $@ $^ -lz
+ $(CC) $(LDFLAGS) -o $@ $^ -lz
eraseall: crc32.o eraseall.o
- $(CC) $(CFLAGS) -o $@ $^ -lz
+ $(CC) $(LDFLAGS) -o $@ $^ -lz
jffs2reader: jffs2reader.o
- $(CC) $(CFLAGS) -o $@ $^ -lz
+ $(CC) $(LDFLAGS) -o $@ $^ -lz
--V88s5gaDVPzZ0KCq
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: attachment; filename="erase.diff"
Index: erase.c
===================================================================
RCS file: /home/cvs/mtd/util/erase.c,v
retrieving revision 1.9
diff -u -b -B -w -p -u -r1.9 erase.c
--- erase.c 17 May 2002 08:54:31 -0000 1.9
+++ erase.c 2 Mar 2003 09:23:45 -0000
@@ -63,7 +63,7 @@ int region_erase(int Fd, int start, int
}
}
printf("\rPerforming Flash Erase of length %lu at offset 0x%lx",
- erase.length, erase.start);
+ (unsigned long)erase.length, (unsigned long)erase.start);
fflush(stdout);
if(ioctl(Fd, MEMERASE, &erase) != 0)
{
@@ -100,13 +100,13 @@ int non_region_erase(int Fd, int start,
for (; count > 0; count--) {
printf("\rPerforming Flash Erase of length %lu at offset 0x%lx",
- erase.length, erase.start);
+ (unsigned long)erase.length, (long)erase.start);
fflush(stdout);
if(unlock != 0)
{
//Unlock the sector first.
- printf("\rPerforming Flash unlock at offset 0x%lx",erase.start);
+ printf("\rPerforming Flash unlock at offset 0x%lx",(long)erase.start);
if(ioctl(Fd, MEMUNLOCK, &erase) != 0)
{
perror("\nMTD Unlock failure");
--V88s5gaDVPzZ0KCq--PATCH 1/1 makefile bug and some cleanup
Quoted 3 lines · Robert Schwebel
Here are two patches against current CVS; the first one fixes the utils/Makefile, the second one removes some warnings for
erase.c.
First looks trivial. The second feels wrong.
Review
Quoted 2 lines
(quoted diff) +1
-1- erase.length, erase.start); + (unsigned long)erase.length, (unsigned long)erase.start);
People (including me) are easily lured into fixing the warnings, which are only symptoms, instead of the real causes. And this looks exactly like a symptom fix.
Could be right, though, I didn't dig into the code yet. Maybe tonight.
J?rn
Signature · 2 lines
Geld macht nicht gl?cklich. Gl?ck macht nicht satt.
PATCH 1/1 makefile bug and some cleanup
Quoted 10 lines · J?rn Engel
First looks trivial. The second feels wrong.
Review
Quoted 3 lines
(quoted diff) +1
-1printf("\rPerforming Flash Erase of length %lu at offset 0x%lx", - erase.length, erase.start); + (unsigned long)erase.length, (unsigned long)erase.start);People (including me) are easily lured into fixing the warnings, which are only symptoms, instead of the real causes. And this looks exactly like a symptom fix.
Here are the warnings:erase.c: In function `region_erase':
erase.c:66: warning: long unsigned int format, u_int32_t arg (arg 2) erase.c:66: warning: long unsigned int format, u_int32_t arg (arg 3) erase.c: In function `non_region_erase':
erase.c:103: warning: long unsigned int format, u_int32_t arg (arg 2) erase.c:103: warning: long unsigned int format, u_int32_t arg (arg 3) erase.c:109: warning: long unsigned int format, u_int32_t arg (arg 2)
And they are correct. u_int32_t is typedef'd to be unsigned int on all platforms for the linux kernel and in glibc for i386.
I'd have to check this on a 64bit machine on Monday but I expect pretty ugly results. Correct fix would be to remove the 'l' from the format string each and every time.
Robert, do you agree? Is is ok if I commit my proposed patch?
J?rn
Signature · 3 lines
When people work hard for you for a pat on the back, you've got to give them that pat. -- Robert Heinlein
PATCH 1/1 makefile bug and some cleanup
Quoted 4 lines · J?rn Engel
I'd have to check this on a 64bit machine on Monday but I expect pretty ugly results. Correct fix would be to remove the 'l' from the format string each and every time.
Ok, 64bit machines obviously don't mind the current code, %lx does not imply %08lx. Silly me.
J?rn
Signature · 4 lines
Data dominates. If you've chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming. -- Rob Pike
Quoted 1 line
From Alex Mon Mar 3 07:54:23 2003
From: Alex (Alex)
Date: Mon, 03 Mar 2003 15:54:23 +0300
Subject: AMD AM30LV0064D and linux
Message-ID: <[email protected]>
Hello all!
Could somebody help me with information about compability of Linux and AMD Flash AM30LV0064D (it is UltraNAND). AMD itself keeps silence. Generally is it possible to boot Linux from this device, and then run root file system from it?
Please help me, you are my last hope.
Thank you.
PATCH 1/1 makefile bug and some cleanup
In reply to Jörn EngelQuoted 8 lines · J?rn Engel
And they are correct.
u_int32_tis typedef'd to be unsigned int on all platforms for the linux kernel and in glibc for i386.I'd have to check this on a 64bit machine on Monday but I expect pretty ugly results. Correct fix would be to remove the 'l' from the format string each and every time.
Robert, do you agree? Is is ok if I commit my proposed patch?
Sounds sane.
Robert
Signature · 5 lines
Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
Pengutronix - Linux Solutions for Science and Industry
Braunschweiger Str. 79, 31134 Hildesheim, Germany
Handelsregister: Amtsgericht Hildesheim, HRA 2686
Phone: +49-5121-28619-0 | Fax: +49-5121-28619-4PATCH 1/1 makefile bug and some cleanup
Quoted 4 lines · Robert Schwebel
Quoted 2 lines
Robert, do you agree? Is is ok if I commit my proposed patch?
Sounds sane.
Ok, both are in cvs now.
J?rn
Signature · 4 lines
Data dominates. If you've chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming. -- Rob Pike