From: Marek Belisko Date: Thu, 10 Mar 2011 10:51:27 +0000 (+0100) Subject: staging: ft1000: Fix coding style in ft1000_start_xmit function. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e31e33855ad9025f25b834305716307801a3d88c;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git staging: ft1000: Fix coding style in ft1000_start_xmit function. Signed-off-by: Marek Belisko Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c index bb1e9d695c27..63ee38c308c0 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c @@ -1022,61 +1022,56 @@ static int ft1000_copy_down_pkt(struct net_device *netdev, u8 * packet, u16 len) static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct ft1000_info *pInfo = netdev_priv(dev); - struct ft1000_device *pFt1000Dev= pInfo->pFt1000Dev; - u8 *pdata; - int maxlen, pipe; - - - //DEBUG(" ft1000_start_xmit() entered\n"); - - if ( skb == NULL ) - { - DEBUG ("ft1000_hw: ft1000_start_xmit:skb == NULL!!!\n" ); - return NETDEV_TX_OK; - } - - if ( pFt1000Dev->status & FT1000_STATUS_CLOSING) - { - DEBUG("network driver is closed, return\n"); - goto err; - } - - //DEBUG("ft1000_start_xmit 1:length of packet = %d\n", skb->len); - pipe = usb_sndbulkpipe(pFt1000Dev->dev, pFt1000Dev->bulk_out_endpointAddr); - maxlen = usb_maxpacket(pFt1000Dev->dev, pipe, usb_pipeout(pipe)); - //DEBUG("ft1000_start_xmit 2: pipe=%d dev->maxpacket = %d\n", pipe, maxlen); - - pdata = (u8 *)skb->data; - /*for (i=0; ilen; i++) - DEBUG("skb->data[%d]=%x ", i, *(skb->data+i)); + struct ft1000_device *pFt1000Dev = pInfo->pFt1000Dev; + u8 *pdata; + int maxlen, pipe; - DEBUG("\n");*/ + //DEBUG(" ft1000_start_xmit() entered\n"); + if (skb == NULL) { + DEBUG("ft1000_hw: ft1000_start_xmit:skb == NULL!!!\n"); + return NETDEV_TX_OK; + } - if (pInfo->mediastate == 0) - { - /* Drop packet is mediastate is down */ - DEBUG("ft1000_hw:ft1000_start_xmit:mediastate is down\n"); - goto err; - } + if (pFt1000Dev->status & FT1000_STATUS_CLOSING) { + DEBUG("network driver is closed, return\n"); + goto err; + } + //DEBUG("ft1000_start_xmit 1:length of packet = %d\n", skb->len); + pipe = + usb_sndbulkpipe(pFt1000Dev->dev, pFt1000Dev->bulk_out_endpointAddr); + maxlen = usb_maxpacket(pFt1000Dev->dev, pipe, usb_pipeout(pipe)); + //DEBUG("ft1000_start_xmit 2: pipe=%d dev->maxpacket = %d\n", pipe, maxlen); + + pdata = (u8 *) skb->data; + /*for (i=0; ilen; i++) + DEBUG("skb->data[%d]=%x ", i, *(skb->data+i)); + + DEBUG("\n"); */ + + if (pInfo->mediastate == 0) { + /* Drop packet is mediastate is down */ + DEBUG("ft1000_hw:ft1000_start_xmit:mediastate is down\n"); + goto err; + } - if ( (skb->len < ENET_HEADER_SIZE) || (skb->len > ENET_MAX_SIZE) ) - { - /* Drop packet which has invalid size */ - DEBUG("ft1000_hw:ft1000_start_xmit:invalid ethernet length\n"); - goto err; - } + if ((skb->len < ENET_HEADER_SIZE) || (skb->len > ENET_MAX_SIZE)) { + /* Drop packet which has invalid size */ + DEBUG("ft1000_hw:ft1000_start_xmit:invalid ethernet length\n"); + goto err; + } //mbelian - ft1000_copy_down_pkt(dev, (pdata+ENET_HEADER_SIZE-2), - skb->len - ENET_HEADER_SIZE + 2); + ft1000_copy_down_pkt(dev, (pdata + ENET_HEADER_SIZE - 2), + skb->len - ENET_HEADER_SIZE + 2); err: dev_kfree_skb(skb); - //DEBUG(" ft1000_start_xmit() exit\n"); + //DEBUG(" ft1000_start_xmit() exit\n"); return NETDEV_TX_OK; } + //--------------------------------------------------------------------------- // // Function: ft1000_copy_up_pkt