All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] Char: cyclades, remove PAUSE
@ 2007-04-04 21:44 Jiri Slaby
  2007-04-04 21:45 ` [PATCH 2/5] Char: cyclades, cy_readX/writeX cleanup Jiri Slaby
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Jiri Slaby @ 2007-04-04 21:44 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

cyclades, remove PAUSE

PAUSE expands to do {} while (0), it's useless.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>

---
commit d1ae7e494412b7d863a9aa43e3ad0aea6e48f6cd
tree 94ed673d26dbe73ad8c5a016ab0cdec3d1585afb
parent 48a0eeb5277d332a189ba64ca83188d6ada0412f
author Jiri Slaby <jirislaby@gmail.com> Mon, 26 Mar 2007 15:55:42 +0200
committer Jiri Slaby <jirislaby@gmail.com> Tue, 27 Mar 2007 14:44:21 +0200

 drivers/char/cyclades.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index 29b5375..10b9188 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -624,12 +624,6 @@
 #undef	CY_ENABLE_MONITORING
 #undef	CY_PCI_DEBUG
 
-#if 0
-#define PAUSE __asm__("nop")
-#else
-#define PAUSE do {} while (0)
-#endif
-
 /*
  * Include section 
  */
@@ -5009,7 +5003,6 @@ static int __init cy_detect_pci(void)
 				cy_writel(&((struct RUNTIME_9060 *)
 					(cy_pci_addr0))->loc_addr_base,
 					WIN_CREG);
-				PAUSE;
 				printk("Cyclades-8Zo/PCI: FPGA id %lx, ver "
 					"%lx\n", (ulong) (0xff &
 					cy_readl(&((struct CUSTOM_REG *)
@@ -5030,7 +5023,6 @@ static int __init cy_detect_pci(void)
 			   ensures that the driver will not attempt to talk to
 			   the board until it has been properly initialized.
 			 */
-			PAUSE;
 			if ((mailbox == ZO_V1) || (mailbox == ZO_V2))
 				cy_writel(cy_pci_addr2 + ID_ADDRESS, 0L);
 
@@ -5129,7 +5121,6 @@ static int __init cy_detect_pci(void)
 		printk("Cyclades-Z/PCI: New Cyclades-Z board.  FPGA not "
 				"loaded\n");
 #endif
-		PAUSE;
 		/* This must be the new Cyclades-Ze/PCI. */
 		cy_pci_nchan = ZE_V1_NPORTS;
 

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/5] Char: cyclades, cy_readX/writeX cleanup
  2007-04-04 21:44 [PATCH 1/5] Char: cyclades, remove PAUSE Jiri Slaby
@ 2007-04-04 21:45 ` Jiri Slaby
  2007-04-04 21:45 ` [PATCH 3/5] Char: cyclades, timer cleanup Jiri Slaby
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Jiri Slaby @ 2007-04-04 21:45 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

cyclades, cy_readX/writeX cleanup

- cy_readX are placeholders for readX, remove it
- move cy_writeX macros into do {} while(0) to be safe

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>

---
commit b0deeb148ea3d68519e313a08aad142aa44b0d41
tree 2de5eafa047a506a45dd6db2bb01349132b74e74
parent d1ae7e494412b7d863a9aa43e3ad0aea6e48f6cd
author Jiri Slaby <jirislaby@gmail.com> Tue, 27 Mar 2007 14:45:20 +0200
committer Jiri Slaby <jirislaby@gmail.com> Tue, 27 Mar 2007 14:45:20 +0200

 drivers/char/cyclades.c  |  315 ++++++++++++++++++++++------------------------
 include/linux/cyclades.h |   10 -
 2 files changed, 153 insertions(+), 172 deletions(-)

diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index 10b9188..fc73537 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -675,13 +675,13 @@ static void cy_send_xchar(struct tty_struct *tty, char ch);
 #define IS_CYC_Z(card) ((card).num_chips == -1)
 
 #define Z_FPGA_CHECK(card) \
-	((cy_readl(&((struct RUNTIME_9060 __iomem *) \
+	((readl(&((struct RUNTIME_9060 __iomem *) \
 		((card).ctl_addr))->init_ctrl) & (1<<17)) != 0)
 
-#define ISZLOADED(card)	(((ZO_V1==cy_readl(&((struct RUNTIME_9060 __iomem *) \
+#define ISZLOADED(card)	(((ZO_V1==readl(&((struct RUNTIME_9060 __iomem *) \
 			((card).ctl_addr))->mail_box_0)) || \
 			Z_FPGA_CHECK(card)) && \
-			(ZFIRM_ID==cy_readl(&((struct FIRM_ID __iomem *) \
+			(ZFIRM_ID==readl(&((struct FIRM_ID __iomem *) \
 			((card).base_addr+ID_ADDRESS))->signature)))
 
 #ifndef SERIAL_XMIT_SIZE
@@ -972,7 +972,7 @@ static int cyy_issue_cmd(void __iomem * base_addr, u_char cmd, int index)
 
 	/* Check to see that the previous command has completed */
 	for (i = 0; i < 100; i++) {
-		if (cy_readb(base_addr + (CyCCR << index)) == 0) {
+		if (readb(base_addr + (CyCCR << index)) == 0) {
 			break;
 		}
 		udelay(10L);
@@ -1015,7 +1015,7 @@ static unsigned detect_isa_irq(void __iomem * address)
 
 	cy_writeb(address + (CyCAR << index), 0);
 	cy_writeb(address + (CySRER << index),
-		  cy_readb(address + (CySRER << index)) | CyTxRdy);
+		  readb(address + (CySRER << index)) | CyTxRdy);
 	local_irq_restore(flags);
 
 	/* Wait ... */
@@ -1025,11 +1025,11 @@ static unsigned detect_isa_irq(void __iomem * address)
 	irq = probe_irq_off(irqs);
 
 	/* Clean up */
-	save_xir = (u_char) cy_readb(address + (CyTIR << index));
-	save_car = cy_readb(address + (CyCAR << index));
+	save_xir = (u_char) readb(address + (CyTIR << index));
+	save_car = readb(address + (CyCAR << index));
 	cy_writeb(address + (CyCAR << index), (save_xir & 0x3));
 	cy_writeb(address + (CySRER << index),
-		  cy_readb(address + (CySRER << index)) & ~CyTxRdy);
+		  readb(address + (CySRER << index)) & ~CyTxRdy);
 	cy_writeb(address + (CyTIR << index), (save_xir & 0x3f));
 	cy_writeb(address + (CyCAR << index), (save_car));
 	cy_writeb(address + (Cy_ClrIntr << index), 0);
@@ -1055,34 +1055,34 @@ static void cyy_intr_chip(struct cyclades_card *cinfo, int chip,
 #endif
 		/* determine the channel & change to that context */
 		spin_lock(&cinfo->card_lock);
-		save_xir = (u_char) cy_readb(base_addr + (CyRIR << index));
+		save_xir = (u_char) readb(base_addr + (CyRIR << index));
 		channel = (u_short) (save_xir & CyIRChannel);
 		i = channel + chip * 4 + cinfo->first_line;
 		info = &cy_port[i];
 		info->last_active = jiffies;
-		save_car = cy_readb(base_addr + (CyCAR << index));
+		save_car = readb(base_addr + (CyCAR << index));
 		cy_writeb(base_addr + (CyCAR << index), save_xir);
 
 		/* if there is nowhere to put the data, discard it */
 		if (info->tty == 0) {
-			j = (cy_readb(base_addr + (CyRIVR << index)) &
+			j = (readb(base_addr + (CyRIVR << index)) &
 				CyIVRMask);
 			if (j == CyIVRRxEx) {	/* exception */
-				data = cy_readb(base_addr + (CyRDSR << index));
+				data = readb(base_addr + (CyRDSR << index));
 			} else {	/* normal character reception */
-				char_count = cy_readb(base_addr +
+				char_count = readb(base_addr +
 						(CyRDCR << index));
 				while (char_count--) {
-					data = cy_readb(base_addr +
+					data = readb(base_addr +
 						(CyRDSR << index));
 				}
 			}
 		} else {	/* there is an open port for this data */
 			tty = info->tty;
-			j = (cy_readb(base_addr + (CyRIVR << index)) &
+			j = (readb(base_addr + (CyRIVR << index)) &
 					CyIVRMask);
 			if (j == CyIVRRxEx) {	/* exception */
-				data = cy_readb(base_addr + (CyRDSR << index));
+				data = readb(base_addr + (CyRDSR << index));
 
 				/* For statistics only */
 				if (data & CyBREAK)
@@ -1103,7 +1103,7 @@ static void cyy_intr_chip(struct cyclades_card *cinfo, int chip,
 						if (data & CyBREAK) {
 							tty_insert_flip_char(
 								tty,
-								cy_readb(
+								readb(
 								base_addr +
 								(CyRDSR <<
 									index)),
@@ -1116,7 +1116,7 @@ static void cyy_intr_chip(struct cyclades_card *cinfo, int chip,
 						} else if (data & CyFRAME) {
 							tty_insert_flip_char(
 								tty,
-								cy_readb(
+								readb(
 								base_addr +
 								(CyRDSR <<
 									index)),
@@ -1128,7 +1128,7 @@ static void cyy_intr_chip(struct cyclades_card *cinfo, int chip,
 							/* Pieces of seven... */
 							tty_insert_flip_char(
 								tty,
-								cy_readb(
+								readb(
 								base_addr +
 								(CyRDSR <<
 									index)),
@@ -1147,7 +1147,7 @@ static void cyy_intr_chip(struct cyclades_card *cinfo, int chip,
 						 */
 							tty_insert_flip_char(
 								tty,
-								cy_readb(
+								readb(
 								base_addr +
 								(CyRDSR <<
 									index)),
@@ -1179,7 +1179,7 @@ static void cyy_intr_chip(struct cyclades_card *cinfo, int chip,
 				}
 			} else {	/* normal character reception */
 				/* load # chars available from the chip */
-				char_count = cy_readb(base_addr +
+				char_count = readb(base_addr +
 						(CyRDCR << index));
 
 #ifdef CY_ENABLE_MONITORING
@@ -1191,7 +1191,7 @@ static void cyy_intr_chip(struct cyclades_card *cinfo, int chip,
 #endif
 				len = tty_buffer_request_room(tty, char_count);
 				while (len--) {
-					data = cy_readb(base_addr +
+					data = readb(base_addr +
 							(CyRDSR << index));
 					tty_insert_flip_char(tty, data,
 							TTY_NORMAL);
@@ -1221,16 +1221,16 @@ static void cyy_intr_chip(struct cyclades_card *cinfo, int chip,
 
 		/* determine the channel & change to that context */
 		spin_lock(&cinfo->card_lock);
-		save_xir = (u_char) cy_readb(base_addr + (CyTIR << index));
+		save_xir = (u_char) readb(base_addr + (CyTIR << index));
 		channel = (u_short) (save_xir & CyIRChannel);
 		i = channel + chip * 4 + cinfo->first_line;
-		save_car = cy_readb(base_addr + (CyCAR << index));
+		save_car = readb(base_addr + (CyCAR << index));
 		cy_writeb(base_addr + (CyCAR << index), save_xir);
 
 		/* validate the port# (as configured and open) */
 		if ((i < 0) || (NR_PORTS <= i)) {
 			cy_writeb(base_addr + (CySRER << index),
-				  cy_readb(base_addr + (CySRER << index)) &
+				  readb(base_addr + (CySRER << index)) &
 				  ~CyTxRdy);
 			goto txend;
 		}
@@ -1238,7 +1238,7 @@ static void cyy_intr_chip(struct cyclades_card *cinfo, int chip,
 		info->last_active = jiffies;
 		if (info->tty == 0) {
 			cy_writeb(base_addr + (CySRER << index),
-				  cy_readb(base_addr + (CySRER << index)) &
+				  readb(base_addr + (CySRER << index)) &
 				  ~CyTxRdy);
 			goto txdone;
 		}
@@ -1271,15 +1271,15 @@ static void cyy_intr_chip(struct cyclades_card *cinfo, int chip,
 
 		while (char_count-- > 0) {
 			if (!info->xmit_cnt) {
-				if (cy_readb(base_addr + (CySRER << index)) &
+				if (readb(base_addr + (CySRER << index)) &
 						CyTxMpty) {
 					cy_writeb(base_addr + (CySRER << index),
-						cy_readb(base_addr +
+						readb(base_addr +
 							(CySRER << index)) &
 						~CyTxMpty);
 				} else {
 					cy_writeb(base_addr + (CySRER << index),
-						(cy_readb(base_addr +
+						(readb(base_addr +
 						  	(CySRER << index)) &
 						~CyTxRdy) | CyTxMpty);
 				}
@@ -1287,13 +1287,13 @@ static void cyy_intr_chip(struct cyclades_card *cinfo, int chip,
 			}
 			if (info->xmit_buf == 0) {
 				cy_writeb(base_addr + (CySRER << index),
-					cy_readb(base_addr + (CySRER << index))&
+					readb(base_addr + (CySRER << index)) &
 					~CyTxRdy);
 				goto txdone;
 			}
 			if (info->tty->stopped || info->tty->hw_stopped) {
 				cy_writeb(base_addr + (CySRER << index),
-					cy_readb(base_addr + (CySRER << index))&
+					readb(base_addr + (CySRER << index)) &
 					~CyTxRdy);
 				goto txdone;
 			}
@@ -1346,15 +1346,15 @@ txend:
 
 		/* determine the channel & change to that context */
 		spin_lock(&cinfo->card_lock);
-		save_xir = (u_char) cy_readb(base_addr + (CyMIR << index));
+		save_xir = (u_char) readb(base_addr + (CyMIR << index));
 		channel = (u_short) (save_xir & CyIRChannel);
 		info = &cy_port[channel + chip * 4 + cinfo->first_line];
 		info->last_active = jiffies;
-		save_car = cy_readb(base_addr + (CyCAR << index));
+		save_car = readb(base_addr + (CyCAR << index));
 		cy_writeb(base_addr + (CyCAR << index), save_xir);
 
-		mdm_change = cy_readb(base_addr + (CyMISR << index));
-		mdm_status = cy_readb(base_addr + (CyMSVR1 << index));
+		mdm_change = readb(base_addr + (CyMISR << index));
+		mdm_status = readb(base_addr + (CyMSVR1 << index));
 
 		if (info->tty == 0) {	/* no place for data, ignore it */
 			;
@@ -1391,7 +1391,7 @@ txend:
 						info->tty->hw_stopped = 0;
 						cy_writeb(base_addr +
 							(CySRER << index),
-							cy_readb(base_addr +
+							readb(base_addr +
 								(CySRER <<
 									index))|
 							CyTxRdy);
@@ -1405,7 +1405,7 @@ txend:
 						info->tty->hw_stopped = 1;
 						cy_writeb(base_addr +
 							(CySRER << index),
-							cy_readb(base_addr +
+							readb(base_addr +
 								(CySRER <<
 								index)) &
 							~CyTxRdy);
@@ -1459,7 +1459,7 @@ static irqreturn_t cyy_interrupt(int irq, void *dev_id)
 			base_addr = cinfo->base_addr +
 					(cy_chip_offset[chip] << index);
 			too_many = 0;
-			while ((status = cy_readb(base_addr +
+			while ((status = readb(base_addr +
 						(CySVRR << index))) != 0x00) {
 				had_work++;
 			/* The purpose of the following test is to ensure that
@@ -1502,16 +1502,15 @@ cyz_fetch_msg(struct cyclades_card *cinfo,
 	if (!ISZLOADED(*cinfo)) {
 		return -1;
 	}
-	zfw_ctrl = cinfo->base_addr + (cy_readl(&firm_id->zfwctrl_addr) &
-			0xfffff);
+	zfw_ctrl = cinfo->base_addr + (readl(&firm_id->zfwctrl_addr) & 0xfffff);
 	board_ctrl = &zfw_ctrl->board_ctrl;
 
-	loc_doorbell = cy_readl(&((struct RUNTIME_9060 __iomem *)
+	loc_doorbell = readl(&((struct RUNTIME_9060 __iomem *)
 				  (cinfo->ctl_addr))->loc_doorbell);
 	if (loc_doorbell) {
 		*cmd = (char)(0xff & loc_doorbell);
-		*channel = cy_readl(&board_ctrl->fwcmd_channel);
-		*param = (__u32) cy_readl(&board_ctrl->fwcmd_param);
+		*channel = readl(&board_ctrl->fwcmd_channel);
+		*param = (__u32) readl(&board_ctrl->fwcmd_param);
 		cy_writel(&((struct RUNTIME_9060 __iomem *)(cinfo->ctl_addr))->
 			  loc_doorbell, 0xffffffff);
 		return 1;
@@ -1533,16 +1532,15 @@ cyz_issue_cmd(struct cyclades_card *cinfo,
 	if (!ISZLOADED(*cinfo)) {
 		return -1;
 	}
-	zfw_ctrl = cinfo->base_addr + (cy_readl(&firm_id->zfwctrl_addr) &
-			0xfffff);
+	zfw_ctrl = cinfo->base_addr + (readl(&firm_id->zfwctrl_addr) & 0xfffff);
 	board_ctrl = &zfw_ctrl->board_ctrl;
 
 	index = 0;
 	pci_doorbell =
 	    &((struct RUNTIME_9060 __iomem *)(cinfo->ctl_addr))->pci_doorbell;
-	while ((cy_readl(pci_doorbell) & 0xff) != 0) {
+	while ((readl(pci_doorbell) & 0xff) != 0) {
 		if (index++ == 1000) {
-			return (int)(cy_readl(pci_doorbell) & 0xff);
+			return (int)(readl(pci_doorbell) & 0xff);
 		}
 		udelay(50L);
 	}
@@ -1569,10 +1567,10 @@ cyz_handle_rx(struct cyclades_port *info,
 #endif
 	volatile __u32 rx_put, rx_get, new_rx_get, rx_bufsize, rx_bufaddr;
 
-	rx_get = new_rx_get = cy_readl(&buf_ctrl->rx_get);
-	rx_put = cy_readl(&buf_ctrl->rx_put);
-	rx_bufsize = cy_readl(&buf_ctrl->rx_bufsize);
-	rx_bufaddr = cy_readl(&buf_ctrl->rx_bufaddr);
+	rx_get = new_rx_get = readl(&buf_ctrl->rx_get);
+	rx_put = readl(&buf_ctrl->rx_put);
+	rx_bufsize = readl(&buf_ctrl->rx_bufsize);
+	rx_bufaddr = readl(&buf_ctrl->rx_bufaddr);
 	if (rx_put >= rx_get)
 		char_count = rx_put - rx_get;
 	else
@@ -1622,7 +1620,7 @@ cyz_handle_rx(struct cyclades_port *info,
 #else
 			len = tty_buffer_request_room(tty, char_count);
 			while (len--) {
-				data = cy_readb(cinfo->base_addr + rx_bufaddr +
+				data = readb(cinfo->base_addr + rx_bufaddr +
 						new_rx_get);
 				new_rx_get = (new_rx_get + 1)& (rx_bufsize - 1);
 				tty_insert_flip_char(tty, data, TTY_NORMAL);
@@ -1633,13 +1631,12 @@ cyz_handle_rx(struct cyclades_port *info,
 #ifdef CONFIG_CYZ_INTR
 		/* Recalculate the number of chars in the RX buffer and issue
 		   a cmd in case it's higher than the RX high water mark */
-			rx_put = cy_readl(&buf_ctrl->rx_put);
+			rx_put = readl(&buf_ctrl->rx_put);
 			if (rx_put >= rx_get)
 				char_count = rx_put - rx_get;
 			else
 				char_count = rx_put - rx_get + rx_bufsize;
-			if (char_count >= (int)cy_readl(&buf_ctrl->
-					rx_threshold)) {
+			if (char_count >= (int)readl(&buf_ctrl->rx_threshold)) {
 				cy_sched_event(info, Cy_EVENT_Z_RX_FULL);
 			}
 #endif
@@ -1668,10 +1665,10 @@ cyz_handle_tx(struct cyclades_port *info,
 	if (info->xmit_cnt <= 0)	/* Nothing to transmit */
 		return;
 
-	tx_get = cy_readl(&buf_ctrl->tx_get);
-	tx_put = cy_readl(&buf_ctrl->tx_put);
-	tx_bufsize = cy_readl(&buf_ctrl->tx_bufsize);
-	tx_bufaddr = cy_readl(&buf_ctrl->tx_bufaddr);
+	tx_get = readl(&buf_ctrl->tx_get);
+	tx_put = readl(&buf_ctrl->tx_put);
+	tx_bufsize = readl(&buf_ctrl->tx_bufsize);
+	tx_bufaddr = readl(&buf_ctrl->tx_bufaddr);
 	if (tx_put >= tx_get)
 		char_count = tx_get - tx_put - 1 + tx_bufsize;
 	else
@@ -1756,11 +1753,10 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo)
 	int delta_count;
 
 	firm_id = cinfo->base_addr + ID_ADDRESS;
-	zfw_ctrl = cinfo->base_addr + (cy_readl(&firm_id->zfwctrl_addr) &
-			0xfffff);
+	zfw_ctrl = cinfo->base_addr + (readl(&firm_id->zfwctrl_addr) & 0xfffff);
 	board_ctrl = &zfw_ctrl->board_ctrl;
-	fw_ver = cy_readl(&board_ctrl->fw_version);
-	hw_ver = cy_readl(&((struct RUNTIME_9060 __iomem *)(cinfo->ctl_addr))->
+	fw_ver = readl(&board_ctrl->fw_version);
+	hw_ver = readl(&((struct RUNTIME_9060 __iomem *)(cinfo->ctl_addr))->
 			mail_box_0);
 
 	while (cyz_fetch_msg(cinfo, &channel, &cmd, &param) == 1) {
@@ -1794,7 +1790,7 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo)
 			delta_count++;
 			if (info->flags & ASYNC_CHECK_CD) {
 				if ((fw_ver > 241 ? ((u_long) param) :
-						cy_readl(&ch_ctrl->rs_status)) &
+						readl(&ch_ctrl->rs_status)) &
 						C_RS_DCD) {
 					cy_sched_event(info,
 						 	Cy_EVENT_OPEN_WAKEUP);
@@ -1923,12 +1919,12 @@ static void cyz_poll(unsigned long arg)
 
 		firm_id = cinfo->base_addr + ID_ADDRESS;
 		zfw_ctrl = cinfo->base_addr +
-				(cy_readl(&firm_id->zfwctrl_addr) & 0xfffff);
+				(readl(&firm_id->zfwctrl_addr) & 0xfffff);
 		board_ctrl = &(zfw_ctrl->board_ctrl);
 
 	/* Skip first polling cycle to avoid racing conditions with the FW */
 		if (!cinfo->intr_enabled) {
-			cinfo->nports = (int)cy_readl(&board_ctrl->n_channel);
+			cinfo->nports = (int)readl(&board_ctrl->n_channel);
 			cinfo->intr_enabled = 1;
 			continue;
 		}
@@ -2029,12 +2025,12 @@ static int startup(struct cyclades_port *info)
 #ifdef CY_DEBUG_DTR
 		printk("cyc:startup raising DTR\n");
 		printk("     status: 0x%x, 0x%x\n",
-			cy_readb(base_addr + (CyMSVR1 << index)),
-			cy_readb(base_addr + (CyMSVR2 << index)));
+			readb(base_addr + (CyMSVR1 << index)),
+			readb(base_addr + (CyMSVR2 << index)));
 #endif
 
 		cy_writeb(base_addr + (CySRER << index),
-			cy_readb(base_addr + (CySRER << index)) | CyRxData);
+			readb(base_addr + (CySRER << index)) | CyRxData);
 		info->flags |= ASYNC_INITIALIZED;
 
 		if (info->tty) {
@@ -2064,7 +2060,7 @@ static int startup(struct cyclades_port *info)
 		}
 
 		zfw_ctrl = cy_card[card].base_addr +
-				(cy_readl(&firm_id->zfwctrl_addr) & 0xfffff);
+				(readl(&firm_id->zfwctrl_addr) & 0xfffff);
 		board_ctrl = &zfw_ctrl->board_ctrl;
 		ch_ctrl = zfw_ctrl->ch_ctrl;
 
@@ -2112,7 +2108,7 @@ static int startup(struct cyclades_port *info)
 		/* set timeout !!! */
 		/* set RTS and DTR !!! */
 		cy_writel(&ch_ctrl[channel].rs_control,
-			cy_readl(&ch_ctrl[channel].rs_control) | C_RS_RTS |
+			readl(&ch_ctrl[channel].rs_control) | C_RS_RTS |
 			C_RS_DTR);
 		retval = cyz_issue_cmd(&cy_card[info->card], channel,
 				C_CM_IOCTLM, 0L);
@@ -2168,7 +2164,7 @@ static void start_xmit(struct cyclades_port *info)
 		CY_LOCK(info, flags);
 		cy_writeb(base_addr + (CyCAR << index), channel);
 		cy_writeb(base_addr + (CySRER << index),
-			cy_readb(base_addr + (CySRER << index)) | CyTxRdy);
+			readb(base_addr + (CySRER << index)) | CyTxRdy);
 		CY_UNLOCK(info, flags);
 	} else {
 #ifdef CONFIG_CYZ_INTR
@@ -2235,8 +2231,8 @@ static void shutdown(struct cyclades_port *info)
 #ifdef CY_DEBUG_DTR
 			printk("cyc shutdown dropping DTR\n");
 			printk("     status: 0x%x, 0x%x\n",
-				cy_readb(base_addr + (CyMSVR1 << index)),
-				cy_readb(base_addr + (CyMSVR2 << index)));
+				readb(base_addr + (CyMSVR1 << index)),
+				readb(base_addr + (CyMSVR2 << index)));
 #endif
 		}
 		cyy_issue_cmd(base_addr, CyCHAN_CTL | CyDIS_RCVR, index);
@@ -2267,7 +2263,7 @@ static void shutdown(struct cyclades_port *info)
 		}
 
 		zfw_ctrl = cy_card[card].base_addr +
-				(cy_readl(&firm_id->zfwctrl_addr) & 0xfffff);
+				(readl(&firm_id->zfwctrl_addr) & 0xfffff);
 		board_ctrl = &zfw_ctrl->board_ctrl;
 		ch_ctrl = zfw_ctrl->ch_ctrl;
 
@@ -2282,7 +2278,7 @@ static void shutdown(struct cyclades_port *info)
 
 		if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) {
 			cy_writel(&ch_ctrl[channel].rs_control,
-				(__u32)(cy_readl(&ch_ctrl[channel].rs_control)&
+				(__u32)(readl(&ch_ctrl[channel].rs_control) &
 					~(C_RS_RTS | C_RS_DTR)));
 			retval = cyz_issue_cmd(&cy_card[info->card], channel,
 					C_CM_IOCTLM, 0L);
@@ -2390,10 +2386,8 @@ block_til_ready(struct tty_struct *tty, struct file *filp,
 #ifdef CY_DEBUG_DTR
 				printk("cyc:block_til_ready raising DTR\n");
 				printk("     status: 0x%x, 0x%x\n",
-					cy_readb(base_addr +
-						(CyMSVR1 << index)),
-					cy_readb(base_addr +
-						(CyMSVR2 << index)));
+					readb(base_addr + (CyMSVR1 << index)),
+					readb(base_addr + (CyMSVR2 << index)));
 #endif
 			}
 			CY_UNLOCK(info, flags);
@@ -2410,7 +2404,7 @@ block_til_ready(struct tty_struct *tty, struct file *filp,
 			cy_writeb(base_addr + (CyCAR << index),
 				  (u_char) channel);
 			if (!(info->flags & ASYNC_CLOSING) && (C_CLOCAL(tty) ||
-					(cy_readb(base_addr +
+					(readb(base_addr +
 						(CyMSVR1 << index)) & CyDCD))) {
 				CY_UNLOCK(info, flags);
 				break;
@@ -2444,19 +2438,17 @@ block_til_ready(struct tty_struct *tty, struct file *filp,
 			return -EINVAL;
 		}
 
-		zfw_ctrl = base_addr + (cy_readl(&firm_id->zfwctrl_addr) &
-				0xfffff);
+		zfw_ctrl = base_addr + (readl(&firm_id->zfwctrl_addr)& 0xfffff);
 		board_ctrl = &zfw_ctrl->board_ctrl;
 		ch_ctrl = zfw_ctrl->ch_ctrl;
 
 		while (1) {
 			if ((tty->termios->c_cflag & CBAUD)) {
 				cy_writel(&ch_ctrl[channel].rs_control,
-					  cy_readl(&ch_ctrl[channel].
-						   rs_control) | (C_RS_RTS |
-								  C_RS_DTR));
+					readl(&ch_ctrl[channel].rs_control) |
+					C_RS_RTS | C_RS_DTR);
 				retval = cyz_issue_cmd(&cy_card[info->card],
-						channel, C_CM_IOCTLM, 0L);
+					channel, C_CM_IOCTLM, 0L);
 				if (retval != 0) {
 					printk("cyc:block_til_ready retval on "
 						"ttyC%d was %x\n",
@@ -2475,7 +2467,7 @@ block_til_ready(struct tty_struct *tty, struct file *filp,
 				break;
 			}
 			if (!(info->flags & ASYNC_CLOSING) && (C_CLOCAL(tty) ||
-					(cy_readl(&ch_ctrl[channel].rs_status) &
+					(readl(&ch_ctrl[channel].rs_status) &
 						C_RS_DCD))) {
 				break;
 			}
@@ -2540,11 +2532,10 @@ static int cy_open(struct tty_struct *tty, struct file *filp)
 		struct FIRM_ID __iomem *firm_id = cinfo->base_addr + ID_ADDRESS;
 
 		if (!ISZLOADED(*cinfo)) {
-			if (((ZE_V1 == cy_readl(
-					&((struct RUNTIME_9060 __iomem *)
+			if (((ZE_V1 == readl(&((struct RUNTIME_9060 __iomem *)
 					 (cinfo->ctl_addr))->mail_box_0)) &&
 					Z_FPGA_CHECK(*cinfo)) &&
-					(ZFIRM_HLT == cy_readl(
+					(ZFIRM_HLT == readl(
 						&firm_id->signature))) {
 				printk("cyc:Cyclades-Z Error: you need an "
 					"external power supply for this number "
@@ -2565,15 +2556,14 @@ static int cy_open(struct tty_struct *tty, struct file *filp)
 				struct BOARD_CTRL __iomem *board_ctrl;
 
 				zfw_ctrl = cinfo->base_addr +
-					(cy_readl(&firm_id->zfwctrl_addr) &
-						0xfffff);
+					(readl(&firm_id->zfwctrl_addr) &
+					 0xfffff);
 
 				board_ctrl = &zfw_ctrl->board_ctrl;
 
 				/* Enable interrupts on the PLX chip */
 				cy_writew(cinfo->ctl_addr + 0x68,
-					  cy_readw(cinfo->ctl_addr +
-						   0x68) | 0x0900);
+					readw(cinfo->ctl_addr + 0x68) | 0x0900);
 				/* Enable interrupts on the FW */
 				retval = cyz_issue_cmd(cinfo, 0,
 						C_CM_IRQ_ENBL, 0L);
@@ -2582,7 +2572,7 @@ static int cy_open(struct tty_struct *tty, struct file *filp)
 						retval);
 				}
 				cinfo->nports =
-					(int)cy_readl(&board_ctrl->n_channel);
+					(int)readl(&board_ctrl->n_channel);
 				cinfo->intr_enabled = 1;
 			}
 		}
@@ -2701,7 +2691,7 @@ static void cy_wait_until_sent(struct tty_struct *tty, int timeout)
 		index = cy_card[card].bus_index;
 		base_addr =
 		    cy_card[card].base_addr + (cy_chip_offset[chip] << index);
-		while (cy_readb(base_addr + (CySRER << index)) & CyTxRdy) {
+		while (readb(base_addr + (CySRER << index)) & CyTxRdy) {
 #ifdef CY_DEBUG_WAIT_UNTIL_SENT
 			printk("Not clean (jiff=%lu)...", jiffies);
 #endif
@@ -2794,7 +2784,7 @@ static void cy_close(struct tty_struct *tty, struct file *filp)
 		channel &= 0x03;
 		cy_writeb(base_addr + (CyCAR << index), (u_char) channel);
 		cy_writeb(base_addr + (CySRER << index),
-			  cy_readb(base_addr + (CySRER << index)) & ~CyRxData);
+			  readb(base_addr + (CySRER << index)) & ~CyRxData);
 		if (info->flags & ASYNC_INITIALIZED) {
 			/* Waiting for on-board buffers to be empty before closing
 			   the port */
@@ -2808,12 +2798,12 @@ static void cy_close(struct tty_struct *tty, struct file *filp)
 		void __iomem *base_addr = cy_card[info->card].base_addr;
 		struct FIRM_ID __iomem *firm_id = base_addr + ID_ADDRESS;
 		struct ZFW_CTRL __iomem *zfw_ctrl =
-		    base_addr + (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff);
+		    base_addr + (readl(&firm_id->zfwctrl_addr) & 0xfffff);
 		struct CH_CTRL __iomem *ch_ctrl = zfw_ctrl->ch_ctrl;
 		int channel = info->line - cy_card[info->card].first_line;
 		int retval;
 
-		if (cy_readl(&ch_ctrl[channel].flow_status) != C_FS_TXIDLE) {
+		if (readl(&ch_ctrl[channel].flow_status) != C_FS_TXIDLE) {
 			retval = cyz_issue_cmd(&cy_card[info->card], channel,
 						C_CM_IOCTLW, 0L);
 			if (retval != 0) {
@@ -3023,13 +3013,13 @@ static int cy_chars_in_buffer(struct tty_struct *tty)
 
 		firm_id = cy_card[card].base_addr + ID_ADDRESS;
 		zfw_ctrl = cy_card[card].base_addr +
-			(cy_readl(&firm_id->zfwctrl_addr) & 0xfffff);
+			(readl(&firm_id->zfwctrl_addr) & 0xfffff);
 		ch_ctrl = &(zfw_ctrl->ch_ctrl[channel]);
 		buf_ctrl = &(zfw_ctrl->buf_ctrl[channel]);
 
-		tx_get = cy_readl(&buf_ctrl->tx_get);
-		tx_put = cy_readl(&buf_ctrl->tx_put);
-		tx_bufsize = cy_readl(&buf_ctrl->tx_bufsize);
+		tx_get = readl(&buf_ctrl->tx_get);
+		tx_put = readl(&buf_ctrl->tx_put);
+		tx_bufsize = readl(&buf_ctrl->tx_bufsize);
 		if (tx_put >= tx_get)
 			char_count = tx_put - tx_get;
 		else
@@ -3269,8 +3259,7 @@ static void set_line_char(struct cyclades_port *info)
 		if (C_CLOCAL(info->tty)) {
 			/* without modem intr */
 			cy_writeb(base_addr + (CySRER << index),
-				  cy_readb(base_addr +
-					   (CySRER << index)) | CyMdmCh);
+				readb(base_addr + (CySRER << index)) | CyMdmCh);
 			/* act on 1->0 modem transitions */
 			if ((cflag & CRTSCTS) && info->rflow) {
 				cy_writeb(base_addr + (CyMCOR1 << index),
@@ -3284,7 +3273,7 @@ static void set_line_char(struct cyclades_port *info)
 		} else {
 			/* without modem intr */
 			cy_writeb(base_addr + (CySRER << index),
-				  cy_readb(base_addr +
+				  readb(base_addr +
 					   (CySRER << index)) | CyMdmCh);
 			/* act on 1->0 modem transitions */
 			if ((cflag & CRTSCTS) && info->rflow) {
@@ -3311,8 +3300,8 @@ static void set_line_char(struct cyclades_port *info)
 #ifdef CY_DEBUG_DTR
 			printk("cyc:set_line_char dropping DTR\n");
 			printk("     status: 0x%x, 0x%x\n",
-				cy_readb(base_addr + (CyMSVR1 << index)),
-				cy_readb(base_addr + (CyMSVR2 << index)));
+				readb(base_addr + (CyMSVR1 << index)),
+				readb(base_addr + (CyMSVR2 << index)));
 #endif
 		} else {
 			if (info->rtsdtr_inv) {
@@ -3325,8 +3314,8 @@ static void set_line_char(struct cyclades_port *info)
 #ifdef CY_DEBUG_DTR
 			printk("cyc:set_line_char raising DTR\n");
 			printk("     status: 0x%x, 0x%x\n",
-				cy_readb(base_addr + (CyMSVR1 << index)),
-				cy_readb(base_addr + (CyMSVR2 << index)));
+				readb(base_addr + (CyMSVR1 << index)),
+				readb(base_addr + (CyMSVR2 << index)));
 #endif
 		}
 
@@ -3350,7 +3339,7 @@ static void set_line_char(struct cyclades_port *info)
 		}
 
 		zfw_ctrl = cy_card[card].base_addr +
-			(cy_readl(&firm_id->zfwctrl_addr) & 0xfffff);
+			(readl(&firm_id->zfwctrl_addr) & 0xfffff);
 		board_ctrl = &zfw_ctrl->board_ctrl;
 		ch_ctrl = &(zfw_ctrl->ch_ctrl[channel]);
 		buf_ctrl = &zfw_ctrl->buf_ctrl[channel];
@@ -3401,10 +3390,10 @@ static void set_line_char(struct cyclades_port *info)
 		}
 		if (cflag & CSTOPB) {
 			cy_writel(&ch_ctrl->comm_data_l,
-				  cy_readl(&ch_ctrl->comm_data_l) | C_DL_2STOP);
+				  readl(&ch_ctrl->comm_data_l) | C_DL_2STOP);
 		} else {
 			cy_writel(&ch_ctrl->comm_data_l,
-				  cy_readl(&ch_ctrl->comm_data_l) | C_DL_1STOP);
+				  readl(&ch_ctrl->comm_data_l) | C_DL_1STOP);
 		}
 		if (cflag & PARENB) {
 			if (cflag & PARODD) {
@@ -3419,12 +3408,10 @@ static void set_line_char(struct cyclades_port *info)
 		/* CTS flow control flag */
 		if (cflag & CRTSCTS) {
 			cy_writel(&ch_ctrl->hw_flow,
-				  cy_readl(&ch_ctrl->
-					   hw_flow) | C_RS_CTS | C_RS_RTS);
+				readl(&ch_ctrl->hw_flow) | C_RS_CTS | C_RS_RTS);
 		} else {
-			cy_writel(&ch_ctrl->hw_flow,
-				  cy_readl(&ch_ctrl->
-					   hw_flow) & ~(C_RS_CTS | C_RS_RTS));
+			cy_writel(&ch_ctrl->hw_flow, readl(&ch_ctrl->hw_flow) &
+					~(C_RS_CTS | C_RS_RTS));
 		}
 		/* As the HW flow control is done in firmware, the driver
 		   doesn't need to care about it */
@@ -3454,13 +3441,13 @@ static void set_line_char(struct cyclades_port *info)
 
 		if (baud == 0) {	/* baud rate is zero, turn off line */
 			cy_writel(&ch_ctrl->rs_control,
-				  cy_readl(&ch_ctrl->rs_control) & ~C_RS_DTR);
+				  readl(&ch_ctrl->rs_control) & ~C_RS_DTR);
 #ifdef CY_DEBUG_DTR
 			printk("cyc:set_line_char dropping Z DTR\n");
 #endif
 		} else {
 			cy_writel(&ch_ctrl->rs_control,
-				  cy_readl(&ch_ctrl->rs_control) | C_RS_DTR);
+				  readl(&ch_ctrl->rs_control) | C_RS_DTR);
 #ifdef CY_DEBUG_DTR
 			printk("cyc:set_line_char raising Z DTR\n");
 #endif
@@ -3575,7 +3562,7 @@ static int get_lsr_info(struct cyclades_port *info, unsigned int __user * value)
 		    cy_card[card].base_addr + (cy_chip_offset[chip] << index);
 
 		CY_LOCK(info, flags);
-		status = cy_readb(base_addr + (CySRER << index)) &
+		status = readb(base_addr + (CySRER << index)) &
 				(CyTxRdy | CyTxMpty);
 		CY_UNLOCK(info, flags);
 		result = (status ? 0 : TIOCSER_TEMT);
@@ -3614,8 +3601,8 @@ static int cy_tiocmget(struct tty_struct *tty, struct file *file)
 
 		CY_LOCK(info, flags);
 		cy_writeb(base_addr + (CyCAR << index), (u_char) channel);
-		status = cy_readb(base_addr + (CyMSVR1 << index));
-		status |= cy_readb(base_addr + (CyMSVR2 << index));
+		status = readb(base_addr + (CyMSVR1 << index));
+		status |= readb(base_addr + (CyMSVR2 << index));
 		CY_UNLOCK(info, flags);
 
 		if (info->rtsdtr_inv) {
@@ -3639,10 +3626,10 @@ static int cy_tiocmget(struct tty_struct *tty, struct file *file)
 		firm_id = cy_card[card].base_addr + ID_ADDRESS;
 		if (ISZLOADED(cy_card[card])) {
 			zfw_ctrl = cy_card[card].base_addr +
-				(cy_readl(&firm_id->zfwctrl_addr) & 0xfffff);
+				(readl(&firm_id->zfwctrl_addr) & 0xfffff);
 			board_ctrl = &zfw_ctrl->board_ctrl;
 			ch_ctrl = zfw_ctrl->ch_ctrl;
-			lstatus = cy_readl(&ch_ctrl[channel].rs_status);
+			lstatus = readl(&ch_ctrl[channel].rs_status);
 			result = ((lstatus & C_RS_RTS) ? TIOCM_RTS : 0) |
 				((lstatus & C_RS_DTR) ? TIOCM_DTR : 0) |
 				((lstatus & C_RS_DCD) ? TIOCM_CAR : 0) |
@@ -3724,8 +3711,8 @@ cy_tiocmset(struct tty_struct *tty, struct file *file,
 #ifdef CY_DEBUG_DTR
 			printk("cyc:set_modem_info raising DTR\n");
 			printk("     status: 0x%x, 0x%x\n",
-				cy_readb(base_addr + (CyMSVR1 << index)),
-				cy_readb(base_addr + (CyMSVR2 << index)));
+				readb(base_addr + (CyMSVR1 << index)),
+				readb(base_addr + (CyMSVR2 << index)));
 #endif
 			CY_UNLOCK(info, flags);
 		}
@@ -3744,8 +3731,8 @@ cy_tiocmset(struct tty_struct *tty, struct file *file,
 #ifdef CY_DEBUG_DTR
 			printk("cyc:set_modem_info dropping DTR\n");
 			printk("     status: 0x%x, 0x%x\n",
-				cy_readb(base_addr + (CyMSVR1 << index)),
-				cy_readb(base_addr + (CyMSVR2 << index)));
+				readb(base_addr + (CyMSVR1 << index)),
+				readb(base_addr + (CyMSVR2 << index)));
 #endif
 			CY_UNLOCK(info, flags);
 		}
@@ -3755,29 +3742,29 @@ cy_tiocmset(struct tty_struct *tty, struct file *file,
 		firm_id = cy_card[card].base_addr + ID_ADDRESS;
 		if (ISZLOADED(cy_card[card])) {
 			zfw_ctrl = cy_card[card].base_addr +
-				(cy_readl(&firm_id->zfwctrl_addr) & 0xfffff);
+				(readl(&firm_id->zfwctrl_addr) & 0xfffff);
 			board_ctrl = &zfw_ctrl->board_ctrl;
 			ch_ctrl = zfw_ctrl->ch_ctrl;
 
 			if (set & TIOCM_RTS) {
 				CY_LOCK(info, flags);
 				cy_writel(&ch_ctrl[channel].rs_control,
-					  cy_readl(&ch_ctrl[channel].
-						   rs_control) | C_RS_RTS);
+					readl(&ch_ctrl[channel].rs_control) |
+					C_RS_RTS);
 				CY_UNLOCK(info, flags);
 			}
 			if (clear & TIOCM_RTS) {
 				CY_LOCK(info, flags);
 				cy_writel(&ch_ctrl[channel].rs_control,
-					  cy_readl(&ch_ctrl[channel].
-						   rs_control) & ~C_RS_RTS);
+					readl(&ch_ctrl[channel].rs_control) &
+					~C_RS_RTS);
 				CY_UNLOCK(info, flags);
 			}
 			if (set & TIOCM_DTR) {
 				CY_LOCK(info, flags);
 				cy_writel(&ch_ctrl[channel].rs_control,
-					  cy_readl(&ch_ctrl[channel].
-						   rs_control) | C_RS_DTR);
+					readl(&ch_ctrl[channel].rs_control) |
+					C_RS_DTR);
 #ifdef CY_DEBUG_DTR
 				printk("cyc:set_modem_info raising Z DTR\n");
 #endif
@@ -3786,8 +3773,8 @@ cy_tiocmset(struct tty_struct *tty, struct file *file,
 			if (clear & TIOCM_DTR) {
 				CY_LOCK(info, flags);
 				cy_writel(&ch_ctrl[channel].rs_control,
-					  cy_readl(&ch_ctrl[channel].
-						   rs_control) & ~C_RS_DTR);
+					readl(&ch_ctrl[channel].rs_control) &
+					~C_RS_DTR);
 #ifdef CY_DEBUG_DTR
 				printk("cyc:set_modem_info clearing Z DTR\n");
 #endif
@@ -3924,7 +3911,7 @@ get_threshold(struct cyclades_port *info, unsigned long __user * value)
 		base_addr =
 		    cy_card[card].base_addr + (cy_chip_offset[chip] << index);
 
-		tmp = cy_readb(base_addr + (CyCOR3 << index)) & CyREC_FIFO;
+		tmp = readb(base_addr + (CyCOR3 << index)) & CyREC_FIFO;
 		return put_user(tmp, value);
 	} else {
 		/* Nothing to do! */
@@ -3984,7 +3971,7 @@ static int get_timeout(struct cyclades_port *info, unsigned long __user * value)
 		base_addr =
 		    cy_card[card].base_addr + (cy_chip_offset[chip] << index);
 
-		tmp = cy_readb(base_addr + (CyRTPR << index));
+		tmp = readb(base_addr + (CyRTPR << index));
 		return put_user(tmp, value);
 	} else {
 		/* Nothing to do! */
@@ -4410,7 +4397,7 @@ static void cy_stop(struct tty_struct *tty)
 		cy_writeb(base_addr + (CyCAR << index),
 			(u_char)(channel & 0x0003)); /* index channel */
 		cy_writeb(base_addr + (CySRER << index),
-			  cy_readb(base_addr + (CySRER << index)) & ~CyTxRdy);
+			  readb(base_addr + (CySRER << index)) & ~CyTxRdy);
 		CY_UNLOCK(info, flags);
 	} else {
 		/* Nothing to do! */
@@ -4444,7 +4431,7 @@ static void cy_start(struct tty_struct *tty)
 		CY_LOCK(info, flags);
 		cy_writeb(base_addr + (CyCAR << index), (u_char) (channel & 0x0003));	/* index channel */
 		cy_writeb(base_addr + (CySRER << index),
-			  cy_readb(base_addr + (CySRER << index)) | CyTxRdy);
+			  readb(base_addr + (CySRER << index)) | CyTxRdy);
 		CY_UNLOCK(info, flags);
 	} else {
 		/* Nothing to do! */
@@ -4537,7 +4524,7 @@ cyy_init_card(void __iomem * true_base_addr, int index)
 		base_addr =
 		    true_base_addr + (cy_chip_offset[chip_number] << index);
 		mdelay(1);
-		if (cy_readb(base_addr + (CyCCR << index)) != 0x00) {
+		if (readb(base_addr + (CyCCR << index)) != 0x00) {
 			/*************
 			printk(" chip #%d at %#6lx is never idle (CCR != 0)\n",
 			chip_number, (unsigned long)base_addr);
@@ -4554,7 +4541,7 @@ cyy_init_card(void __iomem * true_base_addr, int index)
 		   chip 4 GFRCR register appears at chip 0, there is no chip 4
 		   and this must be a Cyclom-16Y, not a Cyclom-32Ye.
 		 */
-		if (chip_number == 4 && cy_readb(true_base_addr +
+		if (chip_number == 4 && readb(true_base_addr +
 				(cy_chip_offset[0] << index) +
 				(CyGFRCR << index)) == 0) {
 			return chip_number;
@@ -4563,7 +4550,7 @@ cyy_init_card(void __iomem * true_base_addr, int index)
 		cy_writeb(base_addr + (CyCCR << index), CyCHIP_RESET);
 		mdelay(1);
 
-		if (cy_readb(base_addr + (CyGFRCR << index)) == 0x00) {
+		if (readb(base_addr + (CyGFRCR << index)) == 0x00) {
 			/*
 			   printk(" chip #%d at %#6lx is not responding ",
 			   chip_number, (unsigned long)base_addr);
@@ -4571,7 +4558,7 @@ cyy_init_card(void __iomem * true_base_addr, int index)
 			 */
 			return chip_number;
 		}
-		if ((0xf0 & (cy_readb(base_addr + (CyGFRCR << index)))) !=
+		if ((0xf0 & (readb(base_addr + (CyGFRCR << index)))) !=
 				0x40) {
 			/*
 			printk(" chip #%d at %#6lx is not valid (GFRCR == "
@@ -4582,7 +4569,7 @@ cyy_init_card(void __iomem * true_base_addr, int index)
 			return chip_number;
 		}
 		cy_writeb(base_addr + (CyGCR << index), CyCH0_SERIAL);
-		if (cy_readb(base_addr + (CyGFRCR << index)) >= CD1400_REV_J) {
+		if (readb(base_addr + (CyGFRCR << index)) >= CD1400_REV_J) {
 			/* It is a CD1400 rev. J or later */
 			/* Impossible to reach 5ms with this chip.
 			   Changed to 2ms instead (f = 500 Hz). */
@@ -4595,7 +4582,7 @@ cyy_init_card(void __iomem * true_base_addr, int index)
 		/*
 		   printk(" chip #%d at %#6lx is rev 0x%2x\n",
 		   chip_number, (unsigned long)base_addr,
-		   cy_readb(base_addr+(CyGFRCR<<index)));
+		   readb(base_addr+(CyGFRCR<<index)));
 		 */
 	}
 	return chip_number;
@@ -4717,14 +4704,14 @@ static int __init cy_detect_isa(void)
 static void plx_init(void __iomem * addr, __u32 initctl)
 {
 	/* Reset PLX */
-	cy_writel(addr + initctl, cy_readl(addr + initctl) | 0x40000000);
+	cy_writel(addr + initctl, readl(addr + initctl) | 0x40000000);
 	udelay(100L);
-	cy_writel(addr + initctl, cy_readl(addr + initctl) & ~0x40000000);
+	cy_writel(addr + initctl, readl(addr + initctl) & ~0x40000000);
 
 	/* Reload Config. Registers from EEPROM */
-	cy_writel(addr + initctl, cy_readl(addr + initctl) | 0x20000000);
+	cy_writel(addr + initctl, readl(addr + initctl) | 0x20000000);
 	udelay(100L);
-	cy_writel(addr + initctl, cy_readl(addr + initctl) & ~0x20000000);
+	cy_writel(addr + initctl, readl(addr + initctl) & ~0x20000000);
 }
 
 /*
@@ -4879,7 +4866,7 @@ static int __init cy_detect_pci(void)
 			cy_card[j].pdev = pdev;
 
 			/* enable interrupts in the PCI interface */
-			plx_ver = cy_readb(cy_pci_addr2 + CyPLX_VER) & 0x0f;
+			plx_ver = readb(cy_pci_addr2 + CyPLX_VER) & 0x0f;
 			switch (plx_ver) {
 			case PLX_9050:
 
@@ -4900,8 +4887,7 @@ static int __init cy_detect_pci(void)
 						cy_pci_irq);
 
 				cy_writew(cy_pci_addr0 + 0x68,
-					  cy_readw(cy_pci_addr0 +
-						   0x68) | 0x0900);
+					readw(cy_pci_addr0 + 0x68) | 0x0900);
 				break;
 			}
 
@@ -4940,7 +4926,7 @@ static int __init cy_detect_pci(void)
 
 			/* Disable interrupts on the PLX before resetting it */
 			cy_writew(cy_pci_addr0 + 0x68,
-				cy_readw(cy_pci_addr0 + 0x68) & ~0x0900);
+				readw(cy_pci_addr0 + 0x68) & ~0x0900);
 
 			plx_init(cy_pci_addr0, 0x6c);
 			/* For some yet unknown reason, once the PLX9060 reloads
@@ -4951,9 +4937,8 @@ static int __init cy_detect_pci(void)
 			pci_write_config_byte(pdev, PCI_INTERRUPT_LINE,
 						cy_pci_irq);
 
-			mailbox =
-			    (__u32)cy_readl(&((struct RUNTIME_9060 __iomem *)
-						cy_pci_addr0)->mail_box_0);
+			mailbox = (__u32)readl(&((struct RUNTIME_9060 __iomem *)
+					cy_pci_addr0)->mail_box_0);
 
 			if (pci_resource_flags(pdev, 2) & IORESOURCE_IO) {
 				printk("  Warning: PCI I/O bit incorrectly "
@@ -5005,10 +4990,10 @@ static int __init cy_detect_pci(void)
 					WIN_CREG);
 				printk("Cyclades-8Zo/PCI: FPGA id %lx, ver "
 					"%lx\n", (ulong) (0xff &
-					cy_readl(&((struct CUSTOM_REG *)
+					readl(&((struct CUSTOM_REG *)
 						(cy_pci_addr2))->fpga_id)),
 					(ulong)(0xff &
-					cy_readl(&((struct CUSTOM_REG *)
+					readl(&((struct CUSTOM_REG *)
 						(cy_pci_addr2))->
 							fpga_version)));
 				cy_writel(&((struct RUNTIME_9060 *)
@@ -5113,7 +5098,7 @@ static int __init cy_detect_pci(void)
 			Ze_pdev[j] = Ze_pdev[j + 1];
 		}
 		ZeIndex--;
-		mailbox = (__u32)cy_readl(&((struct RUNTIME_9060 __iomem *)
+		mailbox = (__u32)readl(&((struct RUNTIME_9060 __iomem *)
 						cy_pci_addr0)->mail_box_0);
 #ifdef CY_PCI_DEBUG
 		printk("Cyclades-Z/PCI: relocate winaddr=0x%lx ctladdr=0x%lx\n",
@@ -5382,7 +5367,7 @@ static int __init cy_init(void)
 		cinfo = &cy_card[board];
 		if (cinfo->num_chips == -1) {	/* Cyclades-Z */
 			number_z_boards++;
-			mailbox = cy_readl(&((struct RUNTIME_9060 __iomem *)
+			mailbox = readl(&((struct RUNTIME_9060 __iomem *)
 					     cy_card[board].ctl_addr)->
 					   mail_box_0);
 			nports = (mailbox == ZE_V1) ? ZE_V1_NPORTS : 8;
@@ -5478,7 +5463,7 @@ static int __init cy_init(void)
 				info->icount.overrun = info->icount.brk = 0;
 				chip_number = (port - cinfo->first_line) / 4;
 				if ((info->chip_rev =
-				     cy_readb(cinfo->base_addr +
+				     readb(cinfo->base_addr +
 					      (cy_chip_offset[chip_number] <<
 					       index) + (CyGFRCR << index))) >=
 				    CD1400_REV_J) {
diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h
index 4c5b476..f0ad61f 100644
--- a/include/linux/cyclades.h
+++ b/include/linux/cyclades.h
@@ -539,13 +539,9 @@ struct cyclades_chip {
  * (required to support Alpha systems) *
  ***************************************/
 
-#define cy_writeb(port,val)     {writeb((val),(port)); mb();}
-#define cy_writew(port,val)     {writew((val),(port)); mb();}
-#define cy_writel(port,val)     {writel((val),(port)); mb();}
-
-#define cy_readb(port)  readb(port)
-#define cy_readw(port)  readw(port)
-#define cy_readl(port)  readl(port)
+#define cy_writeb(port,val)     do { writeb((val), (port)); mb(); } while (0)
+#define cy_writew(port,val)     do { writew((val), (port)); mb(); } while (0)
+#define cy_writel(port,val)     do { writel((val), (port)); mb(); } while (0)
 
 /*
  * Statistics counters

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/5] Char: cyclades, timer cleanup
  2007-04-04 21:44 [PATCH 1/5] Char: cyclades, remove PAUSE Jiri Slaby
  2007-04-04 21:45 ` [PATCH 2/5] Char: cyclades, cy_readX/writeX cleanup Jiri Slaby
