Commit e9dc2e51 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Rename bitmap_snprintf() and cpumask_snprintf() to *_scnprintf()

From: Joe Korty <joe.korty@ccur.com>

Rename bitmap_snprintf() to bitmap_scnprintf() and cpumask_snprintf() to
cpumask_scnprintf(), as these functions now belong to the scnprintf family
of functions.
parent 3aa6ed84
...@@ -252,7 +252,7 @@ static int ...@@ -252,7 +252,7 @@ static int
irq_affinity_read_proc (char *page, char **start, off_t off, irq_affinity_read_proc (char *page, char **start, off_t off,
int count, int *eof, void *data) int count, int *eof, void *data)
{ {
int len = cpumask_snprintf(page, count, irq_affinity[(long)data]); int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]);
if (count - len < 2) if (count - len < 2)
return -EINVAL; return -EINVAL;
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
...@@ -333,7 +333,7 @@ static int ...@@ -333,7 +333,7 @@ static int
prof_cpu_mask_read_proc(char *page, char **start, off_t off, prof_cpu_mask_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data) int count, int *eof, void *data)
{ {
int len = cpumask_snprintf(page, count, *(cpumask_t *)data); int len = cpumask_scnprintf(page, count, *(cpumask_t *)data);
if (count - len < 2) if (count - len < 2)
return -EINVAL; return -EINVAL;
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
......
...@@ -927,7 +927,7 @@ cpumask_t irq_affinity[NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL }; ...@@ -927,7 +927,7 @@ cpumask_t irq_affinity[NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL };
static int irq_affinity_read_proc(char *page, char **start, off_t off, static int irq_affinity_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data) int count, int *eof, void *data)
{ {
int len = cpumask_snprintf(page, count, irq_affinity[(long)data]); int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]);
if (count - len < 2) if (count - len < 2)
return -EINVAL; return -EINVAL;
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
...@@ -968,7 +968,7 @@ static int irq_affinity_write_proc(struct file *file, const char __user *buffer, ...@@ -968,7 +968,7 @@ static int irq_affinity_write_proc(struct file *file, const char __user *buffer,
static int prof_cpu_mask_read_proc (char *page, char **start, off_t off, static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
int count, int *eof, void *data) int count, int *eof, void *data)
{ {
int len = cpumask_snprintf(page, count, *(cpumask_t *)data); int len = cpumask_scnprintf(page, count, *(cpumask_t *)data);
if (count - len < 2) if (count - len < 2)
return -EINVAL; return -EINVAL;
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
......
...@@ -940,7 +940,7 @@ void set_irq_affinity_info (unsigned int irq, int hwid, int redir) ...@@ -940,7 +940,7 @@ void set_irq_affinity_info (unsigned int irq, int hwid, int redir)
static int irq_affinity_read_proc (char *page, char **start, off_t off, static int irq_affinity_read_proc (char *page, char **start, off_t off,
int count, int *eof, void *data) int count, int *eof, void *data)
{ {
int len = cpumask_snprintf(page, count, irq_affinity[(long)data]); int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]);
if (count - len < 2) if (count - len < 2)
return -EINVAL; return -EINVAL;
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
...@@ -1005,7 +1005,7 @@ static int irq_affinity_write_proc (struct file *file, const char *buffer, ...@@ -1005,7 +1005,7 @@ static int irq_affinity_write_proc (struct file *file, const char *buffer,
static int prof_cpu_mask_read_proc (char *page, char **start, off_t off, static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
int count, int *eof, void *data) int count, int *eof, void *data)
{ {
int len = cpumask_snprintf(page, count, *(cpumask_t *)data); int len = cpumask_scnprintf(page, count, *(cpumask_t *)data);
if (count - len < 2) if (count - len < 2)
return -EINVAL; return -EINVAL;
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
......
...@@ -835,7 +835,7 @@ static cpumask_t irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = ~0UL }; ...@@ -835,7 +835,7 @@ static cpumask_t irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = ~0UL };
static int irq_affinity_read_proc (char *page, char **start, off_t off, static int irq_affinity_read_proc (char *page, char **start, off_t off,
int count, int *eof, void *data) int count, int *eof, void *data)
{ {
int len = cpumask_snprintf(page, count, irq_affinity[(long)data]); int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]);
if (count - len < 2) if (count - len < 2)
return -EINVAL; return -EINVAL;
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
...@@ -873,7 +873,7 @@ static int irq_affinity_write_proc (struct file *file, const char *buffer, ...@@ -873,7 +873,7 @@ static int irq_affinity_write_proc (struct file *file, const char *buffer,
static int prof_cpu_mask_read_proc (char *page, char **start, off_t off, static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
int count, int *eof, void *data) int count, int *eof, void *data)
{ {
int len = cpumask_snprintf(page, count, *(cpumask_t *)data); int len = cpumask_scnprintf(page, count, *(cpumask_t *)data);
if (count - len < 2) if (count - len < 2)
return -EINVAL; return -EINVAL;
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
......
...@@ -575,7 +575,7 @@ cpumask_t irq_affinity [NR_IRQS]; ...@@ -575,7 +575,7 @@ cpumask_t irq_affinity [NR_IRQS];
static int irq_affinity_read_proc (char *page, char **start, off_t off, static int irq_affinity_read_proc (char *page, char **start, off_t off,
int count, int *eof, void *data) int count, int *eof, void *data)
{ {
int len = cpumask_snprintf(page, count, irq_affinity[(long)data]); int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]);
if (count - len < 2) if (count - len < 2)
return -EINVAL; return -EINVAL;
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
...@@ -616,7 +616,7 @@ static int irq_affinity_write_proc (struct file *file, const char __user *buffer ...@@ -616,7 +616,7 @@ static int irq_affinity_write_proc (struct file *file, const char __user *buffer
static int prof_cpu_mask_read_proc (char *page, char **start, off_t off, static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
int count, int *eof, void *data) int count, int *eof, void *data)
{ {
int len = cpumask_snprintf(page, count, *(cpumask_t *)data); int len = cpumask_scnprintf(page, count, *(cpumask_t *)data);
if (count - len < 2) if (count - len < 2)
return -EINVAL; return -EINVAL;
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
......
...@@ -664,7 +664,7 @@ cpumask_t irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_NONE }; ...@@ -664,7 +664,7 @@ cpumask_t irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_NONE };
static int irq_affinity_read_proc (char *page, char **start, off_t off, static int irq_affinity_read_proc (char *page, char **start, off_t off,
int count, int *eof, void *data) int count, int *eof, void *data)
{ {
int len = cpumask_snprintf(page, count, irq_affinity[(long)data]); int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]);
if (count - len < 2) if (count - len < 2)
return -EINVAL; return -EINVAL;
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
...@@ -702,7 +702,7 @@ static int irq_affinity_write_proc (struct file *file, const char *buffer, ...@@ -702,7 +702,7 @@ static int irq_affinity_write_proc (struct file *file, const char *buffer,
static int prof_cpu_mask_read_proc (char *page, char **start, off_t off, static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
int count, int *eof, void *data) int count, int *eof, void *data)
{ {
int len = cpumask_snprintf(page, count, *(cpumask_t *)data); int len = cpumask_scnprintf(page, count, *(cpumask_t *)data);
if (count - len < 2) if (count - len < 2)
return -EINVAL; return -EINVAL;
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
......
...@@ -1211,7 +1211,7 @@ static int irq_affinity_read_proc (char *page, char **start, off_t off, ...@@ -1211,7 +1211,7 @@ static int irq_affinity_read_proc (char *page, char **start, off_t off,
if (cpus_empty(mask)) if (cpus_empty(mask))
mask = cpu_online_map; mask = cpu_online_map;
len = cpumask_snprintf(page, count, mask); len = cpumask_scnprintf(page, count, mask);
if (count - len < 2) if (count - len < 2)
return -EINVAL; return -EINVAL;
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
......
...@@ -575,7 +575,7 @@ static cpumask_t irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL }; ...@@ -575,7 +575,7 @@ static cpumask_t irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL };
static int irq_affinity_read_proc (char *page, char **start, off_t off, static int irq_affinity_read_proc (char *page, char **start, off_t off,
int count, int *eof, void *data) int count, int *eof, void *data)
{ {
int len = cpumask_snprintf(page, count, irq_affinity[(long)data]); int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]);
if (count - len < 2) if (count - len < 2)
return -EINVAL; return -EINVAL;
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
...@@ -613,7 +613,7 @@ static int irq_affinity_write_proc (struct file *file, const char *buffer, ...@@ -613,7 +613,7 @@ static int irq_affinity_write_proc (struct file *file, const char *buffer,
static int prof_cpu_mask_read_proc (char *page, char **start, off_t off, static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
int count, int *eof, void *data) int count, int *eof, void *data)
{ {
int len = cpumask_snprintf(page, count, *(cpumask_t *)data); int len = cpumask_scnprintf(page, count, *(cpumask_t *)data);
if (count - len < 2) if (count - len < 2)
return -EINVAL; return -EINVAL;
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
......
...@@ -826,7 +826,7 @@ static cpumask_t irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL }; ...@@ -826,7 +826,7 @@ static cpumask_t irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL };
static int irq_affinity_read_proc (char *page, char **start, off_t off, static int irq_affinity_read_proc (char *page, char **start, off_t off,
int count, int *eof, void *data) int count, int *eof, void *data)
{ {
int len = cpumask_snprintf(page, count, irq_affinity[(long)data]); int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]);
if (count - len < 2) if (count - len < 2)
return -EINVAL; return -EINVAL;
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
...@@ -864,7 +864,7 @@ static int irq_affinity_write_proc (struct file *file, const char *buffer, ...@@ -864,7 +864,7 @@ static int irq_affinity_write_proc (struct file *file, const char *buffer,
static int prof_cpu_mask_read_proc (char *page, char **start, off_t off, static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
int count, int *eof, void *data) int count, int *eof, void *data)
{ {
int len = cpumask_snprintf(page, count, *(cpumask_t *)data); int len = cpumask_scnprintf(page, count, *(cpumask_t *)data);
if (count - len < 2) if (count - len < 2)
return -EINVAL; return -EINVAL;
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
......
...@@ -23,7 +23,7 @@ static ssize_t node_read_cpumap(struct sys_device * dev, char * buf) ...@@ -23,7 +23,7 @@ static ssize_t node_read_cpumap(struct sys_device * dev, char * buf)
/* FIXME - someone should pass us a buffer size (count) or /* FIXME - someone should pass us a buffer size (count) or
* use seq_file or something to avoid buffer overrun risk. */ * use seq_file or something to avoid buffer overrun risk. */
len = cpumask_snprintf(buf, 99 /* XXX FIXME */, mask); len = cpumask_scnprintf(buf, 99 /* XXX FIXME */, mask);
len += sprintf(buf + len, "\n"); len += sprintf(buf + len, "\n");
return len; return len;
} }
......
...@@ -55,7 +55,7 @@ static ssize_t pci_bus_show_cpuaffinity(struct class_device *class_dev, char *bu ...@@ -55,7 +55,7 @@ static ssize_t pci_bus_show_cpuaffinity(struct class_device *class_dev, char *bu
cpumask_t cpumask = pcibus_to_cpumask((to_pci_bus(class_dev))->number); cpumask_t cpumask = pcibus_to_cpumask((to_pci_bus(class_dev))->number);
int ret; int ret;
ret = cpumask_snprintf(buf, PAGE_SIZE, cpumask); ret = cpumask_scnprintf(buf, PAGE_SIZE, cpumask);
if (ret < PAGE_SIZE) if (ret < PAGE_SIZE)
buf[ret++] = '\n'; buf[ret++] = '\n';
return ret; return ret;
......
...@@ -41,7 +41,7 @@ void bitmap_and(unsigned long *dst, const unsigned long *bitmap1, ...@@ -41,7 +41,7 @@ void bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
void bitmap_or(unsigned long *dst, const unsigned long *bitmap1, void bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
const unsigned long *bitmap2, int bits); const unsigned long *bitmap2, int bits);
int bitmap_weight(const unsigned long *bitmap, int bits); int bitmap_weight(const unsigned long *bitmap, int bits);
int bitmap_snprintf(char *buf, unsigned int buflen, int bitmap_scnprintf(char *buf, unsigned int buflen,
const unsigned long *maskp, int bits); const unsigned long *maskp, int bits);
int bitmap_parse(const char __user *ubuf, unsigned int ubuflen, int bitmap_parse(const char __user *ubuf, unsigned int ubuflen,
unsigned long *maskp, int bits); unsigned long *maskp, int bits);
......
...@@ -32,8 +32,8 @@ extern cpumask_t cpu_possible_map; ...@@ -32,8 +32,8 @@ extern cpumask_t cpu_possible_map;
#define for_each_online_cpu(cpu) for (cpu = 0; cpu < 1; cpu++) #define for_each_online_cpu(cpu) for (cpu = 0; cpu < 1; cpu++)
#endif #endif
#define cpumask_snprintf(buf, buflen, map) \ #define cpumask_scnprintf(buf, buflen, map) \
bitmap_snprintf(buf, buflen, cpus_addr(map), NR_CPUS) bitmap_scnprintf(buf, buflen, cpus_addr(map), NR_CPUS)
#define cpumask_parse(buf, buflen, map) \ #define cpumask_parse(buf, buflen, map) \
bitmap_parse(buf, buflen, cpus_addr(map), NR_CPUS) bitmap_parse(buf, buflen, cpus_addr(map), NR_CPUS)
......
...@@ -165,7 +165,7 @@ EXPORT_SYMBOL(bitmap_weight); ...@@ -165,7 +165,7 @@ EXPORT_SYMBOL(bitmap_weight);
#define unhex(c) (isdigit(c) ? (c - '0') : (toupper(c) - 'A' + 10)) #define unhex(c) (isdigit(c) ? (c - '0') : (toupper(c) - 'A' + 10))
/** /**
* bitmap_snprintf - convert bitmap to an ASCII hex string. * bitmap_scnprintf - convert bitmap to an ASCII hex string.
* @buf: byte buffer into which string is placed * @buf: byte buffer into which string is placed
* @buflen: reserved size of @buf, in bytes * @buflen: reserved size of @buf, in bytes
* @maskp: pointer to bitmap to convert * @maskp: pointer to bitmap to convert
...@@ -174,7 +174,7 @@ EXPORT_SYMBOL(bitmap_weight); ...@@ -174,7 +174,7 @@ EXPORT_SYMBOL(bitmap_weight);
* Exactly @nmaskbits bits are displayed. Hex digits are grouped into * Exactly @nmaskbits bits are displayed. Hex digits are grouped into
* comma-separated sets of eight digits per set. * comma-separated sets of eight digits per set.
*/ */
int bitmap_snprintf(char *buf, unsigned int buflen, int bitmap_scnprintf(char *buf, unsigned int buflen,
const unsigned long *maskp, int nmaskbits) const unsigned long *maskp, int nmaskbits)
{ {
int i, word, bit, len = 0; int i, word, bit, len = 0;
...@@ -200,7 +200,7 @@ int bitmap_snprintf(char *buf, unsigned int buflen, ...@@ -200,7 +200,7 @@ int bitmap_snprintf(char *buf, unsigned int buflen,
} }
return len; return len;
} }
EXPORT_SYMBOL(bitmap_snprintf); EXPORT_SYMBOL(bitmap_scnprintf);
/** /**
* bitmap_parse - convert an ASCII hex string into a bitmap. * bitmap_parse - convert an ASCII hex string into a bitmap.
......
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