Skip to content

Commit

Permalink
[media] fimc-lite: Fix the variable type to avoid possible crash
Browse files Browse the repository at this point in the history
Changing the variable type to 'int' from 'unsigned int'. Driver
logic expects the variable type to be 'int'.

Signed-off-by: Shaik Ameer Basha <shaik.ameer@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Shaik Ameer Basha authored and Mauro Carvalho Chehab committed Mar 21, 2013
1 parent 4cec189 commit 6a53609
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/media/platform/s5p-fimc/fimc-lite-reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ static const u32 src_pixfmt_map[8][3] = {
void flite_hw_set_source_format(struct fimc_lite *dev, struct flite_frame *f)
{
enum v4l2_mbus_pixelcode pixelcode = dev->fmt->mbus_code;
unsigned int i = ARRAY_SIZE(src_pixfmt_map);
int i = ARRAY_SIZE(src_pixfmt_map);
u32 cfg;

while (i-- >= 0) {
while (--i >= 0) {
if (src_pixfmt_map[i][0] == pixelcode)
break;
}
Expand Down Expand Up @@ -224,9 +224,9 @@ static void flite_hw_set_out_order(struct fimc_lite *dev, struct flite_frame *f)
{ V4L2_MBUS_FMT_VYUY8_2X8, FLITE_REG_CIODMAFMT_CRYCBY },
};
u32 cfg = readl(dev->regs + FLITE_REG_CIODMAFMT);
unsigned int i = ARRAY_SIZE(pixcode);
int i = ARRAY_SIZE(pixcode);

while (i-- >= 0)
while (--i >= 0)
if (pixcode[i][0] == dev->fmt->mbus_code)
break;
cfg &= ~FLITE_REG_CIODMAFMT_YCBCR_ORDER_MASK;
Expand Down

0 comments on commit 6a53609

Please sign in to comment.