aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@gmail.com>2010-10-26 17:22:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-26 19:52:14 -0400
commit93e2f585c149b5056d5c5eaffcaf747bbe9c3015 (patch)
treecbd79d81972c7baa3d884574f8fb397828a3d5c9 /drivers/misc
parent3f0f4a3f2008613c601e97f773dbd80ac400e459 (diff)
lkdtm: prefix enum constants
Prefix cname and ctype constants with CN/CT_. This is especially for the conflict on BUG which causes a build break if arch defines it as a inline function, i.e. MIPS. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Cc: Ankita Garg <ankita@in.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/lkdtm.c128
1 files changed, 64 insertions, 64 deletions
diff --git a/drivers/misc/lkdtm.c b/drivers/misc/lkdtm.c
index 343b5d8ea697..81d7fa4ec0db 100644
--- a/drivers/misc/lkdtm.c
+++ b/drivers/misc/lkdtm.c
@@ -52,32 +52,32 @@
52#define REC_NUM_DEFAULT 10 52#define REC_NUM_DEFAULT 10
53 53
54enum cname { 54enum cname {
55 INVALID, 55 CN_INVALID,
56 INT_HARDWARE_ENTRY, 56 CN_INT_HARDWARE_ENTRY,
57 INT_HW_IRQ_EN, 57 CN_INT_HW_IRQ_EN,
58 INT_TASKLET_ENTRY, 58 CN_INT_TASKLET_ENTRY,
59 FS_DEVRW, 59 CN_FS_DEVRW,
60 MEM_SWAPOUT, 60 CN_MEM_SWAPOUT,
61 TIMERADD, 61 CN_TIMERADD,
62 SCSI_DISPATCH_CMD, 62 CN_SCSI_DISPATCH_CMD,
63 IDE_CORE_CP, 63 CN_IDE_CORE_CP,
64 DIRECT, 64 CN_DIRECT,
65}; 65};
66 66
67enum ctype { 67enum ctype {
68 NONE, 68 CT_NONE,
69 PANIC, 69 CT_PANIC,
70 BUG, 70 CT_BUG,
71 EXCEPTION, 71 CT_EXCEPTION,
72 LOOP, 72 CT_LOOP,
73 OVERFLOW, 73 CT_OVERFLOW,
74 CORRUPT_STACK, 74 CT_CORRUPT_STACK,
75 UNALIGNED_LOAD_STORE_WRITE, 75 CT_UNALIGNED_LOAD_STORE_WRITE,
76 OVERWRITE_ALLOCATION, 76 CT_OVERWRITE_ALLOCATION,
77 WRITE_AFTER_FREE, 77 CT_WRITE_AFTER_FREE,
78 SOFTLOCKUP, 78 CT_SOFTLOCKUP,
79 HARDLOCKUP, 79 CT_HARDLOCKUP,
80 HUNG_TASK, 80 CT_HUNG_TASK,
81}; 81};
82 82
83static char* cp_name[] = { 83static char* cp_name[] = {
@@ -117,8 +117,8 @@ static char* cpoint_type;
117static int cpoint_count = DEFAULT_COUNT; 117static int cpoint_count = DEFAULT_COUNT;
118static int recur_count = REC_NUM_DEFAULT; 118static int recur_count = REC_NUM_DEFAULT;
119 119
120static enum cname cpoint = INVALID; 120static enum cname cpoint = CN_INVALID;
121static enum ctype cptype = NONE; 121static enum ctype cptype = CT_NONE;
122static int count = DEFAULT_COUNT; 122static int count = DEFAULT_COUNT;
123 123
124module_param(recur_count, int, 0644); 124module_param(recur_count, int, 0644);
@@ -207,12 +207,12 @@ static enum ctype parse_cp_type(const char *what, size_t count)
207 return i + 1; 207 return i + 1;
208 } 208 }
209 209
210 return NONE; 210 return CT_NONE;
211} 211}
212 212
213static const char *cp_type_to_str(enum ctype type) 213static const char *cp_type_to_str(enum ctype type)
214{ 214{
215 if (type == NONE || type < 0 || type > ARRAY_SIZE(cp_type)) 215 if (type == CT_NONE || type < 0 || type > ARRAY_SIZE(cp_type))
216 return "None"; 216 return "None";
217 217
218 return cp_type[type - 1]; 218 return cp_type[type - 1];
@@ -220,7 +220,7 @@ static const char *cp_type_to_str(enum ctype type)
220 220
221static const char *cp_name_to_str(enum cname name) 221static const char *cp_name_to_str(enum cname name)
222{ 222{
223 if (name == INVALID || name < 0 || name > ARRAY_SIZE(cp_name)) 223 if (name == CN_INVALID || name < 0 || name > ARRAY_SIZE(cp_name))
224 return "INVALID"; 224 return "INVALID";
225 225
226 return cp_name[name - 1]; 226 return cp_name[name - 1];
@@ -245,7 +245,7 @@ static int lkdtm_parse_commandline(void)
245 return -EINVAL; 245 return -EINVAL;
246 246
247 cptype = parse_cp_type(cpoint_type, strlen(cpoint_type)); 247 cptype = parse_cp_type(cpoint_type, strlen(cpoint_type));
248 if (cptype == NONE) 248 if (cptype == CT_NONE)
249 return -EINVAL; 249 return -EINVAL;
250 250
251 for (i = 0; i < ARRAY_SIZE(cp_name); i++) { 251 for (i = 0; i < ARRAY_SIZE(cp_name); i++) {
@@ -274,30 +274,30 @@ static int recursive_loop(int a)
274static void lkdtm_do_action(enum ctype which) 274static void lkdtm_do_action(enum ctype which)
275{ 275{
276 switch (which) { 276 switch (which) {
277 case PANIC: 277 case CT_PANIC:
278 panic("dumptest"); 278 panic("dumptest");
279 break; 279 break;
280 case BUG: 280 case CT_BUG:
281 BUG(); 281 BUG();
282 break; 282 break;
283 case EXCEPTION: 283 case CT_EXCEPTION:
284 *((int *) 0) = 0; 284 *((int *) 0) = 0;
285 break; 285 break;
286 case LOOP: 286 case CT_LOOP:
287 for (;;) 287 for (;;)
288 ; 288 ;
289 break; 289 break;
290 case OVERFLOW: 290 case CT_OVERFLOW:
291 (void) recursive_loop(0); 291 (void) recursive_loop(0);
292 break; 292 break;
293 case CORRUPT_STACK: { 293 case CT_CORRUPT_STACK: {
294 volatile u32 data[8]; 294 volatile u32 data[8];
295 volatile u32 *p = data; 295 volatile u32 *p = data;
296 296
297 p[12] = 0x12345678; 297 p[12] = 0x12345678;
298 break; 298 break;
299 } 299 }
300 case UNALIGNED_LOAD_STORE_WRITE: { 300 case CT_UNALIGNED_LOAD_STORE_WRITE: {
301 static u8 data[5] __attribute__((aligned(4))) = {1, 2, 301 static u8 data[5] __attribute__((aligned(4))) = {1, 2,
302 3, 4, 5}; 302 3, 4, 5};
303 u32 *p; 303 u32 *p;
@@ -309,7 +309,7 @@ static void lkdtm_do_action(enum ctype which)
309 *p = val; 309 *p = val;
310 break; 310 break;
311 } 311 }
312 case OVERWRITE_ALLOCATION: { 312 case CT_OVERWRITE_ALLOCATION: {
313 size_t len = 1020; 313 size_t len = 1020;
314 u32 *data = kmalloc(len, GFP_KERNEL); 314 u32 *data = kmalloc(len, GFP_KERNEL);
315 315
@@ -317,7 +317,7 @@ static void lkdtm_do_action(enum ctype which)
317 kfree(data); 317 kfree(data);
318 break; 318 break;
319 } 319 }
320 case WRITE_AFTER_FREE: { 320 case CT_WRITE_AFTER_FREE: {
321 size_t len = 1024; 321 size_t len = 1024;
322 u32 *data = kmalloc(len, GFP_KERNEL); 322 u32 *data = kmalloc(len, GFP_KERNEL);
323 323
@@ -326,21 +326,21 @@ static void lkdtm_do_action(enum ctype which)
326 memset(data, 0x78, len); 326 memset(data, 0x78, len);
327 break; 327 break;
328 } 328 }
329 case SOFTLOCKUP: 329 case CT_SOFTLOCKUP:
330 preempt_disable(); 330 preempt_disable();
331 for (;;) 331 for (;;)
332 cpu_relax(); 332 cpu_relax();
333 break; 333 break;
334 case HARDLOCKUP: 334 case CT_HARDLOCKUP:
335 local_irq_disable(); 335 local_irq_disable();
336 for (;;) 336 for (;;)
337 cpu_relax(); 337 cpu_relax();
338 break; 338 break;
339 case HUNG_TASK: 339 case CT_HUNG_TASK:
340 set_current_state(TASK_UNINTERRUPTIBLE); 340 set_current_state(TASK_UNINTERRUPTIBLE);
341 schedule();