Skip to content

Commit c5d337a

Browse files
pinchartlgregkh
authored andcommitted
usb: gadget: uvc: Fix comment blocks style
The UVC gadget driver historically uses the /* Comment * style */ for multi-line block comments, which is frowned upon. Patches for the driver are required to use the more standard /* * Comment * style */ style. This result in inconsistencies. Fix it by converting all remaining instances of the old style. Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f2906aa commit c5d337a

File tree

3 files changed

+31
-17
lines changed

3 files changed

+31
-17
lines changed

drivers/usb/gadget/function/f_uvc.c

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ static struct usb_endpoint_descriptor uvc_fs_streaming_ep = {
141141
.bEndpointAddress = USB_DIR_IN,
142142
.bmAttributes = USB_ENDPOINT_SYNC_ASYNC
143143
| USB_ENDPOINT_XFER_ISOC,
144-
/* The wMaxPacketSize and bInterval values will be initialized from
144+
/*
145+
* The wMaxPacketSize and bInterval values will be initialized from
145146
* module parameters.
146147
*/
147148
};
@@ -152,7 +153,8 @@ static struct usb_endpoint_descriptor uvc_hs_streaming_ep = {
152153
.bEndpointAddress = USB_DIR_IN,
153154
.bmAttributes = USB_ENDPOINT_SYNC_ASYNC
154155
| USB_ENDPOINT_XFER_ISOC,
155-
/* The wMaxPacketSize and bInterval values will be initialized from
156+
/*
157+
* The wMaxPacketSize and bInterval values will be initialized from
156158
* module parameters.
157159
*/
158160
};
@@ -164,15 +166,17 @@ static struct usb_endpoint_descriptor uvc_ss_streaming_ep = {
164166
.bEndpointAddress = USB_DIR_IN,
165167
.bmAttributes = USB_ENDPOINT_SYNC_ASYNC
166168
| USB_ENDPOINT_XFER_ISOC,
167-
/* The wMaxPacketSize and bInterval values will be initialized from
169+
/*
170+
* The wMaxPacketSize and bInterval values will be initialized from
168171
* module parameters.
169172
*/
170173
};
171174

172175
static struct usb_ss_ep_comp_descriptor uvc_ss_streaming_comp = {
173176
.bLength = sizeof(uvc_ss_streaming_comp),
174177
.bDescriptorType = USB_DT_SS_ENDPOINT_COMP,
175-
/* The bMaxBurst, bmAttributes and wBytesPerInterval values will be
178+
/*
179+
* The bMaxBurst, bmAttributes and wBytesPerInterval values will be
176180
* initialized from module parameters.
177181
*/
178182
};
@@ -234,7 +238,8 @@ uvc_function_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
234238
if (le16_to_cpu(ctrl->wLength) > UVC_MAX_REQUEST_SIZE)
235239
return -EINVAL;
236240

237-
/* Tell the complete callback to generate an event for the next request
241+
/*
242+
* Tell the complete callback to generate an event for the next request
238243
* that will be enqueued by UVCIOC_SEND_RESPONSE.
239244
*/
240245
uvc->event_setup_out = !(ctrl->bRequestType & USB_DIR_IN);
@@ -500,7 +505,8 @@ uvc_copy_descriptors(struct uvc_device *uvc, enum usb_device_speed speed)
500505
if (!uvc_control_desc || !uvc_streaming_cls)
501506
return ERR_PTR(-ENODEV);
502507

503-
/* Descriptors layout
508+
/*
509+
* Descriptors layout
504510
*
505511
* uvc_iad
506512
* uvc_control_intf
@@ -597,8 +603,7 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f)
597603
uvcg_info(f, "%s()\n", __func__);
598604

599605
opts = fi_to_f_uvc_opts(f->fi);
600-
/* Sanity check the streaming endpoint module parameters.
601-
*/
606+
/* Sanity check the streaming endpoint module parameters. */
602607
opts->streaming_interval = clamp(opts->streaming_interval, 1U, 16U);
603608
opts->streaming_maxpacket = clamp(opts->streaming_maxpacket, 1U, 3072U);
604609
opts->streaming_maxburst = min(opts->streaming_maxburst, 15U);
@@ -611,7 +616,8 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f)
611616
opts->streaming_maxpacket);
612617
}
613618

