this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Removing redundant variable and fixing formatting

+17 -21
+17 -21
src/kernel/emulation/linux/misc/sysctl_machdep.c
··· 52 52 53 53 #ifndef setup 54 54 #define setup(value)\ 55 - unsigned int level = 0;\ 56 - unsigned int eax = value;\ 57 - unsigned int ebx;\ 58 - unsigned int edx;\ 55 + unsigned int level = 0; \ 56 + unsigned int eax = value; \ 57 + unsigned int ebx; \ 58 + unsigned int edx; \ 59 59 unsigned int ecx 60 60 #endif 61 61 ··· 98 98 99 99 __cpuid(level, eax, ebx, ecx, edx); 100 100 101 - 102 - 103 - 104 101 copyout_int(eax, (char*)old,oldlen); 105 102 106 103 return 0; ··· 153 150 154 151 __cpuid(level,eax,ebx, ecx, edx); 155 152 156 - if(eax < 0x80000004) // the information is not implemented 153 + if (eax < 0x80000004) // the information is not implemented 157 154 return 2; 158 155 159 156 ··· 191 188 192 189 __cpuid(0,eax,ebx,ecx,edx); 193 190 194 - if(old != NULL) 191 + if (old != NULL) 195 192 { 196 193 197 194 char *outsr = (char*)old; 198 195 int current_length = 0; 199 - int j = 0; 200 196 201 197 for (int i = 0; i < 32; i++) 202 198 { 203 199 204 - if(i == 10 || i == 20) 200 + if (i == 10 || i == 20) 205 201 continue; 206 202 207 - if(edx>>i&1 && current_length < *oldlen) 203 + if ( (edx & (1<<i)) && current_length < *oldlen) 208 204 { 209 205 210 206 if (current_length) ··· 216 212 217 213 } 218 214 219 - if(current_length < *oldlen) 215 + if (current_length < *oldlen) 220 216 { 221 217 222 - int len = __simple_strlen(features[i]); 223 - 224 - strncpy(outsr + current_length, features[i], 225 - (len < (*oldlen - current_length) ? len : (*oldlen - current_length))); 218 + int len = __simple_strlen(features[i]); 219 + 220 + strncpy(outsr + current_length, features[i], 221 + *oldlen - current_length); 226 222 227 - current_length = current_length + len; 223 + current_length += len; 228 224 229 225 } 230 226 ··· 232 228 233 229 } 234 230 235 - if(current_length < *oldlen) 231 + if (current_length < *oldlen) 236 232 { 237 233 238 234 outsr[current_length] = '\0'; ··· 247 243 for (int i = 0; i < 32; i++) 248 244 { 249 245 250 - if(i == 10 || i == 20) 246 + if (i == 10 || i == 20) 251 247 continue; 252 248 253 - if(edx>>i&1) 249 + if (edx>>i&1) 254 250 { 255 251 if (len != 0) 256 252 len++;