Skip to content

Commit 152b4bb

Browse files
Simon GeisDominik Brodowski
authored andcommitted
PCMCIA/i82092: shorten the lines with over 80 characters
Split the lines with more than 80 characters in order to improve readability of the code. Co-developed-by: Lukas Panzer <[email protected]> Signed-off-by: Lukas Panzer <[email protected]> Signed-off-by: Simon Geis <[email protected]> Signed-off-by: Dominik Brodowski <[email protected]>
1 parent 9088646 commit 152b4bb

File tree

1 file changed

+53
-26
lines changed

1 file changed

+53
-26
lines changed

drivers/pcmcia/i82092.c

Lines changed: 53 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ static struct socket_info sockets[MAX_SOCKETS];
7070
static int socket_count; /* shortcut */
7171

7272

73-
static int i82092aa_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
73+
static int i82092aa_pci_probe(struct pci_dev *dev,
74+
const struct pci_device_id *id)
7475
{
7576
unsigned char configbyte;
7677
int i, ret;
@@ -81,7 +82,9 @@ static int i82092aa_pci_probe(struct pci_dev *dev, const struct pci_device_id *i
8182
if (ret)
8283
return ret;
8384

84-
pci_read_config_byte(dev, 0x40, &configbyte); /* PCI Configuration Control */
85+
/* PCI Configuration Control */
86+
pci_read_config_byte(dev, 0x40, &configbyte);
87+
8588
switch (configbyte&6) {
8689
case 0:
8790
socket_count = 2;
@@ -128,9 +131,13 @@ static int i82092aa_pci_probe(struct pci_dev *dev, const struct pci_device_id *i
128131
}
129132
}
130133

131-
/* Now, specifiy that all interrupts are to be done as PCI interrupts */
132-
configbyte = 0xFF; /* bitmask, one bit per event, 1 = PCI interrupt, 0 = ISA interrupt */
133-
pci_write_config_byte(dev, 0x50, configbyte); /* PCI Interrupt Routing Register */
134+
/* Now, specifiy that all interrupts are to be done as PCI interrupts
135+
* bitmask, one bit per event, 1 = PCI interrupt, 0 = ISA interrupt
136+
*/
137+
configbyte = 0xFF;
138+
139+
/* PCI Interrupt Routing Register */
140+
pci_write_config_byte(dev, 0x50, configbyte);
134141

135142
/* Register the interrupt handler */
136143
dev_dbg(&dev->dev, "Requesting interrupt %i\n", dev->irq);
@@ -251,7 +258,8 @@ static void indirect_setbit(int socket, unsigned short reg, unsigned char mask)
251258
}
252259

253260

254-
static void indirect_resetbit(int socket, unsigned short reg, unsigned char mask)
261+
static void indirect_resetbit(int socket,
262+
unsigned short reg, unsigned char mask)
255263
{
256264
unsigned short int port;
257265
unsigned char val;
@@ -268,7 +276,8 @@ static void indirect_resetbit(int socket, unsigned short reg, unsigned char mask
268276
spin_unlock_irqrestore(&port_lock, flags);
269277
}
270278

271-
static void indirect_write16(int socket, unsigned short reg, unsigned short value)
279+
static void indirect_write16(int socket,
280+
unsigned short reg, unsigned short value)
272281
{
273282
unsigned short int port;
274283
unsigned char val;
@@ -327,10 +336,12 @@ static irqreturn_t i82092aa_interrupt(int irq, void *dev)
327336
for (i = 0; i < socket_count; i++) {
328337
int csc;
329338

330-
if (sockets[i].card_state == 0) /* Inactive socket, should not happen */
339+
/* Inactive socket, should not happen */
340+
if (sockets[i].card_state == 0)
331341
continue;
332342

333-
csc = indirect_read(i, I365_CSC); /* card status change register */
343+
/* card status change register */
344+
csc = indirect_read(i, I365_CSC);
334345

335346
if (csc == 0) /* no events on this socket */
336347
continue;
@@ -345,12 +356,16 @@ static irqreturn_t i82092aa_interrupt(int irq, void *dev)
345356

346357
if (indirect_read(i, I365_INTCTL) & I365_PC_IOCARD) {
347358
/* For IO/CARDS, bit 0 means "read the card" */
348-
events |= (csc & I365_CSC_STSCHG) ? SS_STSCHG : 0;
359+
if (csc & I365_CSC_STSCHG)
360+
events |= SS_STSCHG;
349361
} else {
350362
/* Check for battery/ready events */
351-
events |= (csc & I365_CSC_BVD1) ? SS_BATDEAD : 0;
352-
events |= (csc & I365_CSC_BVD2) ? SS_BATWARN : 0;
353-
events |= (csc & I365_CSC_READY) ? SS_READY : 0;
363+
if (csc & I365_CSC_BVD1)
364+
events |= SS_BATDEAD;
365+
if (csc & I365_CSC_BVD2)
366+
events |= SS_BATWARN;
367+
if (csc & I365_CSC_READY)
368+
events |= SS_READY;
354369
}
355370

356371
if (events)
@@ -426,12 +441,15 @@ static int i82092aa_init(struct pcmcia_socket *sock)
426441

427442
static int i82092aa_get_status(struct pcmcia_socket *socket, u_int *value)
428443
{
429-
unsigned int sock = container_of(socket, struct socket_info, socket)->number;
444+
unsigned int sock = container_of(socket,
445+
struct socket_info, socket)->number;
430446
unsigned int status;
431447

432448
enter("i82092aa_get_status");
433-
434-
status = indirect_read(sock, I365_STATUS); /* Interface Status Register */
449+
450+
/* Interface Status Register */
451+
status = indirect_read(sock, I365_STATUS);
452+
435453
*value = 0;
436454

437455
if ((status & I365_CS_DETECT) == I365_CS_DETECT)
@@ -464,7 +482,8 @@ static int i82092aa_get_status(struct pcmcia_socket *socket, u_int *value)
464482
}
465483

466484

467-
static int i82092aa_set_socket(struct pcmcia_socket *socket, socket_state_t *state)
485+
static int i82092aa_set_socket(struct pcmcia_socket *socket,
486+
socket_state_t *state)
468487
{
469488
struct socket_info *sock_info = container_of(socket, struct socket_info,
470489
socket);
@@ -480,12 +499,15 @@ static int i82092aa_set_socket(struct pcmcia_socket *socket, socket_state_t *sta
480499
/* Values for the IGENC register */
481500

482501
reg = 0;
483-
if (!(state->flags & SS_RESET)) /* The reset bit has "inverse" logic */
502+
503+
/* The reset bit has "inverse" logic */
504+
if (!(state->flags & SS_RESET))
484505
reg = reg | I365_PC_RESET;
485506
if (state->flags & SS_IOCARD)
486507
reg = reg | I365_PC_IOCARD;
487508

488-
indirect_write(sock, I365_INTCTL, reg); /* IGENC, Interrupt and General Control Register */
509+
/* IGENC, Interrupt and General Control Register */
510+
indirect_write(sock, I365_INTCTL, reg);
489511

490512
/* Power registers */
491513

@@ -560,7 +582,9 @@ static int i82092aa_set_socket(struct pcmcia_socket *socket, socket_state_t *sta
560582

561583
}
562584

563-
/* now write the value and clear the (probably bogus) pending stuff by doing a dummy read*/
585+
/* now write the value and clear the (probably bogus) pending stuff
586+
* by doing a dummy read
587+
*/
564588

565589
indirect_write(sock, I365_CSCINT, reg);
566590
(void)indirect_read(sock, I365_CSC);
@@ -569,7 +593,8 @@ static int i82092aa_set_socket(struct pcmcia_socket *socket, socket_state_t *sta
569593
return 0;
570594
}
571595

572-
static int i82092aa_set_io_map(struct pcmcia_socket *socket, struct pccard_io_map *io)
596+
static int i82092aa_set_io_map(struct pcmcia_socket *socket,
597+
struct pccard_io_map *io)
573598
{
574599
struct socket_info *sock_info = container_of(socket, struct socket_info,
575600
socket);
@@ -585,7 +610,8 @@ static int i82092aa_set_io_map(struct pcmcia_socket *socket, struct pccard_io_ma
585610
leave("i82092aa_set_io_map with invalid map");
586611
return -EINVAL;
587612
}
588-
if ((io->start > 0xffff) || (io->stop > 0xffff) || (io->stop < io->start)) {
613+
if ((io->start > 0xffff) || (io->stop > 0xffff)
614+
|| (io->stop < io->start)) {
589615
leave("i82092aa_set_io_map with invalid io");
590616
return -EINVAL;
591617
}
@@ -613,9 +639,11 @@ static int i82092aa_set_io_map(struct pcmcia_socket *socket, struct pccard_io_ma
613639
return 0;
614640
}
615641

616-
static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_map *mem)
642+
static int i82092aa_set_mem_map(struct pcmcia_socket *socket,
643+
struct pccard_mem_map *mem)
617644
{
618-
struct socket_info *sock_info = container_of(socket, struct socket_info, socket);
645+
struct socket_info *sock_info = container_of(socket, struct socket_info,
646+
socket);
619647
unsigned int sock = sock_info->number;
620648
struct pci_bus_region region;
621649
unsigned short base, i;
@@ -636,8 +664,7 @@ static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_
636664
(mem->speed > 1000)) {
637665
leave("i82092aa_set_mem_map: invalid address / speed");
638666
dev_err(&sock_info->dev->dev,
639-
"invalid mem map for socket %i: %llx to %llx with a "
640-
"start of %x\n",
667+
"invalid mem map for socket %i: %llx to %llx with a start of %x\n",
641668
sock,
642669
(unsigned long long)region.start,
643670
(unsigned long long)region.end,

0 commit comments

Comments
 (0)