Re: [PATCHv17 14/34] v4l2-ctrls: add core request support

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

 



Em Tue, 14 Aug 2018 10:34:47 +0200
Hans Verkuil <hverkuil@xxxxxxxxx> escreveu:

> >> +void v4l2_ctrl_request_setup(struct media_request *req,
> >> +			     struct v4l2_ctrl_handler *main_hdl)
> >> +{
> >> +	struct media_request_object *obj;
> >> +	struct v4l2_ctrl_handler *hdl;
> >> +	struct v4l2_ctrl_ref *ref;
> >> +
> >> +	if (!req || !main_hdl)
> >> +		return;
> >> +
> >> +	if (WARN_ON(req->state != MEDIA_REQUEST_STATE_QUEUED))
> >> +		return;
> >> +
> >> +	obj = media_request_object_find(req, &req_ops, main_hdl);
> >> +	if (!obj)
> >> +		return;  
> > 
> > Shouldn't the above checks produce an error or print something at
> > the logs?  
> 
> Good question.
> 
> I think not. This situation would occur if the applications makes a request
> with only a buffer but no controls, thus making no changes to the controls in
> this request.
> 
> This is perfectly legal, so nothing needs to be logged here.

Ok, makes sense.

Please add a note at the source code explaining that, as this is
not obvious for a casual code reviewer.


Thanks,
Mauro



[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