Re: [PATCH 1/2] tracing/events: clean up for ftrace_set_clr_event()

From: Li Zefan
Date: Thu May 07 2009 - 23:06:32 EST


>> @@ -500,30 +505,16 @@ system_enable_write(struct file *filp, const char __user *ubuf, size_t cnt,
>> if (ret < 0)
>> return ret;
>>
>> - switch (val) {
>> - case 0:
>> - case 1:
>> - break;
>> -
>> - default:
>> + if (val != 0 && val != 1)
>
> What about "if (val & ~1UL)"?
>

I tried it just now:

text data bss dec hex filename
7480 104 8 7592 1da8 kernel/trace/trace_events.o.orig
text data bss dec hex filename
7482 104 8 7594 1daa kernel/trace/trace_events.o

It increased text size by 2 bytes, gcc did a better work. ;)

And it's not so intuitive what's the limit of val.


--
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/