Lines Matching +full:- +full:x
9 #define SHRT_MIN ((s16)(-SHRT_MAX - 1))
11 #define INT_MIN (-INT_MAX - 1)
14 #define LONG_MIN (-LONG_MAX - 1)
17 #define LLONG_MIN (-LLONG_MAX - 1)
25 #define S8_MIN ((s8)(-S8_MAX - 1))
28 #define S16_MIN ((s16)(-S16_MAX - 1))
31 #define S32_MIN ((s32)(-S32_MAX - 1))
34 #define S64_MIN ((s64)(-S64_MAX - 1))
38 #define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) argument
40 #define ALIGN(x,a) __ALIGN_MASK((x),(typeof(x))(a)-1) argument
41 #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) argument
43 #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) argument
45 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) argument
53 #define __round_mask(x, y) ((__typeof__(x))((y)-1)) argument
54 #define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) argument
55 #define round_down(x, y) ((x) & ~__round_mask(x, y)) argument
57 #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
58 #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
63 #define DIV_ROUND_UP_ULL(ll, d) DIV_ROUND_DOWN_ULL((ll) + (d) - 1, (d))
71 /* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */
72 #define roundup(x, y) ( \ argument
75 (((x) + (__y - 1)) / __y) * __y; \
78 #define rounddown(x, y) ( \ argument
80 typeof(x) __x = (x); \
81 __x - (__x % (y)); \
90 #define DIV_ROUND_CLOSEST(x, divisor)( \ argument
92 typeof(x) __x = x; \
94 (((typeof(x))-1) > 0 || \
95 ((typeof(divisor))-1) > 0 || (__x) > 0) ? \
97 (((__x) - ((__d) / 2)) / (__d)); \
105 #define mult_frac(x, numer, denom)( \ argument
107 typeof(x) quot = (x) / (denom); \
108 typeof(x) rem = (x) % (denom); \
114 * upper_32_bits - return bits 32-63 of a number
117 * A basic shift-right of a 64- or 32-bit quantity. Use this to suppress
119 * 32-bits.
124 * lower_32_bits - return bits 0-31 of a number
132 * abs() should not be used for 64-bit types (s64, u64, long long) - use abs64()
135 #define abs(x) ({ \ argument
137 if (sizeof(x) == sizeof(long)) { \
138 long __x = (x); \
139 ret = (__x < 0) ? -__x : __x; \
141 int __x = (x); \
142 ret = (__x < 0) ? -__x : __x; \
147 #define abs64(x) ({ \ argument
148 s64 __x = (x); \
149 (__x < 0) ? -__x : __x; \
154 * strict type-checking.. See the
157 #define min(x, y) ({ \ argument
158 typeof(x) _min1 = (x); \
163 #define max(x, y) ({ \ argument
164 typeof(x) _max1 = (x); \
169 #define min3(x, y, z) min((typeof(x))min(x, y), z) argument
170 #define max3(x, y, z) max((typeof(x))max(x, y), z) argument
173 * min_not_zero - return the minimum that is _not_ zero, unless both are zero
174 * @x: value1
177 #define min_not_zero(x, y) ({ \ argument
178 typeof(x) __x = (x); \
183 * clamp - return a value clamped to a given range with strict typechecking
199 #define min_t(type, x, y) ({ \ argument
200 type __min1 = (x); \
204 #define max_t(type, x, y) ({ \ argument
205 type __max1 = (x); \
210 * clamp_t - return a value clamped to a given range using a given type
222 * clamp_val - return a value clamped to a given range using val's type
236 * swap - swap value of @a and @b
242 * container_of - cast a member of a structure out to the containing structure
249 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
250 (type *)( (char *)__mptr - offsetof(type,member) );})