diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-11-12 10:43:00 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-11-12 10:43:00 +0100 |
commit | aa481a7015111e53539680130bf32db7aea473e7 (patch) | |
tree | 0bb9e06b2fdccd33d5f167888acc2ae814086b81 | |
parent | 1c54d399904f93ccfe85af7085ec2099f098d2eb (diff) | |
download | hda-emu-aa481a7015111e53539680130bf32db7aea473e7.tar.gz |
Add round_up() and round_down() macros
-rw-r--r-- | include/wrapper.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/wrapper.h b/include/wrapper.h index 93a9f93..83741bb 100644 --- a/include/wrapper.h +++ b/include/wrapper.h @@ -154,6 +154,10 @@ typedef int pm_message_t; #define put_user(a,b) ({*(b) = (a); 0;}) +#define __round_mask(x, y) ((__typeof__(x))((y)-1)) +#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) +#define round_down(x, y) ((x) & ~__round_mask(x, y)) + #define jiffies 0 static inline bool time_after_eq(unsigned long a, unsigned long b) { return 1; } |