Converted code to Linux kernel style