Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1

Bodo Eggert
2006-07-12T22:07:20Z

Paulo Marques <pmarques@grupopie.com> wrote:
> Roman Zippel wrote:
>> On Tue, 11 Jul 2006, Andrew Morton wrote:
>> [...]
>>> What, actually, is the problem?
>>
>> It changes the behaviour, it will annoy the hell out of people like me who
>> have to deal with different kernels and expect this to just work. :-(
>> Since then has it been acceptable to just go ahead and break stuff? This
>> problem doesn't really look unsolvable, so why is my request to fix the
>> damn thing so unreasonable?
>
> Ok, what about this one?
>
> I don't have time to test it (it compiles, at least), but it seems the
> logic is pretty clear: once you have pressed both "Alt" and "SysRq"
> sysrq mode becomes active until you release *both* keys. In this mode
> any regular key press triggers handle_sysrq.
>
> 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
--
Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF
verbreiteten Lügen zu sabotieren.