X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Ftimex.h;h=04a4a8cb4ed37ab150b6575b3ae9f9268967e5e7;hb=dad2ad82c5f058367df79de022bd12d36afcd065;hp=7e050a2cc35be69f2685309ff9c445adbba8ae68;hpb=fac84ef26759a3725bfc53ae3abf21976360aff3;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/timex.h b/include/linux/timex.h index 7e050a2cc35..04a4a8cb4ed 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h @@ -282,6 +282,13 @@ static inline int ntp_synced(void) return !(time_status & STA_UNSYNC); } +/* Required to safely shift negative values */ +#define shift_right(x, s) ({ \ + __typeof__(x) __x = (x); \ + __typeof__(s) __s = (s); \ + __x < 0 ? -(-__x >> __s) : __x >> __s; \ +}) + #ifdef CONFIG_TIME_INTERPOLATION