Skip to content

Commit 07d6f6d

Browse files
committed
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
2 parents 7e63420 + a8c122f commit 07d6f6d

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

drivers/pcmcia/cs_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct cis_cache_entry {
4040
unsigned int addr;
4141
unsigned int len;
4242
unsigned int attr;
43-
unsigned char cache[0];
43+
unsigned char cache[];
4444
};
4545

4646
struct pccard_resource_ops {

drivers/pcmcia/omap_cf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ static int __exit omap_cf_remove(struct platform_device *pdev)
329329

330330
static struct platform_driver omap_cf_driver = {
331331
.driver = {
332-
.name = (char *) driver_name,
332+
.name = driver_name,
333333
},
334334
.remove = __exit_p(omap_cf_remove),
335335
};

drivers/pcmcia/rsrc_nonstatic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ static ssize_t show_io_db(struct device *dev,
10761076
for (p = data->io_db.next; p != &data->io_db; p = p->next) {
10771077
if (ret > (PAGE_SIZE - 10))
10781078
continue;
1079-
ret += snprintf(&buf[ret], (PAGE_SIZE - ret - 1),
1079+
ret += scnprintf(&buf[ret], (PAGE_SIZE - ret - 1),
10801080
"0x%08lx - 0x%08lx\n",
10811081
((unsigned long) p->base),
10821082
((unsigned long) p->base + p->num - 1));
@@ -1133,7 +1133,7 @@ static ssize_t show_mem_db(struct device *dev,
11331133
p = p->next) {
11341134
if (ret > (PAGE_SIZE - 10))
11351135
continue;
1136-
ret += snprintf(&buf[ret], (PAGE_SIZE - ret - 1),
1136+
ret += scnprintf(&buf[ret], (PAGE_SIZE - ret - 1),
11371137
"0x%08lx - 0x%08lx\n",
11381138
((unsigned long) p->base),
11391139
((unsigned long) p->base + p->num - 1));
@@ -1142,7 +1142,7 @@ static ssize_t show_mem_db(struct device *dev,
11421142
for (p = data->mem_db.next; p != &data->mem_db; p = p->next) {
11431143
if (ret > (PAGE_SIZE - 10))
11441144
continue;
1145-
ret += snprintf(&buf[ret], (PAGE_SIZE - ret - 1),
1145+
ret += scnprintf(&buf[ret], (PAGE_SIZE - ret - 1),
11461146
"0x%08lx - 0x%08lx\n",
11471147
((unsigned long) p->base),
11481148
((unsigned long) p->base + p->num - 1));

drivers/pcmcia/sa1100_simpad.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <asm/mach-types.h>
1515
#include <mach/simpad.h>
1616
#include "sa1100_generic.h"
17-
17+
1818
static int simpad_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
1919
{
2020

@@ -66,7 +66,7 @@ simpad_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
6666
simpad_clear_cs3_bit(VCC_3V_EN|VCC_5V_EN|EN0|EN1);
6767
break;
6868

69-
case 33:
69+
case 33:
7070
simpad_clear_cs3_bit(VCC_3V_EN|EN1);
7171
simpad_set_cs3_bit(VCC_5V_EN|EN0);
7272
break;
@@ -95,7 +95,7 @@ static void simpad_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
9595
simpad_set_cs3_bit(PCMCIA_RESET);
9696
}
9797

98-
static struct pcmcia_low_level simpad_pcmcia_ops = {
98+
static struct pcmcia_low_level simpad_pcmcia_ops = {
9999
.owner = THIS_MODULE,
100100
.hw_init = simpad_pcmcia_hw_init,
101101
.hw_shutdown = simpad_pcmcia_hw_shutdown,

drivers/pcmcia/soc_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ struct soc_pcmcia_socket {
8888

8989
struct skt_dev_info {
9090
int nskt;
91-
struct soc_pcmcia_socket skt[0];
91+
struct soc_pcmcia_socket skt[];
9292
};
9393

9494
struct pcmcia_state {

drivers/pcmcia/yenta_socket.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,23 +180,23 @@ static ssize_t show_yenta_registers(struct device *yentadev, struct device_attri
180180
for (i = 0; i < 0x24; i += 4) {
181181
unsigned val;
182182
if (!(i & 15))
183-
offset += snprintf(buf + offset, PAGE_SIZE - offset, "\n%02x:", i);
183+
offset += scnprintf(buf + offset, PAGE_SIZE - offset, "\n%02x:", i);
184184
val = cb_readl(socket, i);
185-
offset += snprintf(buf + offset, PAGE_SIZE - offset, " %08x", val);
185+
offset += scnprintf(buf + offset, PAGE_SIZE - offset, " %08x", val);
186186
}
187187

188-
offset += snprintf(buf + offset, PAGE_SIZE - offset, "\n\nExCA registers:");
188+
offset += scnprintf(buf + offset, PAGE_SIZE - offset, "\n\nExCA registers:");
189189
for (i = 0; i < 0x45; i++) {
190190
unsigned char val;
191191
if (!(i & 7)) {
192192
if (i & 8) {
193193
memcpy(buf + offset, " -", 2);
194194
offset += 2;
195195
} else
196-
offset += snprintf(buf + offset, PAGE_SIZE - offset, "\n%02x:", i);
196+
offset += scnprintf(buf + offset, PAGE_SIZE - offset, "\n%02x:", i);
197197
}
198198
val = exca_readb(socket, i);
199-
offset += snprintf(buf + offset, PAGE_SIZE - offset, " %02x", val);
199+
offset += scnprintf(buf + offset, PAGE_SIZE - offset, " %02x", val);
200200
}
201201
buf[offset++] = '\n';
202202
return offset;

0 commit comments

Comments
 (0)