614-
/* Fill in the FS/HS/SS Video Streaming specific descriptors from the
619+
/*
620+
* Fill in the FS/HS/SS Video Streaming specific descriptors from the
615621
* module parameters.
616622
*
617623
* NOTE: We assume that the user knows what they are doing and won't
@@ -895,7 +901,8 @@ static void uvc_function_unbind(struct usb_configuration *c,
895901

896902
uvcg_info(f, "%s()\n", __func__);
897903

898-
/* If we know we're connected via v4l2, then there should be a cleanup
904+
/*
905+
* If we know we're connected via v4l2, then there should be a cleanup
899906
* of the device from userspace either via UVC_EVENT_DISCONNECT or
900907
* though the video device removal uevent. Allow some time for the
901908
* application to close out before things get deleted.
@@ -912,7 +919,8 @@ static void uvc_function_unbind(struct usb_configuration *c,
912919
v4l2_device_unregister(&uvc->v4l2_dev);
913920

914921
if (uvc->func_connected) {
915-
/* Wait for the release to occur to ensure there are no longer any
922+
/*
923+
* Wait for the release to occur to ensure there are no longer any
916924
* pending operations that may cause panics when resources are cleaned
917925
* up.
918926
*/

drivers/usb/gadget/function/uvc_queue.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ static void uvc_buffer_queue(struct vb2_buffer *vb)
104104
if (likely(!(queue->flags & UVC_QUEUE_DISCONNECTED))) {
105105
list_add_tail(&buf->queue, &queue->irqqueue);
106106
} else {
107-
/* If the device is disconnected return the buffer to userspace
107+
/*
108+
* If the device is disconnected return the buffer to userspace
108109
* directly. The next QBUF call will fail with -ENODEV.
109110
*/
110111
buf->state = UVC_BUF_STATE_ERROR;
@@ -255,7 +256,8 @@ void uvcg_queue_cancel(struct uvc_video_queue *queue, int disconnect)
255256
}
256257
queue->buf_used = 0;
257258

258-
/* This must be protected by the irqlock spinlock to avoid race
259+
/*
260+
* This must be protected by the irqlock spinlock to avoid race
259261
* conditions between uvc_queue_buffer and the disconnection event that
260262
* could result in an interruptible wait in uvc_dequeue_buffer. Do not
261263
* blindly replace this logic by checking for the UVC_DEV_DISCONNECTED

drivers/usb/gadget/function/uvc_video.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,8 @@ static void uvcg_video_pump(struct work_struct *work)
378378
int ret;
379379

380380
while (video->ep->enabled) {
381-
/* Retrieve the first available USB request, protected by the
381+
/*
382+
* Retrieve the first available USB request, protected by the
382383
* request lock.
383384
*/
384385
spin_lock_irqsave(&video->req_lock, flags);
@@ -391,7 +392,8 @@ static void uvcg_video_pump(struct work_struct *work)
391392
list_del(&req->list);
392393
spin_unlock_irqrestore(&video->req_lock, flags);
393394

394-
/* Retrieve the first available video buffer and fill the
395+
/*
396+
* Retrieve the first available video buffer and fill the
395397
* request, protected by the video queue irqlock.
396398
*/
397399
spin_lock_irqsave(&queue->irqlock, flags);
@@ -403,9 +405,11 @@ static void uvcg_video_pump(struct work_struct *work)
403405

404406
video->encode(req, video, buf);
405407

406-
/* With usb3 we have more requests. This will decrease the
408+
/*
409+
* With usb3 we have more requests. This will decrease the
407410
* interrupt load to a quarter but also catches the corner
408-
* cases, which needs to be handled */
411+
* cases, which needs to be handled.
412+
*/
409413
if (list_empty(&video->req_free) ||
410414
buf->state == UVC_BUF_STATE_DONE ||
411415
!(video->req_int_count %

0 commit comments

Comments
 (0)