* [PATCH] makefile bug and some cleanup
@ 2003-03-02 9:23 Robert Schwebel
2003-03-02 10:57 ` Jörn Engel
0 siblings, 1 reply; 6+ messages in thread
From: Robert Schwebel @ 2003-03-02 9:23 UTC (permalink / raw)
To: linux-mtd
--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
--
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--
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH] makefile bug and some cleanup
2003-03-02 9:23 [PATCH] makefile bug and some cleanup Robert Schwebel
@ 2003-03-02 10:57 ` Jörn Engel
2003-03-02 18:14 ` Jörn Engel
0 siblings, 1 reply; 6+ messages in thread
From: Jörn Engel @ 2003-03-02 10:57 UTC (permalink / raw)
To: linux-mtd
On Sun, 2 March 2003 10:23:59 +0100, Robert Schwebel wrote:
>
> 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.
> - 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
--
Geld macht nicht gl?cklich.
Gl?ck macht nicht satt.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] makefile bug and some cleanup
2003-03-02 10:57 ` Jörn Engel
@ 2003-03-02 18:14 ` Jörn Engel
2003-03-03 10:58 ` Jörn Engel
2003-03-04 8:13 ` Robert Schwebel
0 siblings, 2 replies; 6+ messages in thread
From: Jörn Engel @ 2003-03-02 18:14 UTC (permalink / raw)
To: linux-mtd
On Sun, 2 March 2003 11:57:30 +0100, J?rn Engel wrote:
>
> First looks trivial. The second feels wrong.
>
> > printf("\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
--
When people work hard for you for a pat on the back, you've got
to give them that pat.
-- Robert Heinlein
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH] makefile bug and some cleanup
2003-03-02 18:14 ` Jörn Engel
@ 2003-03-03 10:58 ` Jörn Engel
2003-03-04 8:13 ` Robert Schwebel
1 sibling, 0 replies; 6+ messages in thread
From: Jörn Engel @ 2003-03-03 10:58 UTC (permalink / raw)
To: linux-mtd
On Sun, 2 March 2003 19:14:39 +0100, J?rn Engel wrote:
>
> 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
--
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
>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: <E18ppSZ-0009V6-00@f7.mail.ru>
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] makefile bug and some cleanup
2003-03-02 18:14 ` Jörn Engel
2003-03-03 10:58 ` Jörn Engel
@ 2003-03-04 8:13 ` Robert Schwebel
2003-03-04 9:12 ` Jörn Engel
1 sibling, 1 reply; 6+ messages in thread
From: Robert Schwebel @ 2003-03-04 8:13 UTC (permalink / raw)
To: linux-mtd
On Sun, Mar 02, 2003 at 07:14:39PM +0100, J?rn Engel wrote:
> 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?
Sounds sane.
Robert
--
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
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH] makefile bug and some cleanup
2003-03-04 8:13 ` Robert Schwebel
@ 2003-03-04 9:12 ` Jörn Engel
0 siblings, 0 replies; 6+ messages in thread
From: Jörn Engel @ 2003-03-04 9:12 UTC (permalink / raw)
To: linux-mtd
On Tue, 4 March 2003 09:13:46 +0100, Robert Schwebel wrote:
> >
> > Robert, do you agree? Is is ok if I commit my proposed patch?
>
> Sounds sane.
Ok, both are in cvs now.
J?rn
--
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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-03-04 9:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-02 9:23 [PATCH] makefile bug and some cleanup Robert Schwebel
2003-03-02 10:57 ` Jörn Engel
2003-03-02 18:14 ` Jörn Engel
2003-03-03 10:58 ` Jörn Engel
2003-03-04 8:13 ` Robert Schwebel
2003-03-04 9:12 ` Jörn Engel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox