- else {
- numargs=debug_count_numargs(string);
- alloc_size=offsetof(debug_sprintf_entry,args[numargs]);
- curr_event=alloca(alloc_size);
-
- if(curr_event){
- va_start(ap,string);
- curr_event->string=string;
- for(idx=0;idx<numargs;idx++)
- curr_event->args[idx]=va_arg(ap,long);
- retval=debug_common(id,level, curr_event,alloc_size,0);
- va_end(ap);
- }
- return retval;
- }
+
+ numargs=debug_count_numargs(string);
+
+ spin_lock_irqsave(&id->lock, flags);
+ active = get_active_entry(id);
+ curr_event=(debug_sprintf_entry_t *) DEBUG_DATA(active);
+ va_start(ap,string);
+ curr_event->string=string;
+ for(idx=0;idx<MIN(numargs,((id->buf_size / sizeof(long))-1));idx++)
+ curr_event->args[idx]=va_arg(ap,long);
+ va_end(ap);
+ debug_finish_entry(id, active, level, 0);
+ spin_unlock_irqrestore(&id->lock, flags);
+
+ return active;