Update seq_printf() usage in aosp patches to align
with changes from mainline commit
6798a8caaf64
"fs/seq_file: convert int seq_vprint/seq_printf/etc...
returns to void".
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
atomic_t *counter = m->private;
bytes = (unsigned int) (atomic_read(counter) + INT_MIN);
- return seq_printf(m, "%u\n", bytes);
+ seq_printf(m, "%u\n", bytes);
+ return seq_has_overflowed(m) ? -ENOSPC : 0;
}
static int uid_stat_read_atomic_int_open(struct inode *inode, struct file *file)
static int activity_stats_show(struct seq_file *m, void *v)
{
int i;
- int ret;
seq_printf(m, "Min Bucket(sec) Count\n");
for (i = 0; i < BUCKET_MAX; i++) {
- ret = seq_printf(m, "%15d %lu\n", 1 << i, activity_stats[i]);
- if (ret)
- return ret;
+ seq_printf(m, "%15d %lu\n", 1 << i, activity_stats[i]);
+ if (seq_has_overflowed(m))
+ return -ENOSPC;
}
return 0;
static int pp_stats_line(struct seq_file *m, struct tag_stat *ts_entry,
int cnt_set)
{
- int ret;
struct data_counters *cnts;
tag_t tag = ts_entry->tn.tag;
uid_t stat_uid = get_uid_from_tag(tag);
}
ppi->item_index++;
cnts = &ts_entry->counters;
- ret = seq_printf(m, "%d %s 0x%llx %u %u "
+ seq_printf(m, "%d %s 0x%llx %u %u "
"%llu %llu "
"%llu %llu "
"%llu %llu "
cnts->bpc[cnt_set][IFS_TX][IFS_UDP].packets,
cnts->bpc[cnt_set][IFS_TX][IFS_PROTO_OTHER].bytes,
cnts->bpc[cnt_set][IFS_TX][IFS_PROTO_OTHER].packets);
- return ret ?: 1;
+ return seq_has_overflowed(m) ? -ENOSPC : 1;
}
static bool pp_sets(struct seq_file *m, struct tag_stat *ts_entry)