From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josef Sipek Subject: Re: [PATCH 26/35] Unionfs: Privileged operations workqueue Date: Thu, 7 Dec 2006 21:17:14 -0500 Message-ID: <20061208021714.GA14363@filer.fsl.cs.sunysb.edu> References: <1165235468365-git-send-email-jsipek@cs.sunysb.edu> <1165235471170-git-send-email-jsipek@cs.sunysb.edu> <20061205195013.GE2240@filer.fsl.cs.sunysb.edu> <20061206173245.GA23405@filer.fsl.cs.sunysb.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: "Josef 'Jeff' Sipek" , linux-kernel@vger.kernel.org, torvalds@osdl.org, akpm@osdl.org, hch@infradead.org, viro@ftp.linux.org.uk, linux-fsdevel@vger.kernel.org, mhalcrow@us.ibm.com Return-path: To: Jan Engelhardt Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Wed, Dec 06, 2006 at 07:46:50PM +0100, Jan Engelhardt wrote: > I smell a big conspiracy! So yet again it's mixed mixed >=20 > fs$ grep __init */*.c | grep -v ' init_' > sysfs/mount.c:int __init sysfs_init(void) > sysv/inode.c:int __init sysv_init_icache(void) > proc/vmcore.c:static int __init vmcore_init(void) > proc/nommu.c:static int __init proc_nommu_init(void) > proc/proc_misc.c:void __init proc_misc_init(void) > proc/proc_tty.c:void __init proc_tty_init(void) > proc/root.c:void __init proc_root_init(void) =20 Yep. =20 > >> > >+void __unionfs_mknod(void *data) > >> > >+{ > >> > >+ struct sioq_args *args =3D data; > >> > >+ struct mknod_args *m =3D &args->mknod; > >> >=20 > >> > Care to make that: const struct mknod_args *m =3D &args->mknod;? > >> > (Same for other places) > >> =20 > >> Right. > >=20 > >If I make the *args =3D data line const, then gcc (4.1) yells about = modifying > >a const variable 3 lines down.. > > > >args->err =3D vfs_mknod(m->parent, m->dentry, m->mode, m->dev); > > > >Sure, I could cast, but that seems like adding cruft for no good rea= son. >=20 > No I despise casts more than missing consts. Why would gcc throw a wa= rning? > Let's take this super simple program No, this program doesn't tickle the problem.. Try to compile this one: <<< struct mknod_args { int mode; int dev; }; void __mknod(const void *data) { const struct mknod_args *args =3D data; args->mode =3D 0; } int main(void) { const struct mknod_args *m; __mknod(m); return 0; } >>> $ gcc -Wall -c test.c test.c: In function =E2mknod=E2test.c:10: error: assignment of read-onl= y location Josef "Jeff" Sipek. --=20 Reality is merely an illusion, albeit a very persistent one. - Albert Einstein