1 int simple(int s
, unsigned int u
, int p
)
9 if (0) return s
>> 103;
10 if (0) return u
>> 104;
11 if (0) return u
<< 105;
12 if (0) return s
>> -4;
13 if (0) return u
>> -5;
14 if (0) return u
<< -6;
15 if (p
&& 0) return s
>> 106;
16 if (p
&& 0) return u
>> 107;
17 if (p
&& 0) return u
<< 108;
18 if (p
&& 0) return s
>> -7;
19 if (p
&& 0) return u
>> -8;
20 if (p
&& 0) return u
<< -9;
21 s
= s
>> ((p
& 0) + 109); u
^= p
; // reloaded because now == 0
22 u
= u
>> ((p
& 0) + 110); u
^= p
; // reloaded because now == 0
23 u
= u
<< ((p
& 0) + 111); u
^= p
; // reloaded because now == 0
24 s
= s
>> ((p
& 0) + -10);
25 u
= u
>> ((p
& 0) + -11); u
^= p
; // reloaded because now == 0
26 u
= u
<< ((p
& 0) + -12); u
^= p
; // reloaded because now == 0
30 int compound(int s
, unsigned int u
, int p
)
38 if (0) return s
>>= 103;
39 if (0) return u
>>= 104;
40 if (0) return u
<<= 105;
41 if (0) return s
>>= -4;
42 if (0) return u
>>= -5;
43 if (0) return u
<<= -6;
44 if (p
&& 0) return s
>>= 106;
45 if (p
&& 0) return u
>>= 107;
46 if (p
&& 0) return u
<<= 108;
47 if (p
&& 0) return s
>>= -7;
48 if (p
&& 0) return u
>>= -8;
49 if (p
&& 0) return u
<<= -9;
50 s
>>= ((p
& 0) + 109); u
^= p
; // reloaded because now == 0
51 u
>>= ((p
& 0) + 110); u
^= p
; // reloaded because now == 0
52 u
<<= ((p
& 0) + 111); u
^= p
; // reloaded because now == 0
53 s
>>= ((p
& 0) + -10);
54 u
>>= ((p
& 0) + -11); u
^= p
; // reloaded because now == 0
55 u
<<= ((p
& 0) + -12); u
^= p
; // reloaded because now == 0
59 int ok(int s
, unsigned int u
, int p
)
61 // GCC doesn't warn on these
62 if (0 && (s
>> 100)) return 0;
63 if (0 && (u
>> 101)) return 0;
64 if (0 && (u
<< 102)) return 0;
65 if (0 && (s
>> -1)) return 0;
66 if (0 && (u
>> -2)) return 0;
67 if (0 && (u
<< -3)) return 0;
68 if (0 && (s
>>= 103)) return 0;
69 if (0 && (u
>>= 104)) return 0;
70 if (0 && (u
<<= 105)) return 0;
71 if (0 && (s
>>= -4)) return 0;
72 if (0 && (u
>>= -5)) return 0;
73 if (0 && (u
<<= -6)) return 0;
92 * The following is used in the kernel at several places
93 * It shouldn't emit any warnings.
95 typedef unsigned long long u64
;
96 typedef unsigned int u32
;
98 extern void hw_w32x2(u32 hi
, u32 lo
);
100 inline void hw_w64(u64 val
)
102 hw_w32x2(val
>> 32, (u32
) val
);
105 void hw_write(u32 val
)
111 * check-name: shift too big or negative
112 * check-command: sparse -Wno-decl $file
115 shift-undef.c:3:18: warning: shift too big (100) for type int
116 shift-undef.c:4:18: warning: shift too big (101) for type unsigned int
117 shift-undef.c:5:18: warning: shift too big (102) for type unsigned int
118 shift-undef.c:6:19: warning: shift count is negative (-1)
119 shift-undef.c:7:19: warning: shift count is negative (-2)
120 shift-undef.c:8:19: warning: shift count is negative (-3)
121 shift-undef.c:21:29: warning: shift too big (109) for type int
122 shift-undef.c:22:29: warning: shift too big (110) for type unsigned int
123 shift-undef.c:23:29: warning: shift too big (111) for type unsigned int
124 shift-undef.c:24:29: warning: shift count is negative (-10)
125 shift-undef.c:25:29: warning: shift count is negative (-11)
126 shift-undef.c:26:29: warning: shift count is negative (-12)
127 shift-undef.c:32:15: warning: shift too big (100) for type int
128 shift-undef.c:33:15: warning: shift too big (101) for type unsigned int
129 shift-undef.c:34:15: warning: shift too big (102) for type unsigned int
130 shift-undef.c:35:16: warning: shift count is negative (-1)
131 shift-undef.c:36:16: warning: shift count is negative (-2)
132 shift-undef.c:37:16: warning: shift count is negative (-3)
133 shift-undef.c:50:26: warning: shift too big (109) for type int
134 shift-undef.c:51:26: warning: shift too big (110) for type unsigned int
135 shift-undef.c:52:26: warning: shift too big (111) for type unsigned int
136 shift-undef.c:53:26: warning: shift count is negative (-10)
137 shift-undef.c:54:26: warning: shift count is negative (-11)
138 shift-undef.c:55:26: warning: shift count is negative (-12)