Lines Matching refs:rc
188 debug_info_t* rc; in debug_info_alloc() local
193 rc = (debug_info_t*) kmalloc(sizeof(debug_info_t), GFP_ATOMIC); in debug_info_alloc()
194 if(!rc) in debug_info_alloc()
196 rc->active_entry = (int*)kmalloc(nr_areas * sizeof(int), GFP_ATOMIC); in debug_info_alloc()
197 if(!rc->active_entry) in debug_info_alloc()
199 memset(rc->active_entry, 0, nr_areas * sizeof(int)); in debug_info_alloc()
200 rc->areas = (debug_entry_t **) kmalloc(nr_areas * in debug_info_alloc()
203 if (!rc->areas) in debug_info_alloc()
206 rc->areas[i] = (debug_entry_t *) __get_free_pages(GFP_ATOMIC, in debug_info_alloc()
208 if (!rc->areas[i]) { in debug_info_alloc()
210 free_pages((unsigned long) rc->areas[i], in debug_info_alloc()
215 memset(rc->areas[i], 0, PAGE_SIZE << page_order); in debug_info_alloc()
221 spin_lock_init(&rc->lock); in debug_info_alloc()
222 rc->page_order = page_order; in debug_info_alloc()
223 rc->nr_areas = nr_areas; in debug_info_alloc()
224 rc->active_area = 0; in debug_info_alloc()
225 rc->level = DEBUG_DEFAULT_LEVEL; in debug_info_alloc()
226 rc->buf_size = buf_size; in debug_info_alloc()
227 rc->entry_size = sizeof(debug_entry_t) + buf_size; in debug_info_alloc()
228 strncpy(rc->name, name, MIN(strlen(name), (DEBUG_MAX_PROCF_LEN - 1))); in debug_info_alloc()
229 rc->name[MIN(strlen(name), (DEBUG_MAX_PROCF_LEN - 1))] = 0; in debug_info_alloc()
230 memset(rc->views, 0, DEBUG_MAX_VIEWS * sizeof(struct debug_view *)); in debug_info_alloc()
232 memset(rc->proc_entries, 0 ,DEBUG_MAX_VIEWS * in debug_info_alloc()
235 atomic_set(&(rc->ref_count), 0); in debug_info_alloc()
237 return rc; in debug_info_alloc()
240 kfree(rc->areas); in debug_info_alloc()
242 kfree(rc->active_entry); in debug_info_alloc()
244 kfree(rc); in debug_info_alloc()
273 debug_info_t* rc; in debug_info_create() local
275 rc = debug_info_alloc(name, page_order, nr_areas, buf_size); in debug_info_create()
276 if(!rc) in debug_info_create()
282 rc->proc_root_entry = in debug_info_create()
283 debug_create_proc_dir_entry(debug_proc_root_entry, rc->name, in debug_info_create()
291 debug_area_first = rc; in debug_info_create()
292 rc->prev = NULL; in debug_info_create()
296 debug_area_last->next = rc; in debug_info_create()
297 rc->prev = debug_area_last; in debug_info_create()
299 debug_area_last = rc; in debug_info_create()
300 rc->next = NULL; in debug_info_create()
302 debug_info_get(rc); in debug_info_create()
304 return rc; in debug_info_create()
315 debug_info_t* rc; in debug_info_copy() local
316 rc = debug_info_alloc(in->name, in->page_order, in debug_info_copy()
318 if(!rc) in debug_info_copy()
322 memcpy(rc->areas[i],in->areas[i], PAGE_SIZE << in->page_order); in debug_info_copy()
325 return rc; in debug_info_copy()
446 int rc; in debug_output() local
489 int rc = 0; in debug_input() local
495 rc = p_info->view->input_proc(p_info->debug_info_org, in debug_input()
499 rc = -EPERM; in debug_input()
501 return rc; /* number of input characters */ in debug_input()
513 int i = 0, rc = 0; in debug_open() local
538 rc = -EINVAL; in debug_open()
551 rc = -ENOMEM; in debug_open()
561 rc = -ENOMEM; in debug_open()
577 if (rc != 0) in debug_open()
579 return rc; in debug_open()
611 struct proc_dir_entry *rc = NULL; in debug_create_proc_dir_entry() local
619 rc = (struct proc_dir_entry *) kmalloc(sizeof(struct proc_dir_entry) in debug_create_proc_dir_entry()
621 if (!rc) in debug_create_proc_dir_entry()
624 memset(rc, 0, sizeof(struct proc_dir_entry)); in debug_create_proc_dir_entry()
625 memcpy(((char *) rc) + sizeof(*rc), fn, len + 1); in debug_create_proc_dir_entry()
626 rc->name = ((char *) rc) + sizeof(*rc); in debug_create_proc_dir_entry()
627 rc->namelen = len; in debug_create_proc_dir_entry()
628 rc->low_ino = 0, rc->mode = mode; in debug_create_proc_dir_entry()
629 rc->nlink = 1; in debug_create_proc_dir_entry()
630 rc->uid = 0; in debug_create_proc_dir_entry()
631 rc->gid = 0; in debug_create_proc_dir_entry()
632 rc->size = 0; in debug_create_proc_dir_entry()
633 rc->get_info = NULL; in debug_create_proc_dir_entry()
634 rc->ops = iops; in debug_create_proc_dir_entry()
636 proc_register(root, rc); in debug_create_proc_dir_entry()
638 rc = create_proc_entry(name, mode, root); in debug_create_proc_dir_entry()
639 if (!rc) in debug_create_proc_dir_entry()
642 rc->proc_fops = fops; in debug_create_proc_dir_entry()
647 return rc; in debug_create_proc_dir_entry()
678 debug_info_t *rc = NULL; in debug_register() local
687 rc = debug_info_create(name, page_order, nr_areas, buf_size); in debug_register()
688 if(!rc) in debug_register()
690 debug_register_view(rc, &debug_level_view); in debug_register()
691 debug_register_view(rc, &debug_flush_view); in debug_register()
695 nr_areas, 1 << page_order, rc->name); in debug_register()
698 if (rc == NULL){ in debug_register()
703 return rc; in debug_register()
923 int rc = 0; in debug_init() local
939 return rc; in debug_init()
948 int rc = 0; in debug_register_view() local
963 rc = -1; in debug_register_view()
979 rc = -1; in debug_register_view()
988 rc = 0; in debug_register_view()
992 return rc; in debug_register_view()
1001 int rc = 0; in debug_unregister_view() local
1013 rc = -1; in debug_unregister_view()
1018 rc = 0; in debug_unregister_view()
1022 return rc; in debug_unregister_view()
1037 int rc = 0; in debug_prolog_level_fn() local
1039 if(id->level == -1) rc = sprintf(out_buf,"-\n"); in debug_prolog_level_fn()
1040 else rc = sprintf(out_buf, "%i\n", id->level); in debug_prolog_level_fn()
1041 return rc; in debug_prolog_level_fn()
1053 int rc = in_buf_size; in debug_input_level_fn() local
1058 rc = -EFAULT; in debug_input_level_fn()
1072 return rc; /* number of input characters */ in debug_input_level_fn()
1117 int rc = in_buf_size; in debug_input_flush_fn() local
1122 rc = -EFAULT; in debug_input_flush_fn()
1139 return rc; /* number of input characters */ in debug_input_flush_fn()
1149 int rc; in debug_raw_header_fn() local
1151 rc = sizeof(debug_entry_t); in debug_raw_header_fn()
1153 return rc; in debug_raw_header_fn()
1163 int rc; in debug_raw_format_fn() local
1165 rc = id->buf_size; in debug_raw_format_fn()
1167 return rc; in debug_raw_format_fn()
1177 int i, rc = 0; in debug_hex_ascii_format_fn() local
1180 rc += sprintf(out_buf + rc, "%02x ", in debug_hex_ascii_format_fn()
1183 rc += sprintf(out_buf + rc, "| "); in debug_hex_ascii_format_fn()
1187 rc += sprintf(out_buf + rc, "."); in debug_hex_ascii_format_fn()
1189 rc += sprintf(out_buf + rc, "%c", c); in debug_hex_ascii_format_fn()
1191 rc += sprintf(out_buf + rc, "\n"); in debug_hex_ascii_format_fn()
1192 return rc; in debug_hex_ascii_format_fn()
1206 int rc = 0; in debug_dflt_header_fn() local
1221 rc += sprintf(out_buf, "%02i %011lu:%06lu %1u %1s %02i %016lx ", in debug_dflt_header_fn()
1226 rc += sprintf(out_buf, "%02i %011lu:%06lu %1u %1s %02i %08lx ", in debug_dflt_header_fn()
1230 return rc; in debug_dflt_header_fn()
1243 int num_longs, num_used_args = 0,i, rc = 0; in debug_sprintf_format_fn() local
1254 rc = strlen(curr_event->string); in debug_sprintf_format_fn()
1266 rc = sprintf(out_buf, curr_event->string, curr_event->args[index[0]], in debug_sprintf_format_fn()
1275 return rc; in debug_sprintf_format_fn()
1285 int rc = 0; in init_module() local
1289 rc = debug_init(); in init_module()
1290 if (rc) in init_module()
1292 return rc; in init_module()