From: Art Haas <ahaas@airmail.net>
To: Neil Brown <neilb@cse.unsw.edu.au>, nfs@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Convert fs/nfsctl.c to use C99 named initiailzers
Date: Tue, 11 Feb 2003 20:41:27 -0600 [thread overview]
Message-ID: <20030212024127.GA914@debian> (raw)
Hi.
The following patch converts the file to use C99 named initializers.
These change make the file compile with fewer warnings if '-W' is added
to the compile flags, and may enhance code readability. Let me know if
you think this should be sent to Linus.
Art Haas
===== fs/nfsctl.c 1.5 vs edited =====
--- 1.5/fs/nfsctl.c Sun Jan 5 17:19:30 2003
+++ edited/fs/nfsctl.c Tue Feb 11 09:38:42 2003
@@ -54,13 +54,36 @@
static struct {
char *name; int wsize; int rsize;
} map[] = {
- [NFSCTL_SVC]={".svc", sizeof(struct nfsctl_svc)},
- [NFSCTL_ADDCLIENT]={".add", sizeof(struct nfsctl_client)},
- [NFSCTL_DELCLIENT]={".del", sizeof(struct nfsctl_client)},
- [NFSCTL_EXPORT]={".export", sizeof(struct nfsctl_export)},
- [NFSCTL_UNEXPORT]={".unexport", sizeof(struct nfsctl_export)},
- [NFSCTL_GETFD]={".getfd", sizeof(struct nfsctl_fdparm), NFS_FHSIZE},
- [NFSCTL_GETFS]={".getfs", sizeof(struct nfsctl_fsparm), sizeof(struct knfsd_fh)},
+ [NFSCTL_SVC] = {
+ .name = ".svc",
+ .wsize = sizeof(struct nfsctl_svc)
+ },
+ [NFSCTL_ADDCLIENT] = {
+ .name = ".add",
+ .wsize = sizeof(struct nfsctl_client)
+ },
+ [NFSCTL_DELCLIENT] = {
+ .name = ".del",
+ .wsize = sizeof(struct nfsctl_client)
+ },
+ [NFSCTL_EXPORT] = {
+ .name = ".export",
+ .wsize = sizeof(struct nfsctl_export)
+ },
+ [NFSCTL_UNEXPORT] = {
+ .name = ".unexport",
+ .wsize = sizeof(struct nfsctl_export)
+ },
+ [NFSCTL_GETFD] = {
+ .name = ".getfd",
+ .wsize = sizeof(struct nfsctl_fdparm),
+ .rsize = NFS_FHSIZE
+ },
+ [NFSCTL_GETFS] = {
+ .name = ".getfs",
+ .wsize = sizeof(struct nfsctl_fsparm),
+ .rsize = sizeof(struct knfsd_fh)
+ },
};
long
--
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
reply other threads:[~2003-02-12 2:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030212024127.GA914@debian \
--to=ahaas@airmail.net \
--cc=linux-kernel@vger.kernel.org \
--cc=neilb@cse.unsw.edu.au \
--cc=nfs@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox