From: Ioana Ciornei Date: Wed, 21 Oct 2015 20:17:54 +0000 (+0300) Subject: staging: dgap: remove unnecessary space after cast X-Git-Tag: v4.4-rc1~125^2~259 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=181225530e2f625869fb8ad242444d8efa8a478b;p=platform%2Fkernel%2Flinux-exynos.git staging: dgap: remove unnecessary space after cast This patch removes unnecessary spaces after the cast. Patch done with coccinelle semantic patch: @rule0@ type t; identifier e; constant c; expression expr; @@ ( - (t) e + (t)e | - (t) c + (t)c | - (t) expr + (t)expr ) Signed-off-by: Ioana Ciornei Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index f7850f4..3cda302 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -1412,7 +1412,7 @@ static void dgap_parity_scan(struct channel_t *ch, unsigned char *cbuf, case 0: /* No FF seen yet */ - if (c == (unsigned char) '\377') + if (c == (unsigned char)'\377') /* delete this character from stream */ ch->pscan_state = 1; else { @@ -1424,7 +1424,7 @@ static void dgap_parity_scan(struct channel_t *ch, unsigned char *cbuf, case 1: /* first FF seen */ - if (c == (unsigned char) '\377') { + if (c == (unsigned char)'\377') { /* doubled ff, transform to single ff */ *cout++ = c; *fout++ = TTY_NORMAL; @@ -1836,7 +1836,7 @@ static int dgap_event(struct board_t *bd) return -EIO; } - eaddr = (struct ev_t __iomem *) (vaddr + EVBUF); + eaddr = (struct ev_t __iomem *)(vaddr + EVBUF); /* Get our head and tail */ head = readw(&(eaddr->ev_head)); @@ -1993,7 +1993,7 @@ next: */ static void dgap_poll_tasklet(unsigned long data) { - struct board_t *bd = (struct board_t *) data; + struct board_t *bd = (struct board_t *)data; ulong lock_flags; char __iomem *vaddr; u16 head, tail; @@ -2026,7 +2026,7 @@ static void dgap_poll_tasklet(unsigned long data) if (!bd->nasync) goto out; - eaddr = (struct ev_t __iomem *) (vaddr + EVBUF); + eaddr = (struct ev_t __iomem *)(vaddr + EVBUF); /* Get our head and tail */ head = readw(&(eaddr->ev_head)); @@ -2261,7 +2261,7 @@ static void dgap_poll_handler(ulong dummy) continue; if (!brd->intr_running) /* Call the real board poller directly */ - dgap_poll_tasklet((unsigned long) brd); + dgap_poll_tasklet((unsigned long)brd); } } else { /* @@ -2314,7 +2314,7 @@ schedule_poller: new_time = dgap_poll_time - jiffies; - if ((ulong) new_time >= 2 * dgap_poll_tick) { + if ((ulong)new_time >= 2 * dgap_poll_tick) { dgap_poll_time = jiffies + dgap_jiffies_from_ms(dgap_poll_tick); } @@ -2368,7 +2368,7 @@ static void dgap_cmdb(struct channel_t *ch, u8 cmd, u8 byte1, if (!vaddr) return; - cm_addr = (struct cm_t __iomem *) (vaddr + CMDBUF); + cm_addr = (struct cm_t __iomem *)(vaddr + CMDBUF); head = readw(&(cm_addr->cm_head)); /* @@ -2383,7 +2383,7 @@ static void dgap_cmdb(struct channel_t *ch, u8 cmd, u8 byte1, * Put the data in the circular command buffer. */ writeb(cmd, (vaddr + head + CMDSTART + 0)); - writeb((u8) ch->ch_portnum, (vaddr + head + CMDSTART + 1)); + writeb((u8)ch->ch_portnum, (vaddr + head + CMDSTART + 1)); writeb(byte1, (vaddr + head + CMDSTART + 2)); writeb(byte2, (vaddr + head + CMDSTART + 3)); @@ -2451,7 +2451,7 @@ static void dgap_cmdw(struct channel_t *ch, u8 cmd, u16 word, uint ncmds) if (!vaddr) return; - cm_addr = (struct cm_t __iomem *) (vaddr + CMDBUF); + cm_addr = (struct cm_t __iomem *)(vaddr + CMDBUF); head = readw(&(cm_addr->cm_head)); /* @@ -2466,8 +2466,8 @@ static void dgap_cmdw(struct channel_t *ch, u8 cmd, u16 word, uint ncmds) * Put the data in the circular command buffer. */ writeb(cmd, (vaddr + head + CMDSTART + 0)); - writeb((u8) ch->ch_portnum, (vaddr + head + CMDSTART + 1)); - writew((u16) word, (vaddr + head + CMDSTART + 2)); + writeb((u8)ch->ch_portnum, (vaddr + head + CMDSTART + 1)); + writew((u16)word, (vaddr + head + CMDSTART + 2)); head = (head + 4) & (CMDMAX - CMDSTART - 4); @@ -2533,7 +2533,7 @@ static void dgap_cmdw_ext(struct channel_t *ch, u16 cmd, u16 word, uint ncmds) if (!vaddr) return; - cm_addr = (struct cm_t __iomem *) (vaddr + CMDBUF); + cm_addr = (struct cm_t __iomem *)(vaddr + CMDBUF); head = readw(&(cm_addr->cm_head)); /* @@ -2549,19 +2549,19 @@ static void dgap_cmdw_ext(struct channel_t *ch, u16 cmd, u16 word, uint ncmds) */ /* Write an FF to tell the FEP that we want an extended command */ - writeb((u8) 0xff, (vaddr + head + CMDSTART + 0)); + writeb((u8)0xff, (vaddr + head + CMDSTART + 0)); - writeb((u8) ch->ch_portnum, (vaddr + head + CMDSTART + 1)); - writew((u16) cmd, (vaddr + head + CMDSTART + 2)); + writeb((u8)ch->ch_portnum, (vaddr + head + CMDSTART + 1)); + writew((u16)cmd, (vaddr + head + CMDSTART + 2)); /* * If the second part of the command won't fit, * put it at the beginning of the circular buffer. */ if (((head + 4) >= ((CMDMAX - CMDSTART)) || (head & 03))) - writew((u16) word, (vaddr + CMDSTART)); + writew((u16)word, (vaddr + CMDSTART)); else - writew((u16) word, (vaddr + head + CMDSTART + 4)); + writew((u16)word, (vaddr + head + CMDSTART + 4)); head = (head + 8) & (CMDMAX - CMDSTART - 4); @@ -2859,13 +2859,13 @@ static int dgap_param(struct channel_t *ch, struct board_t *bd, u32 un_type) cflag &= 0xffff; if (cflag != ch->ch_fepcflag) { - ch->ch_fepcflag = (u16) (cflag & 0xffff); + ch->ch_fepcflag = (u16)(cflag & 0xffff); /* * Okay to have channel and board * locks held calling this */ - dgap_cmdw(ch, SCFLAG, (u16) cflag, 0); + dgap_cmdw(ch, SCFLAG, (u16)cflag, 0); } /* Handle transition from B0 */ @@ -2906,7 +2906,7 @@ static int dgap_param(struct channel_t *ch, struct board_t *bd, u32 un_type) ch->ch_fepiflag = iflag; /* Okay to have channel and board locks held calling this */ - dgap_cmdw(ch, SIFLAG, (u16) ch->ch_fepiflag, 0); + dgap_cmdw(ch, SIFLAG, (u16)ch->ch_fepiflag, 0); } /* @@ -2931,7 +2931,7 @@ static int dgap_param(struct channel_t *ch, struct board_t *bd, u32 un_type) ch->ch_hflow = hflow; /* Okay to have channel and board locks held calling this */ - dgap_cmdb(ch, SHFLOW, (u8) hflow, 0xff, 0); + dgap_cmdb(ch, SHFLOW, (u8)hflow, 0xff, 0); } /* @@ -2959,7 +2959,7 @@ static int dgap_param(struct channel_t *ch, struct board_t *bd, u32 un_type) ch->ch_mostat = mval; /* Okay to have channel and board locks held calling this */ - dgap_cmdb(ch, SMODEM, (u8) mval, D_RTS(ch)|D_DTR(ch), 0); + dgap_cmdb(ch, SMODEM, (u8)mval, D_RTS(ch) | D_DTR(ch), 0); } /* @@ -3158,7 +3158,7 @@ static void dgap_tty_flush_buffer(struct tty_struct *tty) ch->ch_flags &= ~CH_STOP; head = readw(&(ch->ch_bs->tx_head)); - dgap_cmdw(ch, FLUSHTX, (u16) head, 0); + dgap_cmdw(ch, FLUSHTX, (u16)head, 0); dgap_cmdw(ch, RESUMETX, 0, 0); if (ch->ch_tun.un_flags & (UN_LOW|UN_EMPTY)) { ch->ch_tun.un_flags &= ~(UN_LOW|UN_EMPTY); @@ -3603,7 +3603,7 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, n -= remain; vaddr = ch->ch_taddr + head; - memcpy_toio(vaddr, (u8 *) buf, remain); + memcpy_toio(vaddr, (u8 *)buf, remain); head = ch->ch_tstart; buf += remain; @@ -3616,7 +3616,7 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, vaddr = ch->ch_taddr + head; remain = n; - memcpy_toio(vaddr, (u8 *) buf, remain); + memcpy_toio(vaddr, (u8 *)buf, remain); head += remain; } @@ -3829,7 +3829,7 @@ static int dgap_tty_send_break(struct tty_struct *tty, int msec) #if 0 dgap_cmdw(ch, SBREAK, (u16) SBREAK_TIME, 0); #endif - dgap_cmdw(ch, SBREAK, (u16) msec, 0); + dgap_cmdw(ch, SBREAK, (u16)msec, 0); spin_unlock_irqrestore(&ch->ch_lock, lock_flags2); spin_unlock_irqrestore(&bd->bd_lock, lock_flags); @@ -4151,7 +4151,7 @@ static int dgap_tty_digisetedelay(struct channel_t *ch, struct board_t *bd, spin_lock_irqsave(&bd->bd_lock, lock_flags); spin_lock_irqsave(&ch->ch_lock, lock_flags2); - writew((u16) new_digi, &(ch->ch_bs->edelay)); + writew((u16)new_digi, &ch->ch_bs->edelay); dgap_param(ch, bd, un->un_type); @@ -4758,7 +4758,7 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd, u16 head; ulong lock_flags = 0; ulong lock_flags2 = 0; - void __user *uarg = (void __user *) arg; + void __user *uarg = (void __user *)arg; if (!tty || tty->magic != TTY_MAGIC) return -ENODEV; @@ -4810,7 +4810,7 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd, spin_lock_irqsave(&ch->ch_lock, lock_flags2); if (((cmd == TCSBRK) && (!arg)) || (cmd == TCSBRKP)) - dgap_cmdw(ch, SBREAK, (u16) SBREAK_TIME, 0); + dgap_cmdw(ch, SBREAK, (u16)SBREAK_TIME, 0); spin_unlock_irqrestore(&ch->ch_lock, lock_flags2); spin_unlock_irqrestore(&bd->bd_lock, lock_flags); @@ -4837,7 +4837,7 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd, spin_lock_irqsave(&bd->bd_lock, lock_flags); spin_lock_irqsave(&ch->ch_lock, lock_flags2); - dgap_cmdw(ch, SBREAK, (u16) SBREAK_TIME, 0); + dgap_cmdw(ch, SBREAK, (u16)SBREAK_TIME, 0); spin_unlock_irqrestore(&ch->ch_lock, lock_flags2); spin_unlock_irqrestore(&bd->bd_lock, lock_flags); @@ -4864,7 +4864,7 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd, spin_lock_irqsave(&bd->bd_lock, lock_flags); spin_lock_irqsave(&ch->ch_lock, lock_flags2); - dgap_cmdw(ch, SBREAK, (u16) SBREAK_TIME, 0); + dgap_cmdw(ch, SBREAK, (u16)SBREAK_TIME, 0); spin_unlock_irqrestore(&ch->ch_lock, lock_flags2); spin_unlock_irqrestore(&bd->bd_lock, lock_flags); @@ -4888,13 +4888,13 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd, spin_unlock_irqrestore(&bd->bd_lock, lock_flags); return put_user(C_CLOCAL(tty) ? 1 : 0, - (unsigned long __user *) arg); + (unsigned long __user *)arg); case TIOCSSOFTCAR: spin_unlock_irqrestore(&ch->ch_lock, lock_flags2); spin_unlock_irqrestore(&bd->bd_lock, lock_flags); - rc = get_user(arg, (unsigned long __user *) arg); + rc = get_user(arg, (unsigned long __user *)arg); if (rc) return rc; @@ -4959,7 +4959,7 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ch->ch_flags &= ~CH_STOP; head = readw(&(ch->ch_bs->tx_head)); - dgap_cmdw(ch, FLUSHTX, (u16) head, 0); + dgap_cmdw(ch, FLUSHTX, (u16)head, 0); dgap_cmdw(ch, RESUMETX, 0, 0); if (ch->ch_tun.un_flags & (UN_LOW|UN_EMPTY)) { ch->ch_tun.un_flags &= ~(UN_LOW|UN_EMPTY); @@ -5984,7 +5984,7 @@ static int dgap_test_bios(struct board_t *brd) brd->wait_for_bios = 0; while (brd->wait_for_bios < 1000) { /* Check to see if BIOS thinks board is good. (GD). */ - if (word == *(u16 *) "GD") + if (word == *(u16 *)"GD") return 0; msleep_interruptible(10); brd->wait_for_bios++; @@ -6070,12 +6070,12 @@ static int dgap_test_fep(struct board_t *brd) brd->wait_for_fep = 0; while (brd->wait_for_fep < 500) { /* Check to see if FEP is up and running now. */ - if (word == *(u16 *) "OS") { + if (word == *(u16 *)"OS") { /* * Check to see if the board can support FEP5+ commands. */ word = readw(addr + FEP5_PLUS); - if (word == *(u16 *) "5A") + if (word == *(u16 *)"5A") brd->bd_flags |= BD_FEP5PLUS; return 0; @@ -6161,8 +6161,8 @@ static void dgap_do_conc_load(struct board_t *brd, u8 *uaddr, int len) vaddr = brd->re_map_membase; - offset = readw((u16 *) (vaddr + DOWNREQ)); - to_dp = (struct downld_t *) (vaddr + (int) offset); + offset = readw((u16 *)(vaddr + DOWNREQ)); + to_dp = (struct downld_t *)(vaddr + (int)offset); memcpy_toio(to_dp, uaddr, len); /* Tell card we have data for it */ @@ -6621,7 +6621,7 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type, * is requesting a concentrator image from us. */ if ((bd->type == PCX) || (bd->type == PEPC)) { - chk_addr = (u16 *) (vaddr + DOWNREQ); + chk_addr = (u16 *)(vaddr + DOWNREQ); /* Nonzero if FEP is requesting concentrator image. */ check = readw(chk_addr); vaddr = brd->re_map_membase; @@ -6636,7 +6636,7 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type, return ret; } /* Put concentrator firmware loading code here */ - offset = readw((u16 *) (vaddr + DOWNREQ)); + offset = readw((u16 *)(vaddr + DOWNREQ)); memcpy_toio(offset, fw->data, fw->size); dgap_do_conc_load(brd, (char *)fw->data, fw->size) @@ -6719,8 +6719,8 @@ static int dgap_tty_init(struct board_t *brd) ch = brd->channels[0]; vaddr = brd->re_map_membase; - bs = (struct bs_t __iomem *) ((ulong) vaddr + CHANBUF); - cm = (struct cm_t __iomem *) ((ulong) vaddr + CMDBUF); + bs = (struct bs_t __iomem *)((ulong)vaddr + CHANBUF); + cm = (struct cm_t __iomem *)((ulong)vaddr + CMDBUF); brd->bd_bs = bs;