@ 2007-04-04 21:45 ` Jiri Slaby
  2007-04-04 21:45 ` [PATCH 4/5] Char: cyclades, remove volatiles Jiri Slaby
  2007-04-04 21:45 ` [PATCH 5/5] Char: cyclades, remove useless casts Jiri Slaby
  3 siblings, 0 replies; 10+ messages in thread
From: Jiri Slaby @ 2007-04-04 21:45 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

cyclades, timer cleanup

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>

---
commit d4e20e52c6084cff971d5b696c6eeac5ca2f9f48
tree 6372590725beebef60015ece7f910ce208cd5d0e
parent b0deeb148ea3d68519e313a08aad142aa44b0d41
author Jiri Slaby <jirislaby@gmail.com> Mon, 26 Mar 2007 16:20:08 +0200
committer Jiri Slaby <jirislaby@gmail.com> Tue, 27 Mar 2007 14:45:37 +0200

 drivers/char/cyclades.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index fc73537..0e530cb 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -851,7 +851,6 @@ static void cyz_poll(unsigned long);
 /* The Cyclades-Z polling cycle is defined by this variable */
 static long cyz_polling_cycle = CZ_DEF_POLL;
 
-static int cyz_timeron = 0;
 static DEFINE_TIMER(cyz_timerlist, cyz_poll, 0, 0);
 
 #else				/* CONFIG_CYZ_INTR */
@@ -1906,9 +1905,9 @@ static void cyz_poll(unsigned long arg)
 	static volatile struct BOARD_CTRL *board_ctrl;
 	static volatile struct CH_CTRL *ch_ctrl;
 	static volatile struct BUF_CTRL *buf_ctrl;
+	unsigned long expires = jiffies + HZ;
 	int card, port;
 
-	cyz_timerlist.expires = jiffies + (HZ);
 	for (card = 0; card < NR_CARDS; card++) {
 		cinfo = &cy_card[card];
 
@@ -1942,9 +1941,9 @@ static void cyz_poll(unsigned long arg)
 			cyz_handle_tx(info, ch_ctrl, buf_ctrl);
 		}
 		/* poll every 'cyz_polling_cycle' period */
-		cyz_timerlist.expires = jiffies + cyz_polling_cycle;
+		expires = jiffies + cyz_polling_cycle;
 	}
-	add_timer(&cyz_timerlist);
+	mod_timer(&cyz_timerlist, expires);
 }				/* cyz_poll */
 
 #endif				/* CONFIG_CYZ_INTR */
@@ -5504,10 +5503,8 @@ static int __init cy_init(void)
 	}
 
 #ifndef CONFIG_CYZ_INTR
-	if (number_z_boards && !cyz_timeron) {
-		cyz_timeron++;
-		cyz_timerlist.expires = jiffies + 1;
-		add_timer(&cyz_timerlist);
+	if (number_z_boards) {
+		mod_timer(&cyz_timerlist, jiffies + 1);
 #ifdef CY_PCI_DEBUG
 		printk("Cyclades-Z polling initialized\n");
 #endif
@@ -5523,10 +5520,7 @@ static void __exit cy_cleanup_module(void)
 	int i, e1;
 
 #ifndef CONFIG_CYZ_INTR
-	if (cyz_timeron){
-		cyz_timeron = 0;
-		del_timer(&cyz_timerlist);
-	}
+	del_timer_sync(&cyz_timerlist);
 #endif /* CONFIG_CYZ_INTR */
 
 	if ((e1 = tty_unregister_driver(cy_serial_driver)))

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/5] Char: cyclades, remove volatiles
  2007-04-04 21:44 [PATCH 1/5] Char: cyclades, remove PAUSE Jiri Slaby
  2007-04-04 21:45 ` [PATCH 2/5] Char: cyclades, cy_readX/writeX cleanup Jiri Slaby
  2007-04-04 21:45 ` [PATCH 3/5] Char: cyclades, timer cleanup Jiri Slaby
@ 2007-04-04 21:45 ` Jiri Slaby
  2007-04-07  0:14   ` Andrew Morton
  2007-04-04 21:45 ` [PATCH 5/5] Char: cyclades, remove useless casts Jiri Slaby
  3 siblings, 1 reply; 10+ messages in thread
