Skip to content

Commit

Permalink
[media] gspca: Fix coding style issues
Browse files Browse the repository at this point in the history
The errors were found by checkpatch.pl. Most fixes are:
- remove spaces followed by TAB(s),
- split lines greater than 80 characters,
- move most '{'s from start of line to end of previous line.
  (Some '{'s at start of line remain when the '}'s are on the same line)

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Jean-François Moine authored and Mauro Carvalho Chehab committed Oct 21, 2010
1 parent 76ad3b6 commit 780e312
Show file tree
Hide file tree
Showing 34 changed files with 285 additions and 312 deletions.
3 changes: 2 additions & 1 deletion drivers/media/video/gspca/benq.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ static void sd_stopN(struct gspca_dev *gspca_dev)
reg_w(gspca_dev, 0x003c, 0x0005);
reg_w(gspca_dev, 0x003c, 0x0006);
reg_w(gspca_dev, 0x003c, 0x0007);
usb_set_interface(gspca_dev->dev, gspca_dev->iface, gspca_dev->nbalt - 1);
usb_set_interface(gspca_dev->dev, gspca_dev->iface,
gspca_dev->nbalt - 1);
}

static void sd_pkt_scan(struct gspca_dev *gspca_dev,
Expand Down
6 changes: 3 additions & 3 deletions drivers/media/video/gspca/conex.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ static void cx11646_jpeg(struct gspca_dev*gspca_dev)
reg_w_val(gspca_dev, 0x00c0, 0x00);
reg_r(gspca_dev, 0x0001, 1);
length = 8;
switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) {
switch (gspca_dev->cam.cam_mode[gspca_dev->curr_mode].priv) {
case 0:
for (i = 0; i < 27; i++) {
if (i == 26)
Expand Down Expand Up @@ -901,7 +901,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}

static void setbrightness(struct gspca_dev*gspca_dev)
static void setbrightness(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;
__u8 regE5cbx[] = { 0x88, 0x00, 0xd4, 0x01, 0x88, 0x01, 0x01, 0x01 };
Expand All @@ -924,7 +924,7 @@ static void setbrightness(struct gspca_dev*gspca_dev)
reg_w_val(gspca_dev, 0x0070, reg70);
}

static void setcontrast(struct gspca_dev*gspca_dev)
static void setcontrast(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;
__u8 regE5acx[] = { 0x88, 0x0a, 0x0c, 0x01 }; /* seem MSB */
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/video/gspca/etoms.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,9 +710,9 @@ static void Et_setgainG(struct gspca_dev *gspca_dev, __u8 gain)
}

#define BLIMIT(bright) \
(__u8)((bright > 0x1f)?0x1f:((bright < 4)?3:bright))
(u8)((bright > 0x1f) ? 0x1f : ((bright < 4) ? 3 : bright))
#define LIMIT(color) \
(unsigned char)((color > 0xff)?0xff:((color < 0)?0:color))
(u8)((color > 0xff) ? 0xff : ((color < 0) ? 0 : color))

static void do_autogain(struct gspca_dev *gspca_dev)
{
Expand Down
6 changes: 3 additions & 3 deletions drivers/media/video/gspca/gl860/gl860-mi2020.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ static u8 dat_multi5[] = { 0x8c, 0xa1, 0x03 };
static u8 dat_multi6[] = { 0x90, 0x00, 0x05 };

static struct validx tbl_init_at_startup[] = {
{0x0000, 0x0000}, {0x0010, 0x0010}, {0x0008, 0x00c0}, {0x0001,0x00c1},
{0x0000, 0x0000}, {0x0010, 0x0010}, {0x0008, 0x00c0}, {0x0001, 0x00c1},
{0x0001, 0x00c2}, {0x0020, 0x0006}, {0x006a, 0x000d},
{53, 0xffff},
{0x0040, 0x0000}, {0x0063, 0x0006},
};

static struct validx tbl_common_0B[] = {
{0x0002, 0x0004}, {0x006a, 0x0007}, {0x00ef, 0x0006}, {0x006a,0x000d},
{0x0000, 0x00c0}, {0x0010, 0x0010}, {0x0003, 0x00c1}, {0x0042,0x00c2},
{0x0002, 0x0004}, {0x006a, 0x0007}, {0x00ef, 0x0006}, {0x006a, 0x000d},
{0x0000, 0x00c0}, {0x0010, 0x0010}, {0x0003, 0x00c1}, {0x0042, 0x00c2},
{0x0004, 0x00d8}, {0x0000, 0x0058}, {0x0041, 0x0000},
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/gspca/gspca.c
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
continue;
if (idx >= 0
&& gspca_dev->sd_desc->ctrls[i].qctrl.id
> gspca_dev->sd_desc->ctrls[idx].qctrl.id)
> gspca_dev->sd_desc->ctrls[idx].qctrl.id)
continue;
idx = i;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/video/gspca/konica.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static const struct ctrl sd_ctrls[] = {
{
.id = V4L2_CID_CONTRAST,
.type = V4L2_CTRL_TYPE_INTEGER,
.name = "contrast",
.name = "Contrast",
.minimum = 0,
.maximum = 9,
.step = 4,
Expand Down Expand Up @@ -121,7 +121,7 @@ static const struct ctrl sd_ctrls[] = {
{
.id = V4L2_CID_WHITE_BALANCE_TEMPERATURE,
.type = V4L2_CTRL_TYPE_INTEGER,
.name = "Whitebalance ",
.name = "White Balance",
.minimum = 0,
.maximum = 33,
.step = 1,
Expand Down
48 changes: 24 additions & 24 deletions drivers/media/video/gspca/m5602/m5602_mt9m111.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,44 +109,44 @@ static const struct ctrl mt9m111_ctrls[] = {
#define GREEN_BALANCE_IDX 4
{
{
.id = M5602_V4L2_CID_GREEN_BALANCE,
.type = V4L2_CTRL_TYPE_INTEGER,
.name = "green balance",
.minimum = 0x00,
.maximum = 0x7ff,
.step = 0x1,
.default_value = MT9M111_GREEN_GAIN_DEFAULT,
.flags = V4L2_CTRL_FLAG_SLIDER
.id = M5602_V4L2_CID_GREEN_BALANCE,
.type = V4L2_CTRL_TYPE_INTEGER,
.name = "green balance",
.minimum = 0x00,
.maximum = 0x7ff,
.step = 0x1,
.default_value = MT9M111_GREEN_GAIN_DEFAULT,
.flags = V4L2_CTRL_FLAG_SLIDER
},
.set = mt9m111_set_green_balance,
.get = mt9m111_get_green_balance
},
#define BLUE_BALANCE_IDX 5
{
{
.id = V4L2_CID_BLUE_BALANCE,
.type = V4L2_CTRL_TYPE_INTEGER,
.name = "blue balance",
.minimum = 0x00,
.maximum = 0x7ff,
.step = 0x1,
.default_value = MT9M111_BLUE_GAIN_DEFAULT,
.flags = V4L2_CTRL_FLAG_SLIDER
.id = V4L2_CID_BLUE_BALANCE,
.type = V4L2_CTRL_TYPE_INTEGER,
.name = "blue balance",
.minimum = 0x00,
.maximum = 0x7ff,
.step = 0x1,
.default_value = MT9M111_BLUE_GAIN_DEFAULT,
.flags = V4L2_CTRL_FLAG_SLIDER
},
.set = mt9m111_set_blue_balance,
.get = mt9m111_get_blue_balance
},
#define RED_BALANCE_IDX 5
{
{
.id = V4L2_CID_RED_BALANCE,
.type = V4L2_CTRL_TYPE_INTEGER,
.name = "red balance",
.minimum = 0x00,
.maximum = 0x7ff,
.step = 0x1,
.default_value = MT9M111_RED_GAIN_DEFAULT,
.flags = V4L2_CTRL_FLAG_SLIDER
.id = V4L2_CID_RED_BALANCE,
.type = V4L2_CTRL_TYPE_INTEGER,
.name = "red balance",
.minimum = 0x00,
.maximum = 0x7ff,
.step = 0x1,
.default_value = MT9M111_RED_GAIN_DEFAULT,
.flags = V4L2_CTRL_FLAG_SLIDER
},
.set = mt9m111_set_red_balance,
.get = mt9m111_get_red_balance
Expand Down
14 changes: 5 additions & 9 deletions drivers/media/video/gspca/m5602/m5602_mt9m111.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
#define MT9M111_COLORPIPE 0x01
#define MT9M111_CAMERA_CONTROL 0x02

#define MT9M111_RESET (1 << 0)
#define MT9M111_RESET (1 << 0)
#define MT9M111_RESTART (1 << 1)
#define MT9M111_ANALOG_STANDBY (1 << 2)
#define MT9M111_CHIP_ENABLE (1 << 3)
Expand All @@ -97,7 +97,7 @@
#define MT9M111_2D_DEFECT_CORRECTION_ENABLE (1 << 0)

#define INITIAL_MAX_GAIN 64
#define MT9M111_DEFAULT_GAIN 283
#define MT9M111_DEFAULT_GAIN 283
#define MT9M111_GREEN_GAIN_DEFAULT 0x20
#define MT9M111_BLUE_GAIN_DEFAULT 0x20
#define MT9M111_RED_GAIN_DEFAULT 0x20
Expand Down Expand Up @@ -125,8 +125,7 @@ static const struct m5602_sensor mt9m111 = {
.start = mt9m111_start,
};

static const unsigned char preinit_mt9m111[][4] =
{
static const unsigned char preinit_mt9m111[][4] = {
{BRIDGE, M5602_XB_MCU_CLK_DIV, 0x02, 0x00},
{BRIDGE, M5602_XB_MCU_CLK_CTRL, 0xb0, 0x00},
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
Expand Down Expand Up @@ -165,8 +164,7 @@ static const unsigned char preinit_mt9m111[][4] =
{BRIDGE, M5602_XB_I2C_CLK_DIV, 0x0a, 0x00}
};

static const unsigned char init_mt9m111[][4] =
{
static const unsigned char init_mt9m111[][4] = {
{BRIDGE, M5602_XB_MCU_CLK_DIV, 0x02, 0x00},
{BRIDGE, M5602_XB_MCU_CLK_CTRL, 0xb0, 0x00},
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
Expand Down Expand Up @@ -257,8 +255,7 @@ static const unsigned char init_mt9m111[][4] =
{SENSOR, MT9M111_SC_SHUTTER_WIDTH, 0x01, 0x90},
};

static const unsigned char start_mt9m111[][4] =
{
static const unsigned char start_mt9m111[][4] = {
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x06, 0x00},
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
{BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},
Expand All @@ -271,5 +268,4 @@ static const unsigned char start_mt9m111[][4] =
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
};

#endif
70 changes: 35 additions & 35 deletions drivers/media/video/gspca/m5602/m5602_ov7660.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,69 +54,69 @@ static const struct ctrl ov7660_ctrls[] = {
#define AUTO_WHITE_BALANCE_IDX 4
{
{
.id = V4L2_CID_AUTO_WHITE_BALANCE,
.type = V4L2_CTRL_TYPE_BOOLEAN,
.name = "auto white balance",
.minimum = 0,
.maximum = 1,
.step = 1,
.default_value = 1
.id = V4L2_CID_AUTO_WHITE_BALANCE,
.type = V4L2_CTRL_TYPE_BOOLEAN,
.name = "auto white balance",
.minimum = 0,
.maximum = 1,
.step = 1,
.default_value = 1
},
.set = ov7660_set_auto_white_balance,
.get = ov7660_get_auto_white_balance
},
#define AUTO_GAIN_CTRL_IDX 5
{
{
.id = V4L2_CID_AUTOGAIN,
.type = V4L2_CTRL_TYPE_BOOLEAN,
.name = "auto gain control",
.minimum = 0,
.maximum = 1,
.step = 1,
.default_value = 1
.id = V4L2_CID_AUTOGAIN,
.type = V4L2_CTRL_TYPE_BOOLEAN,
.name = "auto gain control",
.minimum = 0,
.maximum = 1,
.step = 1,
.default_value = 1
},
.set = ov7660_set_auto_gain,
.get = ov7660_get_auto_gain
},
#define AUTO_EXPOSURE_IDX 6
{
{
.id = V4L2_CID_EXPOSURE_AUTO,
.type = V4L2_CTRL_TYPE_BOOLEAN,
.name = "auto exposure",
.minimum = 0,
.maximum = 1,
.step = 1,
.default_value = 1
.id = V4L2_CID_EXPOSURE_AUTO,
.type = V4L2_CTRL_TYPE_BOOLEAN,
.name = "auto exposure",
.minimum = 0,
.maximum = 1,
.step = 1,
.default_value = 1
},
.set = ov7660_set_auto_exposure,
.get = ov7660_get_auto_exposure
},
#define HFLIP_IDX 7
{
{
.id = V4L2_CID_HFLIP,
.type = V4L2_CTRL_TYPE_BOOLEAN,
.name = "horizontal flip",
.minimum = 0,
.maximum = 1,
.step = 1,
.default_value = 0
.id = V4L2_CID_HFLIP,
.type = V4L2_CTRL_TYPE_BOOLEAN,
.name = "horizontal flip",
.minimum = 0,
.maximum = 1,
.step = 1,
.default_value = 0
},
.set = ov7660_set_hflip,
.get = ov7660_get_hflip
},
#define VFLIP_IDX 8
{
{
.id = V4L2_CID_VFLIP,
.type = V4L2_CTRL_TYPE_BOOLEAN,
.name = "vertical flip",
.minimum = 0,
.maximum = 1,
.step = 1,
.default_value = 0
.id = V4L2_CID_VFLIP,
.type = V4L2_CTRL_TYPE_BOOLEAN,
.name = "vertical flip",
.minimum = 0,
.maximum = 1,
.step = 1,
.default_value = 0
},
.set = ov7660_set_vflip,
.get = ov7660_get_vflip
Expand Down
9 changes: 3 additions & 6 deletions drivers/media/video/gspca/m5602/m5602_ov7660.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

#define OV7660_DEFAULT_GAIN 0x0e
#define OV7660_DEFAULT_RED_GAIN 0x80
#define OV7660_DEFAULT_BLUE_GAIN 0x80
#define OV7660_DEFAULT_BLUE_GAIN 0x80
#define OV7660_DEFAULT_SATURATION 0x00
#define OV7660_DEFAULT_EXPOSURE 0x20

Expand All @@ -105,8 +105,7 @@ static const struct m5602_sensor ov7660 = {
.disconnect = ov7660_disconnect,
};

static const unsigned char preinit_ov7660[][4] =
{
static const unsigned char preinit_ov7660[][4] = {
{BRIDGE, M5602_XB_MCU_CLK_DIV, 0x02},
{BRIDGE, M5602_XB_MCU_CLK_CTRL, 0xb0},
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00},
Expand Down Expand Up @@ -140,8 +139,7 @@ static const unsigned char preinit_ov7660[][4] =
{BRIDGE, M5602_XB_GPIO_EN_L, 0x00}
};

static const unsigned char init_ov7660[][4] =
{
static const unsigned char init_ov7660[][4] = {
{BRIDGE, M5602_XB_MCU_CLK_DIV, 0x02},
{BRIDGE, M5602_XB_MCU_CLK_CTRL, 0xb0},
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00},
Expand Down Expand Up @@ -259,5 +257,4 @@ static const unsigned char init_ov7660[][4] =
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00},
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0},
};

#endif
Loading

0 comments on commit 780e312

Please sign in to comment.