File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,12 @@ static inline void *offset_to_ptr(const int *off)
239
239
/* &a[0] degrades to a pointer: a different type from an array */
240
240
#define __must_be_array (a ) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
241
241
242
+ /*
243
+ * Whether 'type' is a signed type or an unsigned type. Supports scalar types,
244
+ * bool and also pointer types.
245
+ */
246
+ #define is_signed_type (type ) (((type)(-1)) < (__force type)1)
247
+
242
248
/*
243
249
* This is needed in functions which generate the stack canary, see
244
250
* arch/x86/kernel/smpboot.c::start_secondary() for an example.
Original file line number Diff line number Diff line change 30
30
* https://mail-index.netbsd.org/tech-misc/2007/02/05/0000.html -
31
31
* credit to Christian Biere.
32
32
*/
33
- #define is_signed_type (type ) (((type)(-1)) < (type)1)
34
33
#define __type_half_max (type ) ((type)1 << (8*sizeof(type) - 1 - is_signed_type(type)))
35
34
#define type_max (T ) ((T)((__type_half_max(T) - 1) + __type_half_max(T)))
36
35
#define type_min (T ) ((T)((T)-type_max(T)-(T)1))
Original file line number Diff line number Diff line change @@ -814,8 +814,6 @@ extern int trace_add_event_call(struct trace_event_call *call);
814
814
extern int trace_remove_event_call (struct trace_event_call * call );
815
815
extern int trace_event_get_offsets (struct trace_event_call * call );
816
816
817
- #define is_signed_type (type ) (((type)(-1)) < (type)1)
818
-
819
817
int ftrace_set_clr_event (struct trace_array * tr , char * buf , int set );
820
818
int trace_set_clr_event (const char * system , const char * event , int set );
821
819
int trace_array_set_clr_event (struct trace_array * tr , const char * system ,
You can’t perform that action at this time.
0 commit comments