staging: bcm2835-camera: Refactored get_format function
Subsystems (3)
PATCH 1/1 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 <[email protected]>
--- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +2 -5
@@ -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 ; }/* ------------------------------------------------------------------
Signature · 1 line
1.9.1