Commit 65f76a82 authored by Jiri Slaby's avatar Jiri Slaby Committed by Linus Torvalds

Char: cyclades, fix some -W warnings

Most of them are signedness, the rest unused function parameters.
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1c0a387c
...@@ -662,7 +662,7 @@ ...@@ -662,7 +662,7 @@
static void cy_throttle(struct tty_struct *tty); static void cy_throttle(struct tty_struct *tty);
static void cy_send_xchar(struct tty_struct *tty, char ch); static void cy_send_xchar(struct tty_struct *tty, char ch);
#define IS_CYC_Z(card) ((card).num_chips == -1) #define IS_CYC_Z(card) ((card).num_chips == (unsigned int)-1)
#define Z_FPGA_CHECK(card) \ #define Z_FPGA_CHECK(card) \
((readl(&((struct RUNTIME_9060 __iomem *) \ ((readl(&((struct RUNTIME_9060 __iomem *) \
...@@ -985,25 +985,23 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip, ...@@ -985,25 +985,23 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip,
{ {
struct cyclades_port *info; struct cyclades_port *info;
struct tty_struct *tty; struct tty_struct *tty;
int char_count; int len, index = cinfo->bus_index;
int j, len, index = cinfo->bus_index; u8 save_xir, channel, save_car, data, char_count;
int save_xir, channel, save_car;
char data;
#ifdef CY_DEBUG_INTERRUPTS #ifdef CY_DEBUG_INTERRUPTS
printk(KERN_DEBUG "cyy_interrupt: rcvd intr, chip %d\n", chip); printk(KERN_DEBUG "cyy_interrupt: rcvd intr, chip %d\n", chip);
#endif #endif
/* determine the channel & change to that context */ /* determine the channel & change to that context */
save_xir = (u_char) readb(base_addr + (CyRIR << index)); save_xir = readb(base_addr + (CyRIR << index));
channel = (u_short) (save_xir & CyIRChannel); channel = save_xir & CyIRChannel;
info = &cinfo->ports[channel + chip * 4]; info = &cinfo->ports[channel + chip * 4];
save_car = readb(base_addr + (CyCAR << index)); save_car = readb(base_addr + (CyCAR << index));
cy_writeb(base_addr + (CyCAR << index), save_xir); cy_writeb(base_addr + (CyCAR << index), save_xir);
/* if there is nowhere to put the data, discard it */ /* if there is nowhere to put the data, discard it */
if (info->tty == NULL) { if (info->tty == NULL) {
j = (readb(base_addr + (CyRIVR << index)) & CyIVRMask); if ((readb(base_addr + (CyRIVR << index)) & CyIVRMask) ==
if (j == CyIVRRxEx) { /* exception */ CyIVRRxEx) { /* exception */
data = readb(base_addr + (CyRDSR << index)); data = readb(base_addr + (CyRDSR << index));
} else { /* normal character reception */ } else { /* normal character reception */
char_count = readb(base_addr + (CyRDCR << index)); char_count = readb(base_addr + (CyRDCR << index));
...@@ -1014,8 +1012,8 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip, ...@@ -1014,8 +1012,8 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip,
} }
/* there is an open port for this data */ /* there is an open port for this data */
tty = info->tty; tty = info->tty;
j = readb(base_addr + (CyRIVR << index)) & CyIVRMask; if ((readb(base_addr + (CyRIVR << index)) & CyIVRMask) ==
if (j == CyIVRRxEx) { /* exception */ CyIVRRxEx) { /* exception */
data = readb(base_addr + (CyRDSR << index)); data = readb(base_addr + (CyRDSR << index));
/* For statistics only */ /* For statistics only */
...@@ -1116,13 +1114,12 @@ end: ...@@ -1116,13 +1114,12 @@ end:
cy_writeb(base_addr + (CyCAR << index), save_car); cy_writeb(base_addr + (CyCAR << index), save_car);
} }
static void cyy_chip_tx(struct cyclades_card *cinfo, int chip, static void cyy_chip_tx(struct cyclades_card *cinfo, unsigned int chip,
void __iomem *base_addr) void __iomem *base_addr)
{ {
struct cyclades_port *info; struct cyclades_port *info;
int char_count; int char_count, index = cinfo->bus_index;
int outch; u8 save_xir, channel, save_car, outch;
int save_xir, channel, save_car, index = cinfo->bus_index;
/* Since we only get here when the transmit buffer /* Since we only get here when the transmit buffer
is empty, we know we can always stuff a dozen is empty, we know we can always stuff a dozen
...@@ -1132,8 +1129,8 @@ static void cyy_chip_tx(struct cyclades_card *cinfo, int chip, ...@@ -1132,8 +1129,8 @@ static void cyy_chip_tx(struct cyclades_card *cinfo, int chip,
#endif #endif
/* determine the channel & change to that context */ /* determine the channel & change to that context */
save_xir = (u_char) readb(base_addr + (CyTIR << index)); save_xir = readb(base_addr + (CyTIR << index));
channel = (u_short) (save_xir & CyIRChannel); channel = save_xir & CyIRChannel;
save_car = readb(base_addr + (CyCAR << index)); save_car = readb(base_addr + (CyCAR << index));
cy_writeb(base_addr + (CyCAR << index), save_xir); cy_writeb(base_addr + (CyCAR << index), save_xir);
...@@ -1242,12 +1239,12 @@ static void cyy_chip_modem(struct cyclades_card *cinfo, int chip, ...@@ -1242,12 +1239,12 @@ static void cyy_chip_modem(struct cyclades_card *cinfo, int chip,
void __iomem *base_addr) void __iomem *base_addr)
{ {
struct cyclades_port *info; struct cyclades_port *info;
int mdm_change, mdm_status; int index = cinfo->bus_index;
int save_xir, channel, save_car, index = cinfo->bus_index; u8 save_xir, channel, save_car, mdm_change, mdm_status;
/* determine the channel & change to that context */ /* determine the channel & change to that context */
save_xir = (u_char) readb(base_addr + (CyMIR << index)); save_xir = readb(base_addr + (CyMIR << index));
channel = (u_short) (save_xir & CyIRChannel); channel = save_xir & CyIRChannel;
info = &cinfo->ports[channel + chip * 4]; info = &cinfo->ports[channel + chip * 4];
save_car = readb(base_addr + (CyCAR << index)); save_car = readb(base_addr + (CyCAR << index));
cy_writeb(base_addr + (CyCAR << index), save_xir); cy_writeb(base_addr + (CyCAR << index), save_xir);
...@@ -1320,10 +1317,8 @@ static irqreturn_t cyy_interrupt(int irq, void *dev_id) ...@@ -1320,10 +1317,8 @@ static irqreturn_t cyy_interrupt(int irq, void *dev_id)
int status; int status;
struct cyclades_card *cinfo = dev_id; struct cyclades_card *cinfo = dev_id;
void __iomem *base_addr, *card_base_addr; void __iomem *base_addr, *card_base_addr;
int chip; unsigned int chip, too_many, had_work;
int index; int index;
int too_many;
int had_work;
if (unlikely(cinfo == NULL)) { if (unlikely(cinfo == NULL)) {
#ifdef CY_DEBUG_INTERRUPTS #ifdef CY_DEBUG_INTERRUPTS
...@@ -1422,7 +1417,7 @@ cyz_issue_cmd(struct cyclades_card *cinfo, ...@@ -1422,7 +1417,7 @@ cyz_issue_cmd(struct cyclades_card *cinfo,
struct ZFW_CTRL __iomem *zfw_ctrl; struct ZFW_CTRL __iomem *zfw_ctrl;
struct BOARD_CTRL __iomem *board_ctrl; struct BOARD_CTRL __iomem *board_ctrl;
__u32 __iomem *pci_doorbell; __u32 __iomem *pci_doorbell;
int index; unsigned int index;
firm_id = cinfo->base_addr + ID_ADDRESS; firm_id = cinfo->base_addr + ID_ADDRESS;
if (!ISZLOADED(*cinfo)) { if (!ISZLOADED(*cinfo)) {
...@@ -1447,13 +1442,12 @@ cyz_issue_cmd(struct cyclades_card *cinfo, ...@@ -1447,13 +1442,12 @@ cyz_issue_cmd(struct cyclades_card *cinfo,
return 0; return 0;
} /* cyz_issue_cmd */ } /* cyz_issue_cmd */
static void static void cyz_handle_rx(struct cyclades_port *info,
cyz_handle_rx(struct cyclades_port *info, struct CH_CTRL __iomem *ch_ctrl,
struct BUF_CTRL __iomem *buf_ctrl) struct BUF_CTRL __iomem *buf_ctrl)
{ {
struct cyclades_card *cinfo = info->card; struct cyclades_card *cinfo = info->card;
struct tty_struct *tty = info->tty; struct tty_struct *tty = info->tty;
int char_count; unsigned int char_count;
int len; int len;
#ifdef BLOCKMOVE #ifdef BLOCKMOVE
unsigned char *buf; unsigned char *buf;
...@@ -1526,7 +1520,7 @@ cyz_handle_rx(struct cyclades_port *info, struct CH_CTRL __iomem *ch_ctrl, ...@@ -1526,7 +1520,7 @@ cyz_handle_rx(struct cyclades_port *info, struct CH_CTRL __iomem *ch_ctrl,
char_count = rx_put - rx_get; char_count = rx_put - rx_get;
else else
char_count = rx_put - rx_get + rx_bufsize; char_count = rx_put - rx_get + rx_bufsize;
if (char_count >= (int)readl(&buf_ctrl->rx_threshold) && if (char_count >= readl(&buf_ctrl->rx_threshold) &&
!timer_pending(&cyz_rx_full_timer[ !timer_pending(&cyz_rx_full_timer[
info->line])) info->line]))
mod_timer(&cyz_rx_full_timer[info->line], mod_timer(&cyz_rx_full_timer[info->line],
...@@ -1540,14 +1534,13 @@ cyz_handle_rx(struct cyclades_port *info, struct CH_CTRL __iomem *ch_ctrl, ...@@ -1540,14 +1534,13 @@ cyz_handle_rx(struct cyclades_port *info, struct CH_CTRL __iomem *ch_ctrl,
} }
} }
static void static void cyz_handle_tx(struct cyclades_port *info,
cyz_handle_tx(struct cyclades_port *info, struct CH_CTRL __iomem *ch_ctrl,
struct BUF_CTRL __iomem *buf_ctrl) struct BUF_CTRL __iomem *buf_ctrl)
{ {
struct cyclades_card *cinfo = info->card; struct cyclades_card *cinfo = info->card;
struct tty_struct *tty = info->tty; struct tty_struct *tty = info->tty;
char data; u8 data;
int char_count; unsigned int char_count;
#ifdef BLOCKMOVE #ifdef BLOCKMOVE
int small_count; int small_count;
#endif #endif
...@@ -1708,7 +1701,7 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo) ...@@ -1708,7 +1701,7 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo)
printk(KERN_DEBUG "cyz_interrupt: rcvd intr, card %d, " printk(KERN_DEBUG "cyz_interrupt: rcvd intr, card %d, "
"port %ld\n", info->card, channel); "port %ld\n", info->card, channel);
#endif #endif
cyz_handle_rx(info, ch_ctrl, buf_ctrl); cyz_handle_rx(info, buf_ctrl);
break; break;
case C_CM_TXBEMPTY: case C_CM_TXBEMPTY:
case C_CM_TXLOWWM: case C_CM_TXLOWWM:
...@@ -1718,7 +1711,7 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo) ...@@ -1718,7 +1711,7 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo)
printk(KERN_DEBUG "cyz_interrupt: xmit intr, card %d, " printk(KERN_DEBUG "cyz_interrupt: xmit intr, card %d, "
"port %ld\n", info->card, channel); "port %ld\n", info->card, channel);
#endif #endif
cyz_handle_tx(info, ch_ctrl, buf_ctrl); cyz_handle_tx(info, buf_ctrl);
break; break;
#endif /* CONFIG_CYZ_INTR */ #endif /* CONFIG_CYZ_INTR */
case C_CM_FATAL: case C_CM_FATAL:
...@@ -1787,10 +1780,9 @@ static void cyz_poll(unsigned long arg) ...@@ -1787,10 +1780,9 @@ static void cyz_poll(unsigned long arg)
struct FIRM_ID __iomem *firm_id; struct FIRM_ID __iomem *firm_id;
struct ZFW_CTRL __iomem *zfw_ctrl; struct ZFW_CTRL __iomem *zfw_ctrl;
struct BOARD_CTRL __iomem *board_ctrl; struct BOARD_CTRL __iomem *board_ctrl;
struct CH_CTRL __iomem *ch_ctrl;
struct BUF_CTRL __iomem *buf_ctrl; struct BUF_CTRL __iomem *buf_ctrl;
unsigned long expires = jiffies + HZ; unsigned long expires = jiffies + HZ;
int card, port; unsigned int port, card;
for (card = 0; card < NR_CARDS; card++) { for (card = 0; card < NR_CARDS; card++) {
cinfo = &cy_card[card]; cinfo = &cy_card[card];
...@@ -1817,12 +1809,11 @@ static void cyz_poll(unsigned long arg) ...@@ -1817,12 +1809,11 @@ static void cyz_poll(unsigned long arg)
for (port = 0; port < cinfo->nports; port++) { for (port = 0; port < cinfo->nports; port++) {
info = &cinfo->ports[port]; info = &cinfo->ports[port];
tty = info->tty; tty = info->tty;
ch_ctrl = &(zfw_ctrl->ch_ctrl[port]);
buf_ctrl = &(zfw_ctrl->buf_ctrl[port]); buf_ctrl = &(zfw_ctrl->buf_ctrl[port]);
if (!info->throttle) if (!info->throttle)
cyz_handle_rx(info, ch_ctrl, buf_ctrl); cyz_handle_rx(info, buf_ctrl);
cyz_handle_tx(info, ch_ctrl, buf_ctrl); cyz_handle_tx(info, buf_ctrl);
} }
/* poll every 'cyz_polling_cycle' period */ /* poll every 'cyz_polling_cycle' period */
expires = jiffies + cyz_polling_cycle; expires = jiffies + cyz_polling_cycle;
...@@ -2385,11 +2376,11 @@ block_til_ready(struct tty_struct *tty, struct file *filp, ...@@ -2385,11 +2376,11 @@ block_til_ready(struct tty_struct *tty, struct file *filp,
static int cy_open(struct tty_struct *tty, struct file *filp) static int cy_open(struct tty_struct *tty, struct file *filp)
{ {
struct cyclades_port *info; struct cyclades_port *info;
unsigned int i; unsigned int i, line;
int retval, line; int retval;
line = tty->index; line = tty->index;
if ((line < 0) || (NR_PORTS <= line)) { if ((tty->index < 0) || (NR_PORTS <= line)) {
return -ENODEV; return -ENODEV;
} }
for (i = 0; i < NR_CARDS; i++) for (i = 0; i < NR_CARDS; i++)
...@@ -4359,9 +4350,9 @@ static int __devinit cy_init_card(struct cyclades_card *cinfo) ...@@ -4359,9 +4350,9 @@ static int __devinit cy_init_card(struct cyclades_card *cinfo)
{ {
struct cyclades_port *info; struct cyclades_port *info;
u32 uninitialized_var(mailbox); u32 uninitialized_var(mailbox);
unsigned int nports; unsigned int nports, port;
unsigned short chip_number; unsigned short chip_number;
int uninitialized_var(index), port; int uninitialized_var(index);
spin_lock_init(&cinfo->card_lock); spin_lock_init(&cinfo->card_lock);
...@@ -5127,7 +5118,7 @@ static int __devinit cy_pci_probe(struct pci_dev *pdev, ...@@ -5127,7 +5118,7 @@ static int __devinit cy_pci_probe(struct pci_dev *pdev,
} }
} }
#endif /* CONFIG_CYZ_INTR */ #endif /* CONFIG_CYZ_INTR */
cy_card[card_no].num_chips = -1; cy_card[card_no].num_chips = (unsigned int)-1;
} }
/* set cy_card */ /* set cy_card */
...@@ -5387,7 +5378,7 @@ err: ...@@ -5387,7 +5378,7 @@ err:
static void __exit cy_cleanup_module(void) static void __exit cy_cleanup_module(void)
{ {
struct cyclades_card *card; struct cyclades_card *card;
int i, e1; unsigned int i, e1;
#ifndef CONFIG_CYZ_INTR #ifndef CONFIG_CYZ_INTR
del_timer_sync(&cyz_timerlist); del_timer_sync(&cyz_timerlist);
...@@ -5415,8 +5406,7 @@ static void __exit cy_cleanup_module(void) ...@@ -5415,8 +5406,7 @@ static void __exit cy_cleanup_module(void)
#endif /* CONFIG_CYZ_INTR */ #endif /* CONFIG_CYZ_INTR */
) )
free_irq(card->irq, card); free_irq(card->irq, card);
for (e1 = card->first_line; for (e1 = card->first_line; e1 < card->first_line +
e1 < card->first_line +
card->nports; e1++) card->nports; e1++)
tty_unregister_device(cy_serial_driver, e1); tty_unregister_device(cy_serial_driver, e1);
kfree(card->ports); kfree(card->ports);
......
...@@ -512,9 +512,9 @@ struct cyclades_card { ...@@ -512,9 +512,9 @@ struct cyclades_card {
void __iomem *base_addr; void __iomem *base_addr;
void __iomem *ctl_addr; void __iomem *ctl_addr;
int irq; int irq;
int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */ unsigned int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */
int first_line; /* minor number of first channel on card */ unsigned int first_line; /* minor number of first channel on card */
int nports; /* Number of ports in the card */ unsigned int nports; /* Number of ports in the card */
int bus_index; /* address shift - 0 for ISA, 1 for PCI */ int bus_index; /* address shift - 0 for ISA, 1 for PCI */
int intr_enabled; /* FW Interrupt flag - 0 disabled, 1 enabled */ int intr_enabled; /* FW Interrupt flag - 0 disabled, 1 enabled */
spinlock_t card_lock; spinlock_t card_lock;
...@@ -566,7 +566,7 @@ struct cyclades_port { ...@@ -566,7 +566,7 @@ struct cyclades_port {
int rtsdtr_inv; int rtsdtr_inv;
int chip_rev; int chip_rev;
int custom_divisor; int custom_divisor;
int x_char; /* to be pushed out ASAP */ u8 x_char; /* to be pushed out ASAP */
int close_delay; int close_delay;
unsigned short closing_wait; unsigned short closing_wait;
int count; /* # of fd on device */ int count; /* # of fd on device */
......
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