From: Andrew Morton <akpm@linux-foundation.org>
To: Rakib Mullick <rakib.mullick@gmail.com>
Cc: Jan Harkes <jaharkes@cs.cmu.edu>,
LKML <linux-kernel@vger.kernel.org>,
coda@cs.cmu.edu, codalist@TELEMANN.coda.cs.cmu.edu
Subject: Re: [PATCH] fs, coda: Fix compile warning when CONFIG_SYSCTL=n.
Date: Mon, 14 Mar 2011 15:34:13 -0700 [thread overview]
Message-ID: <20110314153413.a8ec2093.akpm@linux-foundation.org> (raw)
In-Reply-To: <AANLkTim-U1nyuQ3cVxLHv63LmQUvOJd5GmR5wF90xG==@mail.gmail.com>
On Sun, 13 Mar 2011 21:48:23 +0600
Rakib Mullick <rakib.mullick@gmail.com> wrote:
> When CONFIG_SYSCTL=n, we get the following warning:
>
> fs/coda/sysctl.c:18: warning: ___coda_table___ defined but not used
>
> Following patches fixes the above warning by making sure coda_table
> and it's callee
> function are in the same context. It also cleans up the code by
> removing extra #ifdef.
>
> ...
>
> --- a/fs/coda/sysctl.c
> +++ b/fs/coda/sysctl.c
>
> ...
>
> +#else
> +
> +#define coda_sysctl_init() do { } while (0);
> +#define coda_sysctl_clean() do { } while (0);
> +
> +#endif
These do/while stubs should not have the trailing ";" - adding them
will cause breakage in some calling scenarios.
It is much better to implement such stubs in C rather than as macros.
But these stubs can't be doing anything useful anyway: they appear at
the end of a .c file which wasn't #included by anything. Therefore:
--- a/fs/coda/sysctl.c~fs-coda-fix-compile-warning-when-config_sysctl=n-fix
+++ a/fs/coda/sysctl.c
@@ -61,9 +61,4 @@ void coda_sysctl_clean(void)
fs_table_header = NULL;
}
}
-#else
-
-#define coda_sysctl_init() do { } while (0);
-#define coda_sysctl_clean() do { } while (0);
-
#endif
_
next prev parent reply other threads:[~2011-03-14 22:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-13 15:48 [PATCH] fs, coda: Fix compile warning when CONFIG_SYSCTL=n Rakib Mullick
2011-03-14 22:34 ` Andrew Morton [this message]
2011-03-15 3:27 ` Rakib Mullick
2011-03-24 7:54 ` [origin tree build failure] " Ingo Molnar
2011-03-24 10:46 ` Rakib Mullick
2011-03-24 16:02 ` Randy Dunlap
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=20110314153413.a8ec2093.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=coda@cs.cmu.edu \
--cc=codalist@TELEMANN.coda.cs.cmu.edu \
--cc=jaharkes@cs.cmu.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=rakib.mullick@gmail.com \
/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