diff options
| -rw-r--r-- | drivers/media/video/uvc/uvc_ctrl.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c index af26bbe6f76e..f7061a5ef1d2 100644 --- a/drivers/media/video/uvc/uvc_ctrl.c +++ b/drivers/media/video/uvc/uvc_ctrl.c | |||
| @@ -2083,7 +2083,7 @@ int uvc_ctrl_init_device(struct uvc_device *dev) | |||
| 2083 | /* Walk the entities list and instantiate controls */ | 2083 | /* Walk the entities list and instantiate controls */ |
| 2084 | list_for_each_entry(entity, &dev->entities, list) { | 2084 | list_for_each_entry(entity, &dev->entities, list) { |
| 2085 | struct uvc_control *ctrl; | 2085 | struct uvc_control *ctrl; |
| 2086 | unsigned int bControlSize = 0, ncontrols = 0; | 2086 | unsigned int bControlSize = 0, ncontrols; |
| 2087 | __u8 *bmControls = NULL; | 2087 | __u8 *bmControls = NULL; |
| 2088 | 2088 | ||
| 2089 | if (UVC_ENTITY_TYPE(entity) == UVC_VC_EXTENSION_UNIT) { | 2089 | if (UVC_ENTITY_TYPE(entity) == UVC_VC_EXTENSION_UNIT) { |
| @@ -2101,8 +2101,7 @@ int uvc_ctrl_init_device(struct uvc_device *dev) | |||
| 2101 | uvc_ctrl_prune_entity(dev, entity); | 2101 | uvc_ctrl_prune_entity(dev, entity); |
| 2102 | 2102 | ||
| 2103 | /* Count supported controls and allocate the controls array */ | 2103 | /* Count supported controls and allocate the controls array */ |
| 2104 | for (i = 0; i < bControlSize; ++i) | 2104 | ncontrols = memweight(bmControls, bControlSize); |
| 2105 | ncontrols += hweight8(bmControls[i]); | ||
| 2106 | if (ncontrols == 0) | 2105 | if (ncontrols == 0) |
| 2107 | continue; | 2106 | continue; |
| 2108 | 2107 | ||
