mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-29 14:05:05 -04:00
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: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2430125c1f
commit
fa2ccd35d7
@@ -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;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user