Lines Matching refs:fb
433 static void fifo_set(struct fifo_buffer *fb, int value) in fifo_set() argument
437 for (i = 0; i < fb->size; i++) in fifo_set()
438 fb->values[i] = value; in fifo_set()
441 static int fifo_push(struct fifo_buffer *fb, int value) in fifo_push() argument
445 ov = fb->values[fb->head_index]; in fifo_push()
446 fb->values[fb->head_index++] = value; in fifo_push()
448 if (fb->head_index >= fb->size) in fifo_push()
449 fb->head_index = 0; in fifo_push()
454 static void fifo_add_val(struct fifo_buffer *fb, int value) in fifo_add_val() argument
458 for (i = 0; i < fb->size; i++) in fifo_add_val()
459 fb->values[i] += value; in fifo_add_val()
464 struct fifo_buffer *fb; in fifo_alloc() local
466 fb = kzalloc(sizeof(struct fifo_buffer) + sizeof(int) * fifo_size, GFP_NOIO); in fifo_alloc()
467 if (!fb) in fifo_alloc()
470 fb->head_index = 0; in fifo_alloc()
471 fb->size = fifo_size; in fifo_alloc()
472 fb->total = 0; in fifo_alloc()
474 return fb; in fifo_alloc()