public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rddunlap@osdlab.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Linus <torvalds@transmeta.com>,
	lkml <linux-kernel@vger.kernel.org>,
	sfr@canb.auug.org.au, crutcher+kernel@datastacks.com
Subject: [PATCH:v2] fix register_sysrq() in 2.4.9++
Date: Thu, 20 Sep 2001 11:57:27 -0700	[thread overview]
Message-ID: <3BAA3C17.557A2C4E@osdlab.org> (raw)
In-Reply-To: <E15k86n-0005lE-00@the-village.bc.nu>

[-- Attachment #1: Type: text/plain, Size: 595 bytes --]

Alan Cox wrote:
> 
> > Yeah, I considered that, and it doesn't matter to me whether it
> > reports 0 or -1, but it's the data pointer that (mostly) requires
> > the #ifdefs, unless the data is always present or a dummy data pointer
> > is used.... ?
> 
> #define it to an inline without some arguments ?
~~~~~~~~~~~~~~~~~~
I can't get that to work, but someone else may be able to...

Here's another version for you to consider.

The [un]register_sysrq_key() calls return 0 when CONFIG_MAGIC_SYSRQ
is not defined/configured.
However, it sacrifices one small data structure of 3 pointers.

~Randy

[-- Attachment #2: sysrq-if2.patch --]
[-- Type: text/plain, Size: 734 bytes --]

--- linux/arch/i386/kernel/apm.c.org	Mon Sep 17 10:15:45 2001
+++ linux/arch/i386/kernel/apm.c	Thu Sep 20 11:51:25 2001
@@ -703,6 +703,8 @@
 	help_msg:       "Off",
 	action_msg:     "Power Off\n"
 };
+#else
+struct sysrq_key_op sysrq_poweroff_op;
 #endif
 
 
--- linux/include/linux/sysrq.h.org	Mon Sep 17 10:21:07 2001
+++ linux/include/linux/sysrq.h	Thu Sep 20 11:42:15 2001
@@ -87,8 +87,17 @@
 }
 
 #else
-#define register_sysrq_key(a,b)		do {} while(0)
-#define unregister_sysrq_key(a,b)	do {} while(0)
+
+static inline int register_sysrq_key(int key, struct sysrq_key_op *op_p)
+{
+	return 0;
+}
+
+static inline int unregister_sysrq_key(int key, struct sysrq_key_op *op_p)
+{
+	return 0;
+}
+
 #endif
 
 /* Deferred actions */

  reply	other threads:[~2001-09-20 18:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-20 15:51 [PATCH] fix register_sysrq() in 2.4.9++ Randy.Dunlap
2001-09-20 17:41 ` Alan Cox
2001-09-20 17:48   ` Randy.Dunlap
2001-09-20 17:59     ` Alan Cox
2001-09-20 18:57       ` Randy.Dunlap [this message]
2001-09-21 22:22         ` [PATCH:v2] " Crutcher Dunnavant
2001-09-21 22:36           ` [PATCH] Magic SysRq alternate fix register functions Crutcher Dunnavant
2001-09-24 16:32             ` 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=3BAA3C17.557A2C4E@osdlab.org \
    --to=rddunlap@osdlab.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=crutcher+kernel@datastacks.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=torvalds@transmeta.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