diff options
author | Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> | 2015-03-10 19:04:09 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-15 18:41:12 +0100 |
commit | 2f4a748f59924118129306d0e89af7a35b77365e (patch) | |
tree | 5d8805a28f192dadcf864b9693ab5b56c246da7b /drivers/staging/ft1000 | |
parent | 6e2fef9d3260e169c17fc5eea842ff4c64c23e5c (diff) |
staging: ft1000: ft1000-usb: ft1000_hw.c: adjust function arguments
Handles the following issues:
Removing extra parentheses around function arguments,
Removing unnecessary pointer to pointer casts.
Issues were detected using the following coccinelle script:
@@
expression e;
type t;
identifier f;
@@
f(...,
-(t *)
e
,...)
@@
expression e;
identifier f;
@@
f(...,
&
-(
e
-)
,...)
@@
expression e;
identifier f;
@@
f(...,
-(
e
-)
,...)
Parentheses removal were left to the script. However, there were some
cases that were handled manually. In addition, handling pointer casts
were done manually too because not all replacements generated by the
script were suitable. When pointer casts on function arguments were
in the form:
<func>(...,(<type> *)&<expression>,...)
the replacements were discarded due to compilation warnings.
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ft1000')
-rw-r--r-- | drivers/staging/ft1000/ft1000-usb/ft1000_hw.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c index f0ac43838461..26207781abcb 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c @@ -339,7 +339,7 @@ int card_send_command(struct ft1000_usb *ft1000dev, void *ptempbuffer, commandbuf = kmalloc(size + 2, GFP_KERNEL); if (!commandbuf) return -ENOMEM; - memcpy((void *)commandbuf + 2, (void *)ptempbuffer, size); + memcpy((void *)commandbuf + 2, ptempbuffer, size); if (temp & 0x0100) usleep_range(900, 1100); @@ -429,7 +429,7 @@ static void ft1000_reset_asic(struct net_device *dev) /* Let's use the register provided by the Magnemite ASIC to reset the * ASIC and DSP. */ - ft1000_write_register(ft1000dev, (DSP_RESET_BIT | ASIC_RESET_BIT), + ft1000_write_register(ft1000dev, DSP_RESET_BIT | ASIC_RESET_BIT, FT1000_REG_RESET); mdelay(1); @@ -542,7 +542,7 @@ static int ft1000_copy_down_pkt(struct net_device *netdev, u8 *packet, u16 len) hdr.portdest ^ hdr.portsrc ^ hdr.sh_str_id ^ hdr.control; memcpy(&pFt1000Dev->tx_buf[0], &hdr, sizeof(hdr)); - memcpy(&(pFt1000Dev->tx_buf[sizeof(struct pseudo_hdr)]), packet, len); + memcpy(&pFt1000Dev->tx_buf[sizeof(struct pseudo_hdr)], packet, len); netif_stop_queue(netdev); @@ -551,7 +551,7 @@ static int ft1000_copy_down_pkt(struct net_device *netdev, u8 *packet, u16 len) usb_sndbulkpipe(pFt1000Dev->dev, pFt1000Dev->bulk_out_endpointAddr), pFt1000Dev->tx_buf, count, - ft1000_usb_transmit_complete, (void *)pFt1000Dev); + ft1000_usb_transmit_complete, pFt1000Dev); t = (u8 *)pFt1000Dev->tx_urb->transfer_buffer; @@ -606,7 +606,7 @@ static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev) goto err; } - ft1000_copy_down_pkt(dev, (pdata + ENET_HEADER_SIZE - 2), + ft1000_copy_down_pkt(dev, pdata + ENET_HEADER_SIZE - 2, skb->len - ENET_HEADER_SIZE + 2); err: @@ -1558,19 +1558,19 @@ int ft1000_poll(void *dev_id) /* Reset ASIC and DSP */ status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER0, - (u8 *)&(info->DSP_TIME[0]), + (u8 *)&info->DSP_TIME[0], FT1000_MAG_DSP_TIMER0_INDX); status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER1, - (u8 *)&(info->DSP_TIME[1]), + (u8 *)&info->DSP_TIME[1], FT1000_MAG_DSP_TIMER1_INDX); status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER2, - (u8 *)&(info->DSP_TIME[2]), + (u8 *)&info->DSP_TIME[2], FT1000_MAG_DSP_TIMER2_INDX); status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER3, - (u8 *)&(info->DSP_TIME[3]), + (u8 *)&info->DSP_TIME[3], FT1000_MAG_DSP_TIMER3_INDX); info->CardReady = 0; info->DrvErrNum = DSP_CONDRESET_INFO; |