Skip to content

Commit 34d340b

Browse files
srishti9612mchehab
authored andcommitted
media: Staging: media: atomisp: Merge assignment with return
Merge the assignment and the return statements to return the value directly. Done using the following semantic patch by coccinelle. @@ local idexpression ret; expression e; @@ -ret = +return e; -return ret; Signed-off-by: Srishti Sharma <[email protected]> Acked-by: Julia Lawall <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 866af46 commit 34d340b

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

drivers/staging/media/atomisp/i2c/ov5693/ov5693.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -945,12 +945,8 @@ static int ad5823_t_focus_vcm(struct v4l2_subdev *sd, u16 val)
945945

946946
int ad5823_t_focus_abs(struct v4l2_subdev *sd, s32 value)
947947
{
948-
int ret;
949-
950948
value = min(value, AD5823_MAX_FOCUS_POS);
951-
ret = ad5823_t_focus_vcm(sd, value);
952-
953-
return ret;
949+
return ad5823_t_focus_vcm(sd, value);
954950
}
955951

956952
static int ov5693_t_focus_abs(struct v4l2_subdev *sd, s32 value)
@@ -1332,7 +1328,6 @@ static int power_ctrl(struct v4l2_subdev *sd, bool flag)
13321328

13331329
static int gpio_ctrl(struct v4l2_subdev *sd, bool flag)
13341330
{
1335-
int ret;
13361331
struct ov5693_device *dev = to_ov5693_sensor(sd);
13371332

13381333
if (!dev || !dev->platform_data)
@@ -1342,9 +1337,7 @@ static int gpio_ctrl(struct v4l2_subdev *sd, bool flag)
13421337
if (dev->platform_data->gpio_ctrl)
13431338
return dev->platform_data->gpio_ctrl(sd, flag);
13441339

1345-
ret = dev->platform_data->gpio0_ctrl(sd, flag);
1346-
1347-
return ret;
1340+
return dev->platform_data->gpio0_ctrl(sd, flag);
13481341
}
13491342

13501343
static int __power_up(struct v4l2_subdev *sd)

drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,13 +1168,9 @@ void hmm_bo_free_pages(struct hmm_buffer_object *bo)
11681168

11691169
int hmm_bo_page_allocated(struct hmm_buffer_object *bo)
11701170
{
1171-
int ret;
1172-
11731171
check_bo_null_return(bo, 0);
11741172

1175-
ret = bo->status & HMM_BO_PAGE_ALLOCED;
1176-
1177-
return ret;
1173+
return bo->status & HMM_BO_PAGE_ALLOCED;
11781174
}
11791175

11801176
/*

0 commit comments

Comments
 (0)