* [PATCH] C99 initializers for drivers/mtd files
@ 2003-02-26 20:53 Art Haas
2003-02-27 19:44 ` Jörn Engel
0 siblings, 1 reply; 9+ messages in thread
From: Art Haas @ 2003-02-26 20:53 UTC (permalink / raw)
To: linux-mtd
Hi.
Here is a set of patches for converting files in drivers/mtd to use C99
initializers. The patches are against the current BK.
Art Haas
===== drivers/mtd/ftl.c 1.43 vs edited =====
--- 1.43/drivers/mtd/ftl.c Sun Feb 9 19:29:55 2003
+++ edited/drivers/mtd/ftl.c Wed Feb 26 13:35:35 2003
@@ -155,8 +155,8 @@
void ftl_freepart(partition_t *part);
static struct mtd_notifier ftl_notifier = {
- add: ftl_notify_add,
- remove: ftl_notify_remove,
+ .add = ftl_notify_add,
+ .remove = ftl_notify_remove,
};
/* Partition state flags */
===== drivers/mtd/mtdchar.c 1.10 vs edited =====
--- 1.10/drivers/mtd/mtdchar.c Mon Dec 2 17:20:17 2002
+++ edited/drivers/mtd/mtdchar.c Wed Feb 26 12:10:18 2003
@@ -19,8 +19,8 @@
static void mtd_notify_remove(struct mtd_info* mtd);
static struct mtd_notifier notifier = {
- add: mtd_notify_add,
- remove: mtd_notify_remove,
+ .add = mtd_notify_add,
+ .remove = mtd_notify_remove,
};
#endif
@@ -445,13 +445,13 @@
} /* memory_ioctl */
static struct file_operations mtd_fops = {
- owner: THIS_MODULE,
- llseek: mtd_lseek, /* lseek */
- read: mtd_read, /* read */
- write: mtd_write, /* write */
- ioctl: mtd_ioctl, /* ioctl */
- open: mtd_open, /* open */
- release: mtd_close, /* release */
+ .owner = THIS_MODULE,
+ .llseek = mtd_lseek, /* lseek */
+ .read = mtd_read, /* read */
+ .write = mtd_write, /* write */
+ .ioctl = mtd_ioctl, /* ioctl */
+ .open = mtd_open, /* open */
+ .release = mtd_close, /* release */
};
===== drivers/mtd/nftlcore.c 1.39 vs edited =====
--- 1.39/drivers/mtd/nftlcore.c Mon Oct 28 13:57:50 2002
+++ edited/drivers/mtd/nftlcore.c Wed Feb 26 13:35:01 2003
@@ -914,8 +914,8 @@
****************************************************************************/
static struct mtd_notifier nftl_notifier = {
- add: NFTL_notify_add,
- remove: NFTL_notify_remove
+ .add = NFTL_notify_add,
+ .remove = NFTL_notify_remove
};
extern char nftlmountrev[];
--
They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety.
-- Benjamin Franklin, Historical Review of Pennsylvania, 1759
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH] C99 initializers for drivers/mtd files
2003-02-26 20:53 [PATCH] C99 initializers for drivers/mtd files Art Haas
@ 2003-02-27 19:44 ` Jörn Engel
2003-02-27 21:46 ` Art Haas
0 siblings, 1 reply; 9+ messages in thread
From: Jörn Engel @ 2003-02-27 19:44 UTC (permalink / raw)
To: linux-mtd
On Wed, 26 February 2003 14:53:34 -0600, Art Haas wrote:
>
> Here is a set of patches for converting files in drivers/mtd to use C99
> initializers. The patches are against the current BK.
Looks trivial, although a bit lengthy. Do you have cvs commit access?
If not, but me next Monday (got a cold right now) if noone committed
it before.
J?rn
--
Data expands to fill the space available for storage.
-- Parkinson's Law
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] C99 initializers for drivers/mtd files
2003-02-27 19:44 ` Jörn Engel
@ 2003-02-27 21:46 ` Art Haas
2003-03-02 18:56 ` Jörn Engel
0 siblings, 1 reply; 9+ messages in thread
From: Art Haas @ 2003-02-27 21:46 UTC (permalink / raw)
To: linux-mtd
On Thu, Feb 27, 2003 at 08:44:24PM +0100, J?rn Engel wrote:
> On Wed, 26 February 2003 14:53:34 -0600, Art Haas wrote:
> >
> > Here is a set of patches for converting files in drivers/mtd to use C99
> > initializers. The patches are against the current BK.
>
> Looks trivial, although a bit lengthy. Do you have cvs commit access?
> If not, but me next Monday (got a cold right now) if noone committed
> it before.
>
No, I don't have cvs access, so I can't commit any of the patches I've
mailed.
Art Haas
--
They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety.
-- Benjamin Franklin, Historical Review of Pennsylvania, 1759
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] C99 initializers for drivers/mtd files
2003-02-27 21:46 ` Art Haas
@ 2003-03-02 18:56 ` Jörn Engel
2003-03-03 20:49 ` Thayne Harbaugh
0 siblings, 1 reply; 9+ messages in thread
From: Jörn Engel @ 2003-03-02 18:56 UTC (permalink / raw)
To: linux-mtd
On Thu, 27 February 2003 15:46:46 -0600, Art Haas wrote:
>
> No, I don't have cvs access, so I can't commit any of the patches I've
> mailed.
Patch 1 and 4 are committed, 2 and 3 don't apply cleanly and will
follow later...
J?rn
--
Time? What's that? Time is only worth what you do with it.
-- Theo de Raadt
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] C99 initializers for drivers/mtd files
2003-03-02 18:56 ` Jörn Engel
@ 2003-03-03 20:49 ` Thayne Harbaugh
2003-03-03 21:06 ` Jörn Engel
0 siblings, 1 reply; 9+ messages in thread
From: Thayne Harbaugh @ 2003-03-03 20:49 UTC (permalink / raw)
To: linux-mtd
--=-UIgGkC/XGO+JaNvyNuOE
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
I like the C99 initialization. I was tempted to make these changes
myself, but I had a concern so I never did anything.
What does Marcelo think about the C99 initialization syntax? GCC 2.95
does not understand C99 and will fail to compile kernels that require
this syntax. Is Marcelo willing to break 2.95 and require newer
compilers? Is the MTD community willing to maintain two patch sets: one
with GCC initializers and one with C99 initializers? (granted the old
GCC way is deprecated).
On Sun, 2003-03-02 at 11:56, J=F6rn Engel wrote:
> On Thu, 27 February 2003 15:46:46 -0600, Art Haas wrote:
> >=20
> > No, I don't have cvs access, so I can't commit any of the patches I've
> > mailed.
>=20
> Patch 1 and 4 are committed, 2 and 3 don't apply cleanly and will
> follow later...
>=20
> J=F6rn
--=20
Thayne Harbaugh
Linux Networx
--=-UIgGkC/XGO+JaNvyNuOE
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQA+Y7/WfsBPTKE6HMkRArz5AJ9tfjUesiCmDcgec1pJN+NBixeZbwCdFgqn
Ig0FGZ3p2atYKuxNHTi7J/o=
=UWXZ
-----END PGP SIGNATURE-----
--=-UIgGkC/XGO+JaNvyNuOE--
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] C99 initializers for drivers/mtd files
2003-03-03 20:49 ` Thayne Harbaugh
@ 2003-03-03 21:06 ` Jörn Engel
2003-03-03 21:21 ` Thayne Harbaugh
0 siblings, 1 reply; 9+ messages in thread
From: Jörn Engel @ 2003-03-03 21:06 UTC (permalink / raw)
To: linux-mtd
On Mon, 3 March 2003 13:49:27 -0700, Thayne Harbaugh wrote:
>
> GCC 2.95 does not understand C99 and will fail to compile kernels
> that require this syntax.
You had me for a moment. But at least Debians gcc 2.95.4 does not fail
too badly:
joern at Limerick:~/foo$ cat foo.c
struct foo {
int bar;
int baz;
};
struct foo fufu = {
.bar = 0,
.baz = 0
};
joern at Limerick:~/foo$ gcc --version
2.95.4
joern at Limerick:~/foo$ gcc -c foo.c
joern at Limerick:~/foo$ ls
foo.c foo.o
joern at Limerick:~/foo$
What compiler do you have that breaks with C99 initializers?
J?rn
--
Invincibility is in oneself, vulnerability is in the opponent.
-- Sun Tzu
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH] C99 initializers for drivers/mtd files
2003-03-03 21:06 ` Jörn Engel
@ 2003-03-03 21:21 ` Thayne Harbaugh
2003-03-03 21:33 ` Art Haas
0 siblings, 1 reply; 9+ messages in thread
From: Thayne Harbaugh @ 2003-03-03 21:21 UTC (permalink / raw)
To: linux-mtd
--=-VG6xTcuLBgQIdyzP0w2K
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hmmm. I guess C99 mostly works - with the exception of array
initializers:
[thayne at tubarao tmp]$ cat foo.c
=
=20
struct foo {
int bar;
int baz;
};
=
=20
struct foo fufu[] =3D {
[0].bar =3D 0,
[0].baz =3D 0
};
=
=20
[thayne at tubarao tmp]$ gcc -c foo.c
foo.c:8: unknown field `bar' specified in initializer
It's the array initialization that I want to use. Grrrr!
On Mon, 2003-03-03 at 14:06, J=F6rn Engel wrote:
> On Mon, 3 March 2003 13:49:27 -0700, Thayne Harbaugh wrote:
> >=20
> > GCC 2.95 does not understand C99 and will fail to compile kernels
> > that require this syntax.
>=20
> You had me for a moment. But at least Debians gcc 2.95.4 does not fail
> too badly:
>=20
> joern at Limerick:~/foo$ cat foo.c
> struct foo {
> int bar;
> int baz;
> };
>=20
> struct foo fufu =3D {
> .bar =3D 0,
> .baz =3D 0
> };
> joern at Limerick:~/foo$ gcc --version
> 2.95.4
> joern at Limerick:~/foo$ gcc -c foo.c
> joern at Limerick:~/foo$ ls
> foo.c foo.o
> joern at Limerick:~/foo$ =20
>=20
> What compiler do you have that breaks with C99 initializers?
>=20
> J=F6rn
--=20
Thayne Harbaugh
Linux Networx
--=-VG6xTcuLBgQIdyzP0w2K
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQA+Y8dYfsBPTKE6HMkRAnOQAJ9NZnPOXRGbE+t0GVcUpKvy+fBB3ACfWAp0
9g5zrdqObx7vv79g80fbU9E=
=zBXV
-----END PGP SIGNATURE-----
--=-VG6xTcuLBgQIdyzP0w2K--
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH] C99 initializers for drivers/mtd files
2003-03-03 21:21 ` Thayne Harbaugh
@ 2003-03-03 21:33 ` Art Haas
2003-03-03 21:41 ` Thayne Harbaugh
0 siblings, 1 reply; 9+ messages in thread
From: Art Haas @ 2003-03-03 21:33 UTC (permalink / raw)
To: linux-mtd
On Mon, Mar 03, 2003 at 02:21:29PM -0700, Thayne Harbaugh wrote:
> Hmmm. I guess C99 mostly works - with the exception of array
> initializers:
>
> [thayne at tubarao tmp]$ cat foo.c
>
> struct foo {
> int bar;
> int baz;
> };
>
> struct foo fufu[] = {
> [0].bar = 0,
> [0].baz = 0
> };
>
> [thayne at tubarao tmp]$ gcc -c foo.c
> foo.c:8: unknown field `bar' specified in initializer
>
> It's the array initialization that I want to use. Grrrr!
>
>
Array initializers should work in GCC-2.95.X also, your syntax is just a
little off ...
$ cat foo.c
struct foo {
int bar;
int baz;
};
struct foo fufu[] = {
[0] = {
.bar = 0,
.baz = 0
},
};
$ gcc-2.95 -c foo.c
$
$ gcc-2.95 -v
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
gcc version 2.95.4 20011002 (Debian prerelease)
$
The above foo.c compiles fine with gcc-3.2 and gcc-3.3 also. The C99
syntax should be no problem for gcc-2.95, or really any GCC release
after gcc-2.5, as gcc-2.5 is where the current documents say the syntax
with the ":" became obsolete.
Art Haas
--
They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety.
-- Benjamin Franklin, Historical Review of Pennsylvania, 1759
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH] C99 initializers for drivers/mtd files
2003-03-03 21:33 ` Art Haas
@ 2003-03-03 21:41 ` Thayne Harbaugh
0 siblings, 0 replies; 9+ messages in thread
From: Thayne Harbaugh @ 2003-03-03 21:41 UTC (permalink / raw)
To: linux-mtd
--=-cJT9OdOoENZRrdNpTALp
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
My bad - the [INDEX].DATA_MEMBER works in GCC 3.2. Thanks for setting
me straight (I'll go back to sleep now).
On Mon, 2003-03-03 at 14:33, Art Haas wrote:
> On Mon, Mar 03, 2003 at 02:21:29PM -0700, Thayne Harbaugh wrote:
<embarrassing evidence removed for brevity and to protect the guilty>
>=20
> Art Haas
--=20
Thayne Harbaugh
Linux Networx
--=-cJT9OdOoENZRrdNpTALp
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQA+Y8wIfsBPTKE6HMkRArZ2AJ9ySsD3J5/PMvY5tpoKb2my5LLjrgCfeMjJ
yXKx2GjUrD1rpx4k989vgyk=
=VNaK
-----END PGP SIGNATURE-----
--=-cJT9OdOoENZRrdNpTALp--
>From Brian Mon Mar 3 20:21:39 2003
From: Brian (Brian)
Date: Mon, 3 Mar 2003 19:21:39 -0600
Subject: linux not mounting jffs2 partition properly?
Message-ID: <001f01c2e1ec$68189c50$0200a8c0@athlon1200>
Hello,
I have an embedded build I am migrating from kernel 2.2.18 using JFFS2/v1.18
to kernel 2.4.20/JFFS2 v1.35. I have patched the kernel with the current
CVS, and my utilities directory. Everything compiles. On bootup, however,
it almost looks like that the kernel is not mounting the JFFS2 partition
properly, and cannot run any commands (kmod, modprobe, open /dev/console,
etc...). Below is a snip of my bootup sequence. The flash is an Intel 16mb
ROM, 128k sectors. Erase size when creating the image was also 128k.
/tmp/current_build/user/mtd-utils/build/mkfs.jffs2 -v -o
/tmp/current_build/images/jffs2.img -q -e 131072 -d /tmp/current_build/romfs
My older build with 2.2.18/v1.18 works fine.
Any help is appreciated.
Thanks!
-Brian
--snip--
Loading..............................................
Linux version 2.4.20 (root at Smog) (gcc version 2.96 20000731 (Red Hat Linux
7.2 2.96-112.7.2)) #96 Fri Feb 28 17:49:33 CST 2003
BIOS-provided physical RAM map:
BIOS-e801: 0000000000000000 - 000000000009f000 (usable)
BIOS-e801: 0000000000100000 - 0000000002000000 (usable)
32MB LOWMEM available.
On node 0 totalpages: 8192
zone(0): 4096 pages.
zone(1): 4096 pages.
zone(2): 0 pages.
Kernel command line:
Initializing CPU#0
Calibrating delay loop... 49.56 BogoMIPS
Memory: 30580k/32768k available (952k kernel code, 1800k reserved, 227k
data, 64k init, 0k highmem)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
Inode cache hash table entries: 2048 (order: 2, 16384 bytes)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
CPU: AMD 486 DX/4-WB stepping 04
Checking 'hlt' instruction... OK.
POSIX conformance testing by UNIFIX
PCI: Using configuration type 1
PCI: Probing PCI hardware
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
JFFS2 version 2.1. (C) 2001, 2002 Red Hat, Inc., designed by Axis
Communications AB.
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ
SERIAL_PCI enabled
ttyS00 at 0x03f8 (irq = 4) is a 16550A
ttyS03 at 0x02e8 (irq = 3) is a 16550A
SLIP: version 0.8.4-NET3.019-NEWTTY (dynamic channels, max=256).
CSLIP: code copyright 1989 Regents of the University of California.
RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize
PPP generic driver version 2.4.2
kmod: failed to exec /sbin/modprobe -s -k jedec_probe, errno = 2
cfi_cmdset_0001: Erase suspend on write enabled
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
Using buffer write method
SNAPGEAR: Intel flash device size = 16384K
Creating 6 MTD partitions on "SnapGear Intel":
0x00000000-0x00080000 : "JBM kernel"
0x000a0000-0x00fe0000 : "JBM filesystem"
0x00080000-0x000a0000 : "JBM config"
0x00000000-0x01000000 : "JBM Intel"
0x00fe0000-0x01000000 : "JBM BIOS Config"
0x00fe0000-0x01000000 : "JBM BIOS"
JBMgw137 Battery Backed RAM device: 1f000 at 18021000
kmod: failed to exec /sbin/modprobe -s -k ram, errno = 2
kmod: failed to exec /sbin/modprobe -s -k rom, errno = 2
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 2048 bind 4096)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00477238:
0x1a1a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0047723c:
0x1a1a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00477240:
0x1a1a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00477244:
0x1a1a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00477248:
0x1a1a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0047724c:
0x1a1a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00477250:
0x1a1a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00477254:
0x1a1a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00477258:
0x1a1a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0047725c:
0x1a1a instead
Further such events for this erase block will not be printed
VFS: Mounted root (jffs2 filesystem) readonly.
Freeing unused kernel memory: 64k freed
Warning: unable to open an initial console.
--snip--
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2003-03-03 21:41 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-26 20:53 [PATCH] C99 initializers for drivers/mtd files Art Haas
2003-02-27 19:44 ` Jörn Engel
2003-02-27 21:46 ` Art Haas
2003-03-02 18:56 ` Jörn Engel
2003-03-03 20:49 ` Thayne Harbaugh
2003-03-03 21:06 ` Jörn Engel
2003-03-03 21:21 ` Thayne Harbaugh
2003-03-03 21:33 ` Art Haas
2003-03-03 21:41 ` Thayne Harbaugh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox