fix: compile with optimizations

I just ported needed code from include/linux/compiler.h
Welcome for any comments.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>