public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: linux-kernel@vger.kernel.org
Cc: Arjan van de Ven <arjan@infradead.org>
Subject: [PATCH 1/4] module_param: bool params should still work with #include <stdbool.h>
Date: Mon, 09 Feb 2009 18:22:26 +1030	[thread overview]
Message-ID: <20090209075610.3D86CDDDA2@ozlabs.org> (raw)


Code such as "module_param(foo, bool, 0400)" no longer compiles if one
includes stdbool.h: the ISO standard requires that this "#define bool
_Bool".

The fix is simple: define those as well.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -180,6 +180,11 @@ extern int param_get_bool(char *buffer, 
 extern int param_get_bool(char *buffer, struct kernel_param *kp);
 #define param_check_bool(name, p) __param_check(name, p, int)
 
+/* #include <stdbool.h> transforms module_param(foo, bool, 0). */
+#define param_set__Bool param_set_bool
+#define param_get__Bool param_get_bool
+#define param_check__Bool param_check_bool
+
 extern int param_set_invbool(const char *val, struct kernel_param *kp);
 extern int param_get_invbool(char *buffer, struct kernel_param *kp);
 #define param_check_invbool(name, p) __param_check(name, p, int)


             reply	other threads:[~2009-02-09  7:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-09  7:52 Rusty Russell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-02-09  9:33 [PATCH 1/4] module_param: bool params should still work with #include <stdbool.h> Rusty Russell

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=20090209075610.3D86CDDDA2@ozlabs.org \
    --to=rusty@rustcorp.com.au \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox