Re: [PATCH 9/9] videobuf2-core: Change vb2_queue_init return type to void

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

 



(Ccing videobuf2 authors)

On Sat, Aug 25, 2012 at 12:28 PM, Jonathan Corbet <corbet@xxxxxxx> wrote:
> On Sat, 25 Aug 2012 00:09:06 -0300
> Ezequiel Garcia <elezegarcia@xxxxxxxxx> wrote:
>
>> -int vb2_queue_init(struct vb2_queue *q)
>> +void vb2_queue_init(struct vb2_queue *q)
>>  {
>>       BUG_ON(!q);
>>       BUG_ON(!q->ops);
>
> If this change goes through in this form, you can add my ack for the
> Marvell piece.  But I have to wonder...might it not be better to retain
> the return value and use it to return -EINVAL instead of the seven BUG_ON()
> calls found in that function?  It shouldn't be necessary to bring things
> down in this situation, and, who knows, one of those might just be turned
> into a DOS vector with some driver someday.
>

The mentioned BUG_ON() are these:

void vb2_queue_init(struct vb2_queue *q)
{
        BUG_ON(!q);
        BUG_ON(!q->ops);
        BUG_ON(!q->mem_ops);
        BUG_ON(!q->type);
        BUG_ON(!q->io_modes);
[...]

Unless I'm overlooking something they look fine to me,
since vb2_queue should always be prepared  by the driver.

On the other hand, it seems these BUG_ON are inherited from videobuf1
(see videobuf_queue_core_init).

Marek, Pawel: What do you think?

Thanks,
Ezequiel.
--
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