* [PATCH v2 2/2] staging: media: davinci_vpfe: Merge assignment with return
@ 2016-09-20 7:39 Rehas Sachdeva
2016-09-20 7:54 ` Rehas Sachdeva
0 siblings, 1 reply; 3+ messages in thread
From: Rehas Sachdeva @ 2016-09-20 7:39 UTC (permalink / raw)
To: outreachy-kernel; +Cc: Mauro Carvalho Chehab, Greg Kroah-Hartman
Instead of storing the return value into a variable and then returning it, we
can club the two into a single return statement. This change was made using
the following semantic patch by Coccinelle:
@@
local idexpression ret;
expression e;
@@
-ret =
+return
e;
-return ret;
Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
---
Change in v2:
Make the commit message clearer.
drivers/staging/media/davinci_vpfe/dm365_isif.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/media/davinci_vpfe/dm365_isif.c b/drivers/staging/media/davinci_vpfe/dm365_isif.c
index ae9202d..569bcdc 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_isif.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_isif.c
@@ -146,9 +146,8 @@ enum v4l2_field vpfe_isif_get_fid(struct vpfe_device *vpfe_dev)
u32 field_status;
field_status = isif_read(isif->isif_cfg.base_addr, MODESET);
- field_status = (field_status >> DM365_ISIF_MDFS_OFFSET) &
- DM365_ISIF_MDFS_MASK;
- return field_status;
+ return (field_status >> DM365_ISIF_MDFS_OFFSET) &
+ DM365_ISIF_MDFS_MASK;
}
static int
@@ -594,8 +593,7 @@ isif_validate_raw_params(struct vpfe_isif_raw_config *params)
ret = isif_validate_dfc_params(¶ms->dfc);
if (ret)
return ret;
- ret = isif_validate_bclamp_params(¶ms->bclamp);
- return ret;
+ return isif_validate_bclamp_params(¶ms->bclamp);
}
static int isif_set_params(struct v4l2_subdev *sd, void *params)
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH v2 0/2] Merge assignment with return
@ 2016-09-20 7:59 Rehas Sachdeva
2016-09-20 8:00 ` [PATCH v2 2/2] staging: media: davinci_vpfe: " Rehas Sachdeva
0 siblings, 1 reply; 3+ messages in thread
From: Rehas Sachdeva @ 2016-09-20 7:59 UTC (permalink / raw)
To: outreachy-kernel; +Cc: Mauro Carvalho Chehab, Greg Kroah-Hartman
Merges assignment and return statement into a single return statement in
media drivers.
Change in v2:
Make the commit message clearer.
Rehas Sachdeva (2):
staging: media: bcm2048: Merge assignment with return
staging: media: davinci_vpfe: Merge assignment with return
drivers/staging/media/bcm2048/radio-bcm2048.c | 14 ++++----------
drivers/staging/media/davinci_vpfe/dm365_isif.c | 8 +++-----
2 files changed, 7 insertions(+), 15 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 2/2] staging: media: davinci_vpfe: Merge assignment with return
2016-09-20 7:59 [PATCH v2 0/2] " Rehas Sachdeva
@ 2016-09-20 8:00 ` Rehas Sachdeva
0 siblings, 0 replies; 3+ messages in thread
From: Rehas Sachdeva @ 2016-09-20 8:00 UTC (permalink / raw)
To: outreachy-kernel; +Cc: Mauro Carvalho Chehab, Greg Kroah-Hartman
Instead of storing the return value into a variable and then returning it, we
can club the two into a single return statement. This change was made using
the following semantic patch by Coccinelle:
@@
local idexpression ret;
expression e;
@@
-ret =
+return
e;
-return ret;
Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
---
drivers/staging/media/davinci_vpfe/dm365_isif.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/media/davinci_vpfe/dm365_isif.c b/drivers/staging/media/davinci_vpfe/dm365_isif.c
index ae9202d..569bcdc 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_isif.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_isif.c
@@ -146,9 +146,8 @@ enum v4l2_field vpfe_isif_get_fid(struct vpfe_device *vpfe_dev)
u32 field_status;
field_status = isif_read(isif->isif_cfg.base_addr, MODESET);
- field_status = (field_status >> DM365_ISIF_MDFS_OFFSET) &
- DM365_ISIF_MDFS_MASK;
- return field_status;
+ return (field_status >> DM365_ISIF_MDFS_OFFSET) &
+ DM365_ISIF_MDFS_MASK;
}
static int
@@ -594,8 +593,7 @@ isif_validate_raw_params(struct vpfe_isif_raw_config *params)
ret = isif_validate_dfc_params(¶ms->dfc);
if (ret)
return ret;
- ret = isif_validate_bclamp_params(¶ms->bclamp);
- return ret;
+ return isif_validate_bclamp_params(¶ms->bclamp);
}
static int isif_set_params(struct v4l2_subdev *sd, void *params)
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-20 8:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-20 7:39 [PATCH v2 2/2] staging: media: davinci_vpfe: Merge assignment with return Rehas Sachdeva
2016-09-20 7:54 ` Rehas Sachdeva
-- strict thread matches above, loose matches on Subject: below --
2016-09-20 7:59 [PATCH v2 0/2] " Rehas Sachdeva
2016-09-20 8:00 ` [PATCH v2 2/2] staging: media: davinci_vpfe: " Rehas Sachdeva
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.