public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paulo Marques <pmarques@grupopie.com>
To: 7eggert@gmx.de
Cc: Roman Zippel <zippel@linux-m68k.org>,
	Andrew Morton <akpm@osdl.org>,
	pavel@ucw.cz, roubert@df.lth.se, stern@rowland.harvard.edu,
	dmitry.torokhov@gmail.com, linux-input@atrey.karlin.mff.cuni.cz,
	linux-kernel@vger.kernel.org
Subject: Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
Date: Wed, 12 Jul 2006 23:35:00 +0100	[thread overview]
Message-ID: <44B57914.5060805@grupopie.com> (raw)
In-Reply-To: <E1G0mrB-0001JL-T3@be1.lrz>

Bodo Eggert wrote:
> Paulo Marques <pmarques@grupopie.com> wrote:
>[...]
>>This allows for all the combinations mentioned before in this thread and
>>makes the logic simpler, IMHO.
> 
> Why don't you use a bitmask?
> alt-sysrq down -> val  =  0b11
> sysrq up       -> val &= ~0b01
> alt up         -> val &= ~0b10
> 
> test is_sysrq == !!val

It can be done, but it doesn't seem to buy you much.

The sysrq_alt variable is used wether we use magic sysrq or not, so we 
must keep it anyway. This var doesn't do what your high bit does, 
because in the bit mask this bit only goes on when both are pressed (not 
just alt).

alt up is actually 2 different keys (left and right). To detect it, we 
either copy the same "if" that is outside the #ifdef or we try to follow 
the state of sysrq_alt to detect the change from low to high :P

Anyway, I think the code can be simplified further, though, and it might 
involve a similar trick. And it definitely needs some more comments in 
there ;)

I'll play with it some more and try to produce a better patch.

-- 
Paulo Marques

  reply	other threads:[~2006-07-12 22:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6wOHw-5gl-23@gated-at.bofh.it>
     [not found] ` <6x0yX-5An-17@gated-at.bofh.it>
     [not found]   ` <6xc78-6gi-15@gated-at.bofh.it>
     [not found]     ` <6xyhf-5Fq-1@gated-at.bofh.it>
     [not found]       ` <6xyU6-6Hn-63@gated-at.bofh.it>
     [not found]         ` <6xzdl-75B-13@gated-at.bofh.it>
     [not found]           ` <6xzZO-8gU-23@gated-at.bofh.it>
     [not found]             ` <6xA9p-8ti-7@gated-at.bofh.it>
     [not found]               ` <6xACo-Op-1@gated-at.bofh.it>
     [not found]                 ` <6xAVM-1b9-5@gated-at.bofh.it>
     [not found]                   ` <6xBfh-1yd-29@gated-at.bofh.it>
     [not found]                     ` <6xBRQ-2v4-3@gated-at.bofh.it>
     [not found]                       ` <6xITm-4td-17@gated-at.bofh.it>
     [not found]                         ` <6xMX0-2bX-21@gated-at.bofh.it>
2006-07-12 22:06                           ` [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1 Bodo Eggert
2006-07-12 22:35                             ` Paulo Marques [this message]
2006-07-09 21:06 Alan Stern
2006-07-10  9:44 ` Fredrik Roubert
2006-07-10 21:59   ` Roman Zippel
2006-07-11 12:41     ` Pavel Machek
2006-07-11 22:21       ` Roman Zippel
2006-07-11 22:42         ` [patch] " Pavel Machek
2006-07-11 23:33           ` Roman Zippel
2006-07-11 23:50             ` Andrew Morton
2006-07-12  0:16               ` Roman Zippel
2006-07-12  0:37                 ` Andrew Morton
2006-07-12  0:52                   ` Roman Zippel
2006-07-12  1:36                     ` Andrew Morton
2006-07-12  8:08                       ` Pavel Machek
2006-07-12  9:07                       ` Roman Zippel
2006-07-12 13:26                         ` Paulo Marques
2006-07-12 19:42                           ` Paulo Marques
2006-07-12 20:05                             ` Dmitry Torokhov
2006-07-12 22:21                               ` Paulo Marques
2006-07-12 22:44                                 ` Pavel Machek
2006-07-13 18:48                                 ` Dmitry Torokhov
2006-07-12  7:26                 ` Fredrik Roubert
2006-07-12  9:09                   ` Roman Zippel
2006-07-12 15:12                   ` 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=44B57914.5060805@grupopie.com \
    --to=pmarques@grupopie.com \
    --cc=7eggert@gmx.de \
    --cc=akpm@osdl.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@atrey.karlin.mff.cuni.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=roubert@df.lth.se \
    --cc=stern@rowland.harvard.edu \
    --cc=zippel@linux-m68k.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