Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1729426
| From | Srishti Sharma <srishtishar@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] Staging: ccree: Merge assignment with return |
| Date | 2017-09-09 12:50 +0200 |
| Message-ID | <unLuN-4gc-1@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Merge the assignment and return statements to return the value
directly. Done using coccinelle.
@@
local idexpression ret;
expression e;
@@
-ret =
+return
e;
-return ret;
Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
---
drivers/staging/ccree/ssi_sysfs.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/ccree/ssi_sysfs.c b/drivers/staging/ccree/ssi_sysfs.c
index 0655658..9fa7be0 100644
--- a/drivers/staging/ccree/ssi_sysfs.c
+++ b/drivers/staging/ccree/ssi_sysfs.c
@@ -412,7 +412,6 @@ static void sys_free_dir(struct sys_dir *sys_dir)
int ssi_sysfs_init(struct kobject *sys_dev_obj, struct ssi_drvdata *drvdata)
{
- int retval;
#if defined CC_CYCLE_COUNT
/* Init. statistics */
@@ -423,10 +422,9 @@ int ssi_sysfs_init(struct kobject *sys_dev_obj, struct ssi_drvdata *drvdata)
SSI_LOG_ERR("setup sysfs under %s\n", sys_dev_obj->name);
/* Initialize top directory */
- retval = sys_init_dir(&sys_top_dir, drvdata, sys_dev_obj, "cc_info",
+ return sys_init_dir(&sys_top_dir, drvdata, sys_dev_obj, "cc_info",
ssi_sys_top_level_attrs,
ARRAY_SIZE(ssi_sys_top_level_attrs));
- return retval;
}
void ssi_sysfs_fini(void)
--
2.7.4
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] Staging: ccree: Merge assignment with return Srishti Sharma <srishtishar@gmail.com> - 2017-09-09 12:50 +0200
Re: [Outreachy kernel] [PATCH] Staging: ccree: Merge assignment with return Julia Lawall <julia.lawall@lip6.fr> - 2017-09-09 19:00 +0200
Re: [Outreachy kernel] [PATCH] Staging: ccree: Merge assignment with return Srishti Sharma <srishtishar@gmail.com> - 2017-09-10 08:00 +0200
csiph-web