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: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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;
}
/* ------------------------------------------------------------------