Commit cb78a0ce authored by Rusty Russell's avatar Rusty Russell

bitmap: fix seq_bitmap and seq_cpumask to take const pointer

Impact: cleanup

seq_bitmap just calls bitmap_scnprintf on the bits: that arg can be const.
Similarly, seq_cpumask just calls seq_bitmap.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 4b0bc0bc
...@@ -462,7 +462,8 @@ int seq_dentry(struct seq_file *m, struct dentry *dentry, char *esc) ...@@ -462,7 +462,8 @@ int seq_dentry(struct seq_file *m, struct dentry *dentry, char *esc)
return -1; return -1;
} }
int seq_bitmap(struct seq_file *m, unsigned long *bits, unsigned int nr_bits) int seq_bitmap(struct seq_file *m, const unsigned long *bits,
unsigned int nr_bits)
{ {
if (m->count < m->size) { if (m->count < m->size) {
int len = bitmap_scnprintf(m->buf + m->count, int len = bitmap_scnprintf(m->buf + m->count,
......
...@@ -50,8 +50,9 @@ int seq_path(struct seq_file *, struct path *, char *); ...@@ -50,8 +50,9 @@ int seq_path(struct seq_file *, struct path *, char *);
int seq_dentry(struct seq_file *, struct dentry *, char *); int seq_dentry(struct seq_file *, struct dentry *, char *);
int seq_path_root(struct seq_file *m, struct path *path, struct path *root, int seq_path_root(struct seq_file *m, struct path *path, struct path *root,
char *esc); char *esc);
int seq_bitmap(struct seq_file *m, unsigned long *bits, unsigned int nr_bits); int seq_bitmap(struct seq_file *m, const unsigned long *bits,
static inline int seq_cpumask(struct seq_file *m, cpumask_t *mask) unsigned int nr_bits);
static inline int seq_cpumask(struct seq_file *m, const struct cpumask *mask)
{ {
return seq_bitmap(m, mask->bits, NR_CPUS); return seq_bitmap(m, mask->bits, NR_CPUS);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment