Bodo Eggert wrote:
Paulo Marques <[email protected]> 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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]