From: Michael Veeck <michael.veeck@gmx.net>
To: kernel-janitors@vger.kernel.org
Subject: Re: [Kernel-janitors] New guy here, and patch for kj.pl
Date: Thu, 05 Feb 2004 10:20:19 +0000 [thread overview]
Message-ID: <402218E3.6060300@gmx.net> (raw)
In-Reply-To: <20040125123747.GA21585@noos.fr>
Hi! I'm another new guy here on kj and a few days ago I wrote a little
patch to show that I want to tackle the removal of some unnecessary
min/max-methods in the kernel.
I didnt get any feedback yet, but I guess since nobody screamed (and I
found some more occurences) I'm going to try my best.
Also being new to kernel hacking (and the depth of c-programming) I have
a question, which hopefully one of you can help me with:
For example fs/lockd/mon.c has a MAX-function which is used in
#ifndef MAX
# define MAX(a, b)....
#endif
static struct rpc_procinfo nsm_procedures[] = {
[SM_MON] = {
.p_proc = SM_MON,
.p_encode = (kxdrproc_t) xdr_encode_mon,
.p_decode = (kxdrproc_t) xdr_decode_stat_res,
.p_bufsiz = MAX(SM_mon_sz, SM_monres_sz) << 2,
},
[SM_UNMON] = {
.p_proc = SM_UNMON,
.p_encode = (kxdrproc_t) xdr_encode_unmon,
.p_decode = (kxdrproc_t) xdr_decode_stat,
.p_bufsiz = MAX(SM_mon_id_sz, SM_unmonres_sz) << 2,
},
};
but replacing the call of it with max(...) from kernel.h results in
following:
CC fs/lockd/mon.o
fs/lockd/mon.c:216: error: braced-group within expression allowed only
inside a function
fs/lockd/mon.c:216: error: initializer element is not constant
fs/lockd/mon.c:216: error: (near initialization for
`nsm_procedures[2].p_bufsiz')
fs/lockd/mon.c:216: error: parse error before ')' token
fs/lockd/mon.c:216: error: initializer element is not constant
fs/lockd/mon.c:216: error: (near initialization for `nsm_procedures[2]')
fs/lockd/mon.c:218: error: parse error before '[' token
fs/lockd/mon.c:222: error: parse error before "void"
fs/lockd/mon.c:179: warning: `xdr_encode_unmon' defined but not used
fs/lockd/mon.c:199: warning: `xdr_decode_stat' defined but not used
make[2]: *** [fs/lockd/mon.o] Error 1
make[1]: *** [fs/lockd] Error 2
make: *** [fs] Error 2
Can anyone help me with that error code?
Thanks in advance
Michael Veeck
Randy.Dunlap schrieb:
> On Sun, 25 Jan 2004 13:37:47 +0100 JOUANNE Mickael <grigouze@noos.fr> wrote:
>
> (did anyone reply to your question?)
>
> It's best to let the mailing list know that you plan to tackle
> something, in case someone else is already working on it.
>
> It's also a good idea to post some changes early so that you get
> some feedback on them before spending lots of time on it and
> that time being wasted in the case that it's all wrong/bad.
>
> --
> ~Randy
> kernel-janitors project: http://janitor.kernelnewbies.org/
> _______________________________________________
> Kernel-janitors mailing list
> Kernel-janitors@lists.osdl.org
> http://lists.osdl.org/mailman/listinfo/kernel-janitors
>
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
next prev parent reply other threads:[~2004-02-05 10:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-25 12:37 [Kernel-janitors] New guy here, and patch for kj.pl JOUANNE Mickael
2004-02-04 18:34 ` Randy.Dunlap
2004-02-05 10:20 ` Michael Veeck [this message]
2004-02-05 11:19 ` Domen Puncer
2004-02-05 21:48 ` Randy.Dunlap
2004-02-05 21:50 ` Michael Veeck
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=402218E3.6060300@gmx.net \
--to=michael.veeck@gmx.net \
--cc=kernel-janitors@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.