Repository navigation
Commit 0730ded
[PATCH] remove a redundant variable in sys_prctl()
The patch removes a redundant variable `sig' from sys_prctl().
For some reason, when sys_prctl is called with option == PR_SET_PDEATHSIG
then the value of arg2 is assigned to an int variable named sig. Then sig
is tested with valid_signal() and later used to set the value of
current->pdeath_signal .
There is no reason to use this intermediate variable since valid_signal()
takes a unsigned long argument, so it can handle being passed arg2
directly, and if the call to valid_signal is OK, then we know the value of
arg2 is in the range zero to _NSIG and thus it'll easily fit in a plain int
and thus there's no problem assigning it later to current->pdeath_signal
(which is an int).
The patch gets rid of the pointless variable `sig'.
This reduces the size of kernel/sys.o in 2.6.13-rc6-mm1 by 32 bytes on my
system.
Patch has been compile tested, boot tested, and just to make damn sure I
didn't break anything I wrote a quick test app that calls
prctl(PR_SET_PDEATHSIG ...) with the entire range of values for a
unsigned long, and it behaves as expected with and without the patch.
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>1 parent 5acd579 commit 0730ded
1 file changed
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1711 | 1711 | | |
1712 | 1712 | | |
1713 | 1713 | | |
1714 | | - | |
1715 | 1714 | | |
1716 | 1715 | | |
1717 | 1716 | | |
1718 | 1717 | | |
1719 | 1718 | | |
1720 | 1719 | | |
1721 | 1720 | | |
1722 | | - | |
1723 | | - | |
| 1721 | + | |
1724 | 1722 | | |
1725 | 1723 | | |
1726 | 1724 | | |
1727 | | - | |
| 1725 | + | |
1728 | 1726 | | |
1729 | 1727 | | |
1730 | 1728 | | |
| |||
0 commit comments