Skip to content

Commit

Permalink
[media] media: soc-camera: remove superfluous JPEG checking
Browse files Browse the repository at this point in the history
Explicit checks for the JPEG pixel format in soc_mbus_bytes_per_line() and
soc_mbus_image_size() are superfluous, because also without them these
functions will perform correctly. The former will return 0 based on
packing == SOC_MBUS_PACKING_VARIABLE and the latter will simply multiply
the user-provided line length by the image height to obtain a frame buffer
size estimate. The original version of the "media: soc_camera: don't clear
pix->sizeimage in JPEG mode" patch was correct and my amendment, adding
these two checks was superfluous.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Dec 20, 2012
1 parent 454547f commit cea4c9e
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions drivers/media/platform/soc_camera/soc_mediabus.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,6 @@ EXPORT_SYMBOL(soc_mbus_samples_per_pixel);

s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf)
{
if (mf->fourcc == V4L2_PIX_FMT_JPEG)
return 0;

if (mf->layout != SOC_MBUS_LAYOUT_PACKED)
return width * mf->bits_per_sample / 8;

Expand All @@ -403,9 +400,6 @@ EXPORT_SYMBOL(soc_mbus_bytes_per_line);
s32 soc_mbus_image_size(const struct soc_mbus_pixelfmt *mf,
u32 bytes_per_line, u32 height)
{
if (mf->fourcc == V4L2_PIX_FMT_JPEG)
return 0;

if (mf->layout == SOC_MBUS_LAYOUT_PACKED)
return bytes_per_line * height;

Expand Down

0 comments on commit cea4c9e

Please sign in to comment.