From: Jiri Slaby @ 2007-04-04 21:45 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

cyclades, remove volatiles

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>

---
commit fc6aa32bd302fb7dbd1dcc7c5829b0cb27a79ce6
tree a958d622a33f0dd499f072f44bcdd121b771b921
parent d4e20e52c6084cff971d5b696c6eeac5ca2f9f48
author Jiri Slaby <jirislaby@gmail.com> Mon, 26 Mar 2007 18:03:30 +0200
committer Jiri Slaby <jirislaby@gmail.com> Tue, 27 Mar 2007 14:45:40 +0200

 drivers/char/cyclades.c |   52 +++++++++++++++++++++++------------------------
 1 files changed, 25 insertions(+), 27 deletions(-)

diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index 0e530cb..70d5a39 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -967,7 +967,7 @@ do_softint(struct work_struct *work)
  */
 static int cyy_issue_cmd(void __iomem * base_addr, u_char cmd, int index)
 {
-	volatile int i;
+	unsigned int i;
 
 	/* Check to see that the previous command has completed */
 	for (i = 0; i < 100; i++) {
@@ -1043,7 +1043,7 @@ static void cyy_intr_chip(struct cyclades_card *cinfo, int chip,
 {
 	struct cyclades_port *info;
 	struct tty_struct *tty;
-	volatile int char_count;
+	int char_count;
 	int i, j, len, mdm_change, mdm_status, outch;
 	int save_xir, channel, save_car;
 	char data;
@@ -1551,20 +1551,19 @@ cyz_issue_cmd(struct cyclades_card *cinfo,
 }				/* cyz_issue_cmd */
 
 static void
-cyz_handle_rx(struct cyclades_port *info,
-		volatile struct CH_CTRL __iomem * ch_ctrl,
-		volatile struct BUF_CTRL __iomem * buf_ctrl)
+cyz_handle_rx(struct cyclades_port *info, struct CH_CTRL __iomem *ch_ctrl,
+		struct BUF_CTRL __iomem *buf_ctrl)
 {
 	struct cyclades_card *cinfo = &cy_card[info->card];
 	struct tty_struct *tty = info->tty;
-	volatile int char_count;
+	int char_count;
 	int len;
 #ifdef BLOCKMOVE
 	int small_count;
 #else
 	char data;
 #endif
-	volatile __u32 rx_put, rx_get, new_rx_get, rx_bufsize, rx_bufaddr;
+	__u32 rx_put, rx_get, new_rx_get, rx_bufsize, rx_bufaddr;
 
 	rx_get = new_rx_get = readl(&buf_ctrl->rx_get);
 	rx_put = readl(&buf_ctrl->rx_put);
@@ -1648,18 +1647,17 @@ cyz_handle_rx(struct cyclades_port *info,
 }
 
 static void
-cyz_handle_tx(struct cyclades_port *info,
-		volatile struct CH_CTRL __iomem * ch_ctrl,
-		volatile struct BUF_CTRL __iomem * buf_ctrl)
+cyz_handle_tx(struct cyclades_port *info, struct CH_CTRL __iomem *ch_ctrl,
+		struct BUF_CTRL __iomem *buf_ctrl)
 {
 	struct cyclades_card *cinfo = &cy_card[info->card];
 	struct tty_struct *tty = info->tty;
 	char data;
-	volatile int char_count;
+	int char_count;
 #ifdef BLOCKMOVE
 	int small_count;
 #endif
-	volatile __u32 tx_put, tx_get, tx_bufsize, tx_bufaddr;
+	__u32 tx_put, tx_get, tx_bufsize, tx_bufaddr;
 
 	if (info->xmit_cnt <= 0)	/* Nothing to transmit */
 		return;
@@ -1739,11 +1737,11 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo)
 {
 	struct tty_struct *tty;
 	struct cyclades_port *info;
-	static volatile struct FIRM_ID __iomem *firm_id;
-	static volatile struct ZFW_CTRL __iomem *zfw_ctrl;
-	static volatile struct BOARD_CTRL __iomem *board_ctrl;
-	static volatile struct CH_CTRL __iomem *ch_ctrl;
-	static volatile struct BUF_CTRL __iomem *buf_ctrl;
+	static struct FIRM_ID __iomem *firm_id;
+	static struct ZFW_CTRL __iomem *zfw_ctrl;
+	static struct BOARD_CTRL __iomem *board_ctrl;
+	static struct CH_CTRL __iomem *ch_ctrl;
+	static struct BUF_CTRL __iomem *buf_ctrl;
 	__u32 channel;
 	__u8 cmd;
 	__u32 param;
@@ -1900,11 +1898,11 @@ static void cyz_poll(unsigned long arg)
 	struct cyclades_card *cinfo;
 	struct cyclades_port *info;
 	struct tty_struct *tty;
-	static volatile struct FIRM_ID *firm_id;
-	static volatile struct ZFW_CTRL *zfw_ctrl;
-	static volatile struct BOARD_CTRL *board_ctrl;
-	static volatile struct CH_CTRL *ch_ctrl;
-	static volatile struct BUF_CTRL *buf_ctrl;
+	static struct FIRM_ID *firm_id;
+	static struct ZFW_CTRL *zfw_ctrl;
+	static struct BOARD_CTRL *board_ctrl;
+	static struct CH_CTRL *ch_ctrl;
+	static struct BUF_CTRL *buf_ctrl;
 	unsigned long expires = jiffies + HZ;
 	int card, port;
 
@@ -3003,12 +3001,12 @@ static int cy_chars_in_buffer(struct tty_struct *tty)
 		return info->xmit_cnt;
 #ifdef Z_EXT_CHARS_IN_BUFFER
 	} else {
-		static volatile struct FIRM_ID *firm_id;
-		static volatile struct ZFW_CTRL *zfw_ctrl;
-		static volatile struct CH_CTRL *ch_ctrl;
-		static volatile struct BUF_CTRL *buf_ctrl;
+		static struct FIRM_ID *firm_id;
+		static struct ZFW_CTRL *zfw_ctrl;
+		static struct CH_CTRL *ch_ctrl;
+		static struct BUF_CTRL *buf_ctrl;
 		int char_count;
-		volatile __u32 tx_put, tx_get, tx_bufsize;
+		__u32 tx_put, tx_get, tx_bufsize;
 
 		firm_id = cy_card[card].base_addr + ID_ADDRESS;
 		zfw_ctrl = cy_card[card].base_addr +

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/5] Char: cyclades, remove useless casts
  2007-04-04 21:44 [PATCH 1/5] Char: cyclades, remove PAUSE Jiri Slaby
                   ` (2 preceding siblings ...)
  2007-04-04 21:45 ` [PATCH 4/5] Char: cyclades, remove volatiles Jiri Slaby
@ 2007-04-04 21:45 ` Jiri Slaby
  3 siblings, 0 replies; 10+ messages in thread
From: Jiri Slaby @ 2007-04-04 21:45 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

cyclades, remove useless casts

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>

---
commit 68c91f59163a6536a2f445a14b0c47ea16b41faa
tree a06734e9113b7bc10aa7f8b3e87c3d58780e7125
parent fc6aa32bd302fb7dbd1dcc7c5829b0cb27a79ce6
author Jiri Slaby <jirislaby@gmail.com> Mon, 26 Mar 2007 18:16:13 +0200
committer Jiri Slaby <jirislaby@gmail.com> Tue, 27 Mar 2007 14:45:42 +0200

 drivers/char/cyclades.c |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index 70d5a39..abdc3c7 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -2636,7 +2636,7 @@ static int cy_open(struct tty_struct *tty, struct file *filp)
  */
 static void cy_wait_until_sent(struct tty_struct *tty, int timeout)
 {
-	struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
+	struct cyclades_port *info = tty->driver_data;
 	void __iomem *base_addr;
 	int card, chip, channel, index;
 	unsigned long orig_jiffies;
@@ -2713,7 +2713,7 @@ static void cy_wait_until_sent(struct tty_struct *tty, int timeout)
  */
 static void cy_close(struct tty_struct *tty, struct file *filp)
 {
-	struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
+	struct cyclades_port *info = tty->driver_data;
 	unsigned long flags;
 
 #ifdef CY_DEBUG_OTHER
@@ -2858,7 +2858,7 @@ static void cy_close(struct tty_struct *tty, struct file *filp)
  */
 static int cy_write(struct tty_struct *tty, const unsigned char *buf, int count)
 {
-	struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
+	struct cyclades_port *info = tty->driver_data;
 	unsigned long flags;
 	int c, ret = 0;
 
@@ -2909,7 +2909,7 @@ static int cy_write(struct tty_struct *tty, const unsigned char *buf, int count)
  */
 static void cy_put_char(struct tty_struct *tty, unsigned char ch)
 {
-	struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
+	struct cyclades_port *info = tty->driver_data;
 	unsigned long flags;
 
 #ifdef CY_DEBUG_IO
@@ -2942,7 +2942,7 @@ static void cy_put_char(struct tty_struct *tty, unsigned char ch)
  */
 static void cy_flush_chars(struct tty_struct *tty)
 {
-	struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
+	struct cyclades_port *info = tty->driver_data;
 
 #ifdef CY_DEBUG_IO
 	printk("cyc:cy_flush_chars ttyC%d\n", info->line);	/* */
@@ -2966,7 +2966,7 @@ static void cy_flush_chars(struct tty_struct *tty)
  */
 static int cy_write_room(struct tty_struct *tty)
 {
-	struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
+	struct cyclades_port *info = tty->driver_data;
 	int ret;
 
 #ifdef CY_DEBUG_IO
@@ -2983,7 +2983,7 @@ static int cy_write_room(struct tty_struct *tty)
 
 static int cy_chars_in_buffer(struct tty_struct *tty)
 {
-	struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
+	struct cyclades_port *info = tty->driver_data;
 	int card, channel;
 
 	if (serial_paranoia_check(info, tty->name, "cy_chars_in_buffer"))
@@ -3572,7 +3572,7 @@ static int get_lsr_info(struct cyclades_port *info, unsigned int __user * value)
 
 static int cy_tiocmget(struct tty_struct *tty, struct file *file)
 {
-	struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
+	struct cyclades_port *info = tty->driver_data;
 	int card, chip, channel, index;
 	void __iomem *base_addr;
 	unsigned long flags;
@@ -3646,7 +3646,7 @@ static int
 cy_tiocmset(struct tty_struct *tty, struct file *file,
 		unsigned int set, unsigned int clear)
 {
-	struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
+	struct cyclades_port *info = tty->driver_data;
 	int card, chip, channel, index;
 	void __iomem *base_addr;
 	unsigned long flags;
@@ -3797,7 +3797,7 @@ cy_tiocmset(struct tty_struct *tty, struct file *file,
  */
 static void cy_break(struct tty_struct *tty, int break_state)
 {
-	struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
+	struct cyclades_port *info = tty->driver_data;
 	unsigned long flags;
 
 	if (serial_paranoia_check(info, tty->name, "cy_break"))
@@ -3997,7 +3997,7 @@ static int
 cy_ioctl(struct tty_struct *tty, struct file *file,
 	 unsigned int cmd, unsigned long arg)
 {
-	struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
+	struct cyclades_port *info = tty->driver_data;
 	struct cyclades_icount cprev, cnow;	/* kernel counter temps */
 	struct serial_icounter_struct __user *p_cuser;	/* user space */
 	int ret_val = 0;
@@ -4190,7 +4190,7 @@ cy_ioctl(struct tty_struct *tty, struct file *file,
  */
 static void cy_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
 {
-	struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
+	struct cyclades_port *info = tty->driver_data;
 
 #ifdef CY_DEBUG_OTHER
 	printk("cyc:cy_set_termios ttyC%d\n", info->line);
@@ -4225,7 +4225,7 @@ static void cy_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
 */
 static void cy_send_xchar(struct tty_struct *tty, char ch)
 {
-	struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
+	struct cyclades_port *info = tty->driver_data;
 	int card, channel;
 
 	if (serial_paranoia_check(info, tty->name, "cy_send_xchar"))
@@ -4255,7 +4255,7 @@ static void cy_send_xchar(struct tty_struct *tty, char ch)
  */
 static void cy_throttle(struct tty_struct *tty)
 {
-	struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
+	struct cyclades_port *info = tty->driver_data;
 	unsigned long flags;
 	void __iomem *base_addr;
 	int card, chip, channel, index;
@@ -4313,7 +4313,7 @@ static void cy_throttle(struct tty_struct *tty)
  */
 static void cy_unthrottle(struct tty_struct *tty)
 {
-	struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
+	struct cyclades_port *info = tty->driver_data;
 	unsigned long flags;
 	void __iomem *base_addr;
 	int card, chip, channel, index;
@@ -4369,7 +4369,7 @@ static void cy_unthrottle(struct tty_struct *tty)
 static void cy_stop(struct tty_struct *tty)
 {
 	struct cyclades_card *cinfo;
-	struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
+	struct cyclades_port *info = tty->driver_data;
 	void __iomem *base_addr;
 	int chip, channel, index;
 	unsigned long flags;
@@ -4404,7 +4404,7 @@ static void cy_stop(struct tty_struct *tty)
 static void cy_start(struct tty_struct *tty)
 {
 	struct cyclades_card *cinfo;
-	struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
+	struct cyclades_port *info = tty->driver_data;
 	void __iomem *base_addr;
 	int chip, channel, index;
 	unsigned long flags;
@@ -4437,7 +4437,7 @@ static void cy_start(struct tty_struct *tty)
 
 static void cy_flush_buffer(struct tty_struct *tty)
 {
-	struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
+	struct cyclades_port *info = tty->driver_data;
 	int card, channel, retval;
 	unsigned long flags;
 
@@ -4474,7 +4474,7 @@ static void cy_flush_buffer(struct tty_struct *tty)
  */
 static void cy_hangup(struct tty_struct *tty)
 {
-	struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
+	struct cyclades_port *info = tty->driver_data;
 
 #ifdef CY_DEBUG_OTHER
 	printk("cyc:cy_hangup ttyC%d\n", info->line);	/* */

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/5] Char: cyclades, remove volatiles
  2007-04-04 21:45 ` [PATCH 4/5] Char: cyclades, remove volatiles Jiri Slaby
@ 2007-04-07  0:14   ` Andrew Morton
  2007-04-07  7:28     ` Jiri Slaby
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Morton @ 2007-04-07  0:14 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: linux-kernel

On Wed,  4 Apr 2007 23:45:38 +0200 (CEST) Jiri Slaby <jirislaby@gmail.com> wrote:

> cyclades, remove volatiles

The other changes seem uncontroversial, but this one has the potential
to change runtime behaviour.  And cyclades.c is a driver which some people
actually use ;)

Have these changes been runtime-tested?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/5] Char: cyclades, remove volatiles
  2007-04-07  0:14   ` Andrew Morton
@ 2007-04-07  7:28     ` Jiri Slaby
  2007-04-09 14:20       ` John Stoffel
  0 siblings, 1 reply; 10+ messages in thread
From: Jiri Slaby @ 2007-04-07  7:28 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

Andrew Morton napsal(a):
> On Wed,  4 Apr 2007 23:45:38 +0200 (CEST) Jiri Slaby <jirislaby@gmail.com> wrote:
> 
>> cyclades, remove volatiles
> 
> The other changes seem uncontroversial, but this one has the potential
> to change runtime behaviour.  And cyclades.c is a driver which some people
> actually use ;)

Well, don't you know anybody with Z card, please?

But all volatiles were
- used locally (loop variables, nonptr count read once from HW), so that nothing
has a chance to change them in the memory.
- accessed by readX/writeX (pointers to mapped HW) and that should be OK

> Have these changes been runtime-tested?

Yes this time :), I have at least PCI Y cyclades card within reach to test.

thanks,
-- 
http://www.fi.muni.cz/~xslaby/            Jiri Slaby
faculty of informatics, masaryk university, brno, cz
e-mail: jirislaby gmail com, gpg pubkey fingerprint:
B674 9967 0407 CE62 ACC8  22A0 32CC 55C3 39D4 7A7E

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/5] Char: cyclades, remove volatiles
  2007-04-07  7:28     ` Jiri Slaby
@ 2007-04-09 14:20       ` John Stoffel
  2007-04-10 11:43         ` Jiri Slaby
  0 siblings, 1 reply; 10+ messages in thread
From: John Stoffel @ 2007-04-09 14:20 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: Andrew Morton, linux-kernel

>>>>> "Jiri" == Jiri Slaby <jirislaby@gmail.com> writes:

Jiri> Andrew Morton napsal(a):
>> On Wed,  4 Apr 2007 23:45:38 +0200 (CEST) Jiri Slaby <jirislaby@gmail.com> wrote:
>> 
>>> cyclades, remove volatiles
>> 
>> The other changes seem uncontroversial, but this one has the potential
>> to change runtime behaviour.  And cyclades.c is a driver which some people
>> actually use ;)

Jiri> Well, don't you know anybody with Z card, please?

I've got an old Cyclom-Y card (ISA) that I use, should I bother trying
out your changes?

John

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/5] Char: cyclades, remove volatiles
  2007-04-09 14:20       ` John Stoffel
@ 2007-04-10 11:43         ` Jiri Slaby
  2007-04-10 15:03           ` John Stoffel
  0 siblings, 1 reply; 10+ messages in thread
From: Jiri Slaby @ 2007-04-10 11:43 UTC (permalink / raw)
  To: John Stoffel; +Cc: Andrew Morton, linux-kernel

John Stoffel napsal(a):
>>>>>> "Jiri" == Jiri Slaby <jirislaby@gmail.com> writes:
> 
> Jiri> Andrew Morton napsal(a):
>>> On Wed,  4 Apr 2007 23:45:38 +0200 (CEST) Jiri Slaby <jirislaby@gmail.com> wrote:
>>>
>>>> cyclades, remove volatiles
>>> The other changes seem uncontroversial, but this one has the potential
>>> to change runtime behaviour.  And cyclades.c is a driver which some people
>>> actually use ;)
> 
> Jiri> Well, don't you know anybody with Z card, please?
> 
> I've got an old Cyclom-Y card (ISA) that I use, should I bother trying
> out your changes?

No, don't bother with these. If you are willing to test, please test next
patchset -- I'll post it shortly. Or do you prefer external patched module?

thanks,
-- 
http://www.fi.muni.cz/~xslaby/            Jiri Slaby
faculty of informatics, masaryk university, brno, cz
e-mail: jirislaby gmail com, gpg pubkey fingerprint:
 B674 9967 0407 CE62 ACC8  22A0 32CC 55C3 39D4 7A7E

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/5] Char: cyclades, remove volatiles
  2007-04-10 11:43         ` Jiri Slaby
@ 2007-04-10 15:03           ` John Stoffel
  0 siblings, 0 replies; 10+ messages in thread
From: John Stoffel @ 2007-04-10 15:03 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: John Stoffel, Andrew Morton, linux-kernel

>>>>> "Jiri" == Jiri Slaby <jirislaby@gmail.com> writes:

>> I've got an old Cyclom-Y card (ISA) that I use, should I bother trying
>> out your changes?

Jiri> No, don't bother with these. If you are willing to test, please
Jiri> test next patchset -- I'll post it shortly. Or do you prefer
Jiri> external patched module?

Just post your patch and I'll try to get a test run done, which
shouldn't be too hard since my UPS daemon depends on the cyclom-Y
working right.

John

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-04-10 15:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-04 21:44 [PATCH 1/5] Char: cyclades, remove PAUSE Jiri Slaby
2007-04-04 21:45 ` [PATCH 2/5] Char: cyclades, cy_readX/writeX cleanup Jiri Slaby
2007-04-04 21:45 ` [PATCH 3/5] Char: cyclades, timer cleanup Jiri Slaby
2007-04-04 21:45 ` [PATCH 4/5] Char: cyclades, remove volatiles Jiri Slaby
2007-04-07  0:14   ` Andrew Morton
2007-04-07  7:28     ` Jiri Slaby
2007-04-09 14:20       ` John Stoffel
2007-04-10 11:43         ` Jiri Slaby
2007-04-10 15:03           ` John Stoffel
2007-04-04 21:45 ` [PATCH 5/5] Char: cyclades, remove useless casts Jiri Slaby

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.