Re: Odd code in sysrq.c

From: Tim Walberg (tewalberg@mediaone.net)
Date: Sat Feb 26 2000 - 09:40:30 EST


My initial thought would be that having both the ifdef
and the variable allows you to either not include SYSRQ
support (ifdef is false), or to have SYSRQ support (ifdef
is true) which defaults to being turned on (variable is
true) but can be turned off using some method (/proc/<something>
or a kernel debugger or something else). If you didn't
want the ability to turn it on and off, I agree that
having the variable on top of the ifdef is definitely
redundant.

                                tw

On 02/26/2000 02:47 -0500, Mike A. Harris wrote:
>> The following is found in sysrq.c
>>
>> #ifdef CONFIG_MAGIC_SYSRQ
>> int sysrq_enabled = 1;
>> #endif
>>
>>
>> Can someone explain why? I mean, if CONFIG_MAGIC_SYSRQ is not
>> enabled at all, then sysrq.c isn't compiled at all - correct?
>>
>> So if it isn't compiled then the above ifdef will never get
>> seen. If however CONFIG_MAGIC_SYSRQ *IS* defined, then the
>> feature is enabled, sysrq.c gets compiled, and the ifdef block
>> above is automatically going to be true.
>>
>> So the ifdef is pointless and redundant no?
>>
>> If not, please explain why.
>>
>> TTYL
>>
>> --
>> Mike A. Harris Linux advocate
>> Computer Consultant GNU advocate
>> Capslock Consulting Open Source advocate
>>
>> Suspicious Anagram #4:
>> Word: PRESIDENT CLINTON OF THE USA
>> Anagram: TO COPULATE HE FINDS INTERNS
>>
>>
>> -
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.rutgers.edu
>> Please read the FAQ at http://www.tux.org/lkml/
End of included message

-- 
+--------------------------+------------------------------+
| Tim Walberg              | tewalberg@mediaone.net       |
| 828 Marshall Ct.         | www.concentric.net/~twalberg |
| Palatine, IL 60074       |                              |
+--------------------------+------------------------------+


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Feb 29 2000 - 21:00:15 EST