Commit 07d6f6dc authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'pcmcia-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux

Pull pcmcia updates from Dominik Brodowski:
 "A few PCMCIA odd fixes: removing a few spaces and useless casts,
  replacing snprintf() with scnprintf(), and replacing zero-length
  arrays with a flexible-array member"

* 'pcmcia-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux:
  pcmcia: remove some unused space characters
  pcmcia: soc_common.h: Replace zero-length array with flexible-array member
  pcmcia: cs_internal.h: Replace zero-length array with flexible-array member
  pcmcia: Use scnprintf() for avoiding potential buffer overflow
  pcmcia: omap: remove useless cast for driver.name
parents 7e634208 a8c122f7
...@@ -40,7 +40,7 @@ struct cis_cache_entry { ...@@ -40,7 +40,7 @@ struct cis_cache_entry {
unsigned int addr; unsigned int addr;
unsigned int len; unsigned int len;
unsigned int attr; unsigned int attr;
unsigned char cache[0]; unsigned char cache[];
}; };
struct pccard_resource_ops { struct pccard_resource_ops {
......
...@@ -329,7 +329,7 @@ static int __exit omap_cf_remove(struct platform_device *pdev) ...@@ -329,7 +329,7 @@ static int __exit omap_cf_remove(struct platform_device *pdev)
static struct platform_driver omap_cf_driver = { static struct platform_driver omap_cf_driver = {
.driver = { .driver = {
.name = (char *) driver_name, .name = driver_name,
}, },
.remove = __exit_p(omap_cf_remove), .remove = __exit_p(omap_cf_remove),
}; };
......
...@@ -1076,7 +1076,7 @@ static ssize_t show_io_db(struct device *dev, ...@@ -1076,7 +1076,7 @@ static ssize_t show_io_db(struct device *dev,
for (p = data->io_db.next; p != &data->io_db; p = p->next) { for (p = data->io_db.next; p != &data->io_db; p = p->next) {
if (ret > (PAGE_SIZE - 10)) if (ret > (PAGE_SIZE - 10))
continue; continue;
ret += snprintf(&buf[ret], (PAGE_SIZE - ret - 1), ret += scnprintf(&buf[ret], (PAGE_SIZE - ret - 1),
"0x%08lx - 0x%08lx\n", "0x%08lx - 0x%08lx\n",
((unsigned long) p->base), ((unsigned long) p->base),
((unsigned long) p->base + p->num - 1)); ((unsigned long) p->base + p->num - 1));
...@@ -1133,7 +1133,7 @@ static ssize_t show_mem_db(struct device *dev, ...@@ -1133,7 +1133,7 @@ static ssize_t show_mem_db(struct device *dev,
p = p->next) { p = p->next) {
if (ret > (PAGE_SIZE - 10)) if (ret > (PAGE_SIZE - 10))
continue; continue;
ret += snprintf(&buf[ret], (PAGE_SIZE - ret - 1), ret += scnprintf(&buf[ret], (PAGE_SIZE - ret - 1),
"0x%08lx - 0x%08lx\n", "0x%08lx - 0x%08lx\n",
((unsigned long) p->base), ((unsigned long) p->base),
((unsigned long) p->base + p->num - 1)); ((unsigned long) p->base + p->num - 1));
...@@ -1142,7 +1142,7 @@ static ssize_t show_mem_db(struct device *dev, ...@@ -1142,7 +1142,7 @@ static ssize_t show_mem_db(struct device *dev,
for (p = data->mem_db.next; p != &data->mem_db; p = p->next) { for (p = data->mem_db.next; p != &data->mem_db; p = p->next) {
if (ret > (PAGE_SIZE - 10)) if (ret > (PAGE_SIZE - 10))
continue; continue;
ret += snprintf(&buf[ret], (PAGE_SIZE - ret - 1), ret += scnprintf(&buf[ret], (PAGE_SIZE - ret - 1),
"0x%08lx - 0x%08lx\n", "0x%08lx - 0x%08lx\n",
((unsigned long) p->base), ((unsigned long) p->base),
((unsigned long) p->base + p->num - 1)); ((unsigned long) p->base + p->num - 1));
......
...@@ -88,7 +88,7 @@ struct soc_pcmcia_socket { ...@@ -88,7 +88,7 @@ struct soc_pcmcia_socket {
struct skt_dev_info { struct skt_dev_info {
int nskt; int nskt;
struct soc_pcmcia_socket skt[0]; struct soc_pcmcia_socket skt[];
}; };
struct pcmcia_state { struct pcmcia_state {
......
...@@ -180,12 +180,12 @@ static ssize_t show_yenta_registers(struct device *yentadev, struct device_attri ...@@ -180,12 +180,12 @@ static ssize_t show_yenta_registers(struct device *yentadev, struct device_attri
for (i = 0; i < 0x24; i += 4) { for (i = 0; i < 0x24; i += 4) {
unsigned val; unsigned val;
if (!(i & 15)) if (!(i & 15))
offset += snprintf(buf + offset, PAGE_SIZE - offset, "\n%02x:", i); offset += scnprintf(buf + offset, PAGE_SIZE - offset, "\n%02x:", i);
val = cb_readl(socket, i); val = cb_readl(socket, i);
offset += snprintf(buf + offset, PAGE_SIZE - offset, " %08x", val); offset += scnprintf(buf + offset, PAGE_SIZE - offset, " %08x", val);
} }
offset += snprintf(buf + offset, PAGE_SIZE - offset, "\n\nExCA registers:"); offset += scnprintf(buf + offset, PAGE_SIZE - offset, "\n\nExCA registers:");
for (i = 0; i < 0x45; i++) { for (i = 0; i < 0x45; i++) {
unsigned char val; unsigned char val;
if (!(i & 7)) { if (!(i & 7)) {
...@@ -193,10 +193,10 @@ static ssize_t show_yenta_registers(struct device *yentadev, struct device_attri ...@@ -193,10 +193,10 @@ static ssize_t show_yenta_registers(struct device *yentadev, struct device_attri
memcpy(buf + offset, " -", 2); memcpy(buf + offset, " -", 2);
offset += 2; offset += 2;
} else } else
offset += snprintf(buf + offset, PAGE_SIZE - offset, "\n%02x:", i); offset += scnprintf(buf + offset, PAGE_SIZE - offset, "\n%02x:", i);
} }
val = exca_readb(socket, i); val = exca_readb(socket, i);
offset += snprintf(buf + offset, PAGE_SIZE - offset, " %02x", val); offset += scnprintf(buf + offset, PAGE_SIZE - offset, " %02x", val);
} }
buf[offset++] = '\n'; buf[offset++] = '\n';
return offset; return offset;
......
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