Re: [Patch] signal: let valid_signal() check more

From: AmÃrico Wang
Date: Fri Dec 26 2008 - 04:17:36 EST


On Fri, Dec 26, 2008 at 09:56:54AM +0100, Ingo Molnar wrote:
>
>* AmÃrico Wang <xiyou.wangcong@xxxxxxxxx> wrote:
>
>> >> @@ -727,7 +727,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
>> >> {
>> >> if (!perm || !capable(CAP_KILL))
>> >> goto eperm;
>> >> - if (!valid_signal(arg) || arg < 1 || arg == SIGKILL)
>> >> + if (!valid_signal((int)arg) || arg == SIGKILL)
>> > ^^^^^
>> >
>> >The patch adds a lot of unnecessary typecasts like this.
>>
>> because it's inline?
>
>Why does your patch add a lot of seemingly unnecessary typecasts? [if your
>short reply was supposed to be an answer to that question then please
>explain it in more detail.]

Hi, Ingo.

because I also changed the type of valid_signal():

-static inline int valid_signal(unsigned long sig)
+static inline int valid_signal(int sig)

I noticed that gcc put this kind of warning into
-Wtraditional-conversion recently, but it is still useful to use
explicit cast, isn't it?

Thanks.

--
"Against stupidity, the gods themselves, contend in vain."

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