Re: [RFC2] Teach drivers/media/IR/ir-raw-event.c to use durations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 08, 2010 at 08:50:48AM -0300, Mauro Carvalho Chehab wrote:
> >-	size = sizeof(struct ir_raw_event) * MAX_IR_EVENT_SIZE * 2;
> >-	size = roundup_pow_of_two(size);
> >+	ir->raw->input_dev = input_dev;
> >+	INIT_WORK(&ir->raw->rx_work, ir_raw_event_work);
> > 
> >-	rc = kfifo_alloc(&ir->raw->kfifo, size, GFP_KERNEL);
> >+	rc = kfifo_alloc(&ir->raw->kfifo, sizeof(int) * MAX_IR_EVENT_SIZE,
> >+			 GFP_KERNEL);
> 
> kfifo logic requires a power of two buffer to work, so, please keep the
> original roundup_pow_of_two() logic, or add a comment before MAX_IR_EVENT_SIZE.

No, kfifo_alloc() takes care of the rounding up. See the code for 
kfifo_alloc() in kernel/kfifo.c.

-- 
David Härdeman
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux