diff options
author | Joe Perches <joe@perches.com> | 2015-03-01 19:58:57 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-01 20:19:01 -0800 |
commit | 91b3a68558ba37c69f1d9e2d23e34c3cba38e356 (patch) | |
tree | 8cafb1d53f02696e16ab812d2fff35bb42cacd03 /drivers/staging/lustre/lustre/osc/lproc_osc.c | |
parent | Staging: iio: meter: ade7854-i2c: code style improvements (diff) | |
download | linux-dev-91b3a68558ba37c69f1d9e2d23e34c3cba38e356.tar.xz linux-dev-91b3a68558ba37c69f1d9e2d23e34c3cba38e356.zip |
staging: lustre: Convert uses of "int rc = seq_printf(...)"
The seq_printf return value, because it's frequently misused,
will eventually be converted to void.
See: commit 1f33c41c03da ("seq_file: Rename seq_overflow() to
seq_has_overflowed() and make public")
Convert these uses to:
seq_printf(seq, ...);
return 0;
Done via cocci script:
@@
struct seq_file *seq;
int i;
@@
- i = seq_printf(seq,
+ seq_printf(seq,
...);
...
- return i;
+ return 0;
@@
struct seq_file *seq;
int i;
@@
- i = 0;
- i += seq_printf(seq,
+ seq_printf(seq,
...);
...
- return i;
+ return 0;
With some additional reformatting and typing post conversion
to remove the now unnecessary "int i;" declaration.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/osc/lproc_osc.c')
-rw-r--r-- | drivers/staging/lustre/lustre/osc/lproc_osc.c | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c b/drivers/staging/lustre/lustre/osc/lproc_osc.c index e0eaafd93521..15a66209831c 100644 --- a/drivers/staging/lustre/lustre/osc/lproc_osc.c +++ b/drivers/staging/lustre/lustre/osc/lproc_osc.c @@ -45,12 +45,12 @@ static int osc_active_seq_show(struct seq_file *m, void *v) { struct obd_device *dev = m->private; - int rc; LPROCFS_CLIMP_CHECK(dev); - rc = seq_printf(m, "%d\n", !dev->u.cli.cl_import->imp_deactive); + seq_printf(m, "%d\n", !dev->u.cli.cl_import->imp_deactive); LPROCFS_CLIMP_EXIT(dev); - return rc; + + return 0; } static ssize_t osc_active_seq_write(struct file *file, @@ -80,12 +80,12 @@ static int osc_max_rpcs_in_flight_seq_show(struct seq_file *m, void *v) { struct obd_device *dev = m->private; struct client_obd *cli = &dev->u.cli; - int rc; client_obd_list_lock(&cli->cl_loi_list_lock); - rc = seq_printf(m, "%u\n", cli->cl_max_rpcs_in_flight); + seq_printf(m, "%u\n", cli->cl_max_rpcs_in_flight); client_obd_list_unlock(&cli->cl_loi_list_lock); - return rc; + + return 0; } static ssize_t osc_max_rpcs_in_flight_seq_write(struct file *file, @@ -165,12 +165,14 @@ static int osc_cached_mb_seq_show(struct seq_file *m, void *v) struct client_obd *cli = &dev->u.cli; int shift = 20 - PAGE_CACHE_SHIFT; - return seq_printf(m, - "used_mb: %d\n" - "busy_cnt: %d\n", - (atomic_read(&cli->cl_lru_in_list) + - atomic_read(&cli->cl_lru_busy)) >> shift, - atomic_read(&cli->cl_lru_busy)); + seq_printf(m, + "used_mb: %d\n" + "busy_cnt: %d\n", + (atomic_read(&cli->cl_lru_in_list) + + atomic_read(&cli->cl_lru_busy)) >> shift, + atomic_read(&cli->cl_lru_busy)); + + return 0; } /* shrink the number of caching pages to a specific number */ @@ -212,12 +214,12 @@ static int osc_cur_dirty_bytes_seq_show(struct seq_file *m, void *v) { struct obd_device *dev = m->private; struct client_obd *cli = &dev->u.cli; - int rc; client_obd_list_lock(&cli->cl_loi_list_lock); - rc = seq_printf(m, "%lu\n", cli->cl_dirty); + seq_printf(m, "%lu\n", cli->cl_dirty); client_obd_list_unlock(&cli->cl_loi_list_lock); - return rc; + + return 0; } LPROC_SEQ_FOPS_RO(osc_cur_dirty_bytes); @@ -225,12 +227,12 @@ static int osc_cur_grant_bytes_seq_show(struct seq_file *m, void *v) { struct obd_device *dev = m->private; struct client_obd *cli = &dev->u.cli; - int rc; client_obd_list_lock(&cli->cl_loi_list_lock); - rc = seq_printf(m, "%lu\n", cli->cl_avail_grant); + seq_printf(m, "%lu\n", cli->cl_avail_grant); client_obd_list_unlock(&cli->cl_loi_list_lock); - return rc; + + return 0; } static ssize_t osc_cur_grant_bytes_seq_write(struct file *file, @@ -271,12 +273,12 @@ static int osc_cur_lost_grant_bytes_seq_show(struct seq_file *m, void *v) { struct obd_device *dev = m->private; struct client_obd *cli = &dev->u.cli; - int rc; client_obd_list_lock(&cli->cl_loi_list_lock); - rc = seq_printf(m, "%lu\n", cli->cl_lost_grant); + seq_printf(m, "%lu\n", cli->cl_lost_grant); client_obd_list_unlock(&cli->cl_loi_list_lock); - return rc; + + return 0; } LPROC_SEQ_FOPS_RO(osc_cur_lost_grant_bytes); |