Commit 3b0d0f33 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mauro Carvalho Chehab

media: ov2740: Drop redundant assignments of ret = 0

In some cases it might hide real bugs, in most cases here it's just
redundant as it's being reassigned immediately after initial assignment.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 1de49712
...@@ -378,7 +378,7 @@ static int ov2740_read_reg(struct ov2740 *ov2740, u16 reg, u16 len, u32 *val) ...@@ -378,7 +378,7 @@ static int ov2740_read_reg(struct ov2740 *ov2740, u16 reg, u16 len, u32 *val)
struct i2c_msg msgs[2]; struct i2c_msg msgs[2];
u8 addr_buf[2]; u8 addr_buf[2];
u8 data_buf[4] = {0}; u8 data_buf[4] = {0};
int ret = 0; int ret;
if (len > sizeof(data_buf)) if (len > sizeof(data_buf))
return -EINVAL; return -EINVAL;
...@@ -406,7 +406,7 @@ static int ov2740_write_reg(struct ov2740 *ov2740, u16 reg, u16 len, u32 val) ...@@ -406,7 +406,7 @@ static int ov2740_write_reg(struct ov2740 *ov2740, u16 reg, u16 len, u32 val)
{ {
struct i2c_client *client = v4l2_get_subdevdata(&ov2740->sd); struct i2c_client *client = v4l2_get_subdevdata(&ov2740->sd);
u8 buf[6]; u8 buf[6];
int ret = 0; int ret;
if (len > 4) if (len > 4)
return -EINVAL; return -EINVAL;
...@@ -426,7 +426,7 @@ static int ov2740_write_reg_list(struct ov2740 *ov2740, ...@@ -426,7 +426,7 @@ static int ov2740_write_reg_list(struct ov2740 *ov2740,
{ {
struct i2c_client *client = v4l2_get_subdevdata(&ov2740->sd); struct i2c_client *client = v4l2_get_subdevdata(&ov2740->sd);
unsigned int i; unsigned int i;
int ret = 0; int ret;
for (i = 0; i < r_list->num_of_regs; i++) { for (i = 0; i < r_list->num_of_regs; i++) {
ret = ov2740_write_reg(ov2740, r_list->regs[i].address, 1, ret = ov2740_write_reg(ov2740, r_list->regs[i].address, 1,
...@@ -468,7 +468,7 @@ static int ov2740_identify_module(struct ov2740 *ov2740) ...@@ -468,7 +468,7 @@ static int ov2740_identify_module(struct ov2740 *ov2740)
static int ov2740_update_digital_gain(struct ov2740 *ov2740, u32 d_gain) static int ov2740_update_digital_gain(struct ov2740 *ov2740, u32 d_gain)
{ {
int ret = 0; int ret;
ret = ov2740_write_reg(ov2740, OV2740_REG_GROUP_ACCESS, 1, ret = ov2740_write_reg(ov2740, OV2740_REG_GROUP_ACCESS, 1,
OV2740_GROUP_HOLD_START); OV2740_GROUP_HOLD_START);
...@@ -512,7 +512,7 @@ static int ov2740_set_ctrl(struct v4l2_ctrl *ctrl) ...@@ -512,7 +512,7 @@ static int ov2740_set_ctrl(struct v4l2_ctrl *ctrl)
struct ov2740, ctrl_handler); struct ov2740, ctrl_handler);
struct i2c_client *client = v4l2_get_subdevdata(&ov2740->sd); struct i2c_client *client = v4l2_get_subdevdata(&ov2740->sd);
s64 exposure_max; s64 exposure_max;
int ret = 0; int ret;
/* Propagate change of current control to all related controls */ /* Propagate change of current control to all related controls */
if (ctrl->id == V4L2_CID_VBLANK) { if (ctrl->id == V4L2_CID_VBLANK) {
...@@ -575,7 +575,7 @@ static int ov2740_init_controls(struct ov2740 *ov2740) ...@@ -575,7 +575,7 @@ static int ov2740_init_controls(struct ov2740 *ov2740)
s64 exposure_max, h_blank, pixel_rate; s64 exposure_max, h_blank, pixel_rate;
u32 vblank_min, vblank_max, vblank_default; u32 vblank_min, vblank_max, vblank_default;
int size; int size;
int ret = 0; int ret;
ctrl_hdlr = &ov2740->ctrl_handler; ctrl_hdlr = &ov2740->ctrl_handler;
ret = v4l2_ctrl_handler_init(ctrl_hdlr, 8); ret = v4l2_ctrl_handler_init(ctrl_hdlr, 8);
...@@ -741,7 +741,7 @@ static int ov2740_start_streaming(struct ov2740 *ov2740) ...@@ -741,7 +741,7 @@ static int ov2740_start_streaming(struct ov2740 *ov2740)
struct i2c_client *client = v4l2_get_subdevdata(&ov2740->sd); struct i2c_client *client = v4l2_get_subdevdata(&ov2740->sd);
const struct ov2740_reg_list *reg_list; const struct ov2740_reg_list *reg_list;
int link_freq_index; int link_freq_index;
int ret = 0; int ret;
ret = ov2740_identify_module(ov2740); ret = ov2740_identify_module(ov2740);
if (ret) if (ret)
...@@ -1134,8 +1134,8 @@ static int ov2740_register_nvmem(struct i2c_client *client, ...@@ -1134,8 +1134,8 @@ static int ov2740_register_nvmem(struct i2c_client *client,
static int ov2740_probe(struct i2c_client *client) static int ov2740_probe(struct i2c_client *client)
{ {
struct ov2740 *ov2740; struct ov2740 *ov2740;
int ret = 0;
bool full_power; bool full_power;
int ret;
ret = ov2740_check_hwcfg(&client->dev); ret = ov2740_check_hwcfg(&client->dev);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment