v4l2-mc: remove the unused sensor var
diff mbox

Message ID ff1ecda875c7278da1b585f0423224f2e645ce96.1455272007.git.mchehab@osg.samsung.com
State New
Headers show

Commit Message

Mauro Carvalho Chehab Feb. 12, 2016, 10:13 a.m. UTC
This fixes this warning:

	v4l2-mc.c: In function 'v4l2_mc_create_media_graph':
	v4l2-mc.c:60:69: warning: variable 'sensor' set but not used [-Wunused-but-set-variable]

We could solve it the other way: don't do the second loop for
webcams. However, that would fail if a chip would have two sensors
plugged. This is not the current case, but it doesn't hurt to be
future-safe here, specially since this code runs only once during
device probe. So, performance is not an issue here.

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
 drivers/media/v4l2-core/v4l2-mc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff mbox

diff --git a/drivers/media/v4l2-core/v4l2-mc.c b/drivers/media/v4l2-core/v4l2-mc.c
index ab5e42a86cc5..b61f8d969958 100644
--- a/drivers/media/v4l2-core/v4l2-mc.c
+++ b/drivers/media/v4l2-core/v4l2-mc.c
@@ -96,7 +96,7 @@  int v4l2_mc_create_media_graph(struct media_device *mdev)
 	struct media_entity *entity;
-	struct media_entity *if_vid = NULL, *if_aud = NULL, *sensor = NULL;
+	struct media_entity *if_vid = NULL, *if_aud = NULL;
 	struct media_entity *tuner = NULL, *decoder = NULL;
 	struct media_entity *io_v4l = NULL, *io_vbi = NULL, *io_swradio = NULL;
 	bool is_webcam = false;
@@ -130,7 +130,6 @@  int v4l2_mc_create_media_graph(struct media_device *mdev)
 			io_swradio = entity;
-			sensor = entity;
 			is_webcam = true;