public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
To: mingo@elte.hu, tglx@linutronix.de, hpa@zytor.com, bp@suse.de,
	plagnioj@jcrosoft.com, tomi.valkeinen@ti.com,
	daniel.vetter@intel.com, airlied@linux.ie
Cc: dledford@redhat.com, awalls@md.metrocast.net, syrjala@sci.fi,
	luto@amacapital.net, mst@redhat.com, cocci@systeme.lip6.fr,
	linux-kernel@vger.kernel.org,
	"Luis R. Rodriguez" <mcgrof@suse.com>,
	Juergen Gross <jgross@suse.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Dave Airlie <airlied@redhat.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	x86@kernel.org
Subject: [PATCH v4 3/8] init.h: add early_param_on() and early_param_off()
Date: Wed, 29 Apr 2015 14:44:22 -0700	[thread overview]
Message-ID: <1430343867-1001-4-git-send-email-mcgrof@do-not-panic.com> (raw)
In-Reply-To: <1430343867-1001-1-git-send-email-mcgrof@do-not-panic.com>

From: "Luis R. Rodriguez" <mcgrof@suse.com>

At times all we need is an enabler / disabler.

Cc: Andy Walls <awalls@md.metrocast.net>
Cc: Doug Ledford <dledford@redhat.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Juergen Gross <jgross@suse.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: linux-kernel@vger.kernel.org
Cc: x86@kernel.org
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 include/linux/init.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/include/linux/init.h b/include/linux/init.h
index a0385cc..7773883 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -270,6 +270,29 @@ struct obs_kernel_param {
 #define early_param(str, fn)						\
 	__setup_param(str, fn, fn, 1)
 
+#define early_param_on(str_on, var, config)				\
+									\
+	int __read_mostly var = IS_ENABLED(config);			\
+									\
+	static int __init parse_##var##_on(char *arg)			\
+	{								\
+		var = 1;						\
+		return 0;						\
+	}								\
+	__setup_param(str_on, parse_##var##_on, parse_##var##_on, 1);	\
+									\
+
+#define early_param_off(str_off, var, config)				\
+									\
+	int __read_mostly var = IS_ENABLED(config);			\
+									\
+	static int __init parse_##var##_off(char *arg)			\
+	{								\
+		var = 0;						\
+		return 0;						\
+	}								\
+	__setup_param(str_off, parse_##var##_off, parse_##var##_off, 1)
+
 #define early_param_on_off(str_on, str_off, var, config)		\
 									\
 	int __read_mostly var = IS_ENABLED(config);			\
-- 
2.3.2.209.gd67f9d5.dirty


  parent reply	other threads:[~2015-04-29 21:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-29 21:44 [PATCH v4 0/8] x86: address drivers that do not work with PAT Luis R. Rodriguez
2015-04-29 21:44 ` [PATCH v4 1/8] x86/mm/pat: use pr_info() and friends Luis R. Rodriguez
2015-04-30 13:56   ` Borislav Petkov
2015-04-30 18:15     ` Luis R. Rodriguez
2015-04-29 21:44 ` [PATCH v4 2/8] init.h: add __read_mostly to early_param_on_off() Luis R. Rodriguez
2015-04-30 16:00   ` Borislav Petkov
2015-04-30 18:32     ` Luis R. Rodriguez
2015-04-30 18:34       ` Luis R. Rodriguez
2015-04-30 18:42       ` Borislav Petkov
2015-04-30 18:46       ` Christoph Lameter
2015-04-29 21:44 ` Luis R. Rodriguez [this message]
2015-04-29 21:44 ` [PATCH v4 4/8] x86/mm/pat: use early_param_off() and redefine pat_enabled() Luis R. Rodriguez
2015-04-29 21:44 ` [PATCH v4 5/8] arch/x86/mm/pat: export pat_enabled() Luis R. Rodriguez
2015-04-29 21:44 ` [PATCH v4 6/8] ivtv: use arch_phys_wc_add() and require PAT disabled Luis R. Rodriguez
2015-04-29 21:44 ` [PATCH v4 7/8] IB/ipath: add counting for MTRR Luis R. Rodriguez
2015-04-29 21:44 ` [PATCH v4 8/8] IB/ipath: use arch_phys_wc_add() and require PAT disabled Luis R. Rodriguez

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=1430343867-1001-4-git-send-email-mcgrof@do-not-panic.com \
    --to=mcgrof@do-not-panic.com \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=awalls@md.metrocast.net \
    --cc=bhelgaas@google.com \
    --cc=bp@suse.de \
    --cc=cocci@systeme.lip6.fr \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dledford@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mcgrof@suse.com \
    --cc=mingo@elte.hu \
    --cc=mst@redhat.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=syrjala@sci.fi \
    --cc=tglx@linutronix.de \
    --cc=tomi.valkeinen@ti.com \
    --cc=x86@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