提交 fa2ccd35 编写于 作者: N Narcisa Ana Maria Vasile 提交者: Greg Kroah-Hartman

staging: bcm2835-camera: Refactored get_format function

Now, when the condition inside the for is fulfilled, I return the result,
instead of checking afterwards whether the counter has reached or not
the end of the list.
Signed-off-by: NNarcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 2430125c
......@@ -229,13 +229,10 @@ static struct mmal_fmt *get_format(struct v4l2_format *f)
for (k = 0; k < ARRAY_SIZE(formats); k++) {
fmt = &formats[k];
if (fmt->fourcc == f->fmt.pix.pixelformat)
break;
return fmt;
}
if (k == ARRAY_SIZE(formats))
return NULL;
return &formats[k];
return NULL;
}
/* ------------------------------------------------------------------
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册