aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/gdm72xx/gdm_wimax.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-03-16Staging: gdm72xx: use !x instead of x == NULLSomya Anand1-1/+1
Functions like devm_kzalloc, kmalloc_array, devm_ioremap, usb_alloc_urb, alloc_netdev return NULL as a return value on failure. Generally, When NULL represents failure, !x is commonly used. This patch cleans up the tests on the results of these functions, thereby using !x instead of x == NULL or NULL == x. This is done via following coccinelle script: @prob_7@ identifier x; statement S; @@ ( x = devm_kzalloc(...); | x = usb_alloc_urb(...); | x = kmalloc_array(...); | x = devm_ioremap(...); | x = alloc_netdev(...); ) ... - if(NULL == x) + if(!x) S Further we have used isomorphism characteristics of coccinelle to indicate x == NULL and NULL == x are equivalent. This is done via following iso script. Expression @ is_null @ expression X; @@ X == NULL <=> NULL == X Signed-off-by: Somya Anand <somyaanand214@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16Staging: gdm72xx: Iterate list using list_for_each_entrySomya Anand1-2/+2
Code using doubly linked list is iterated generally using list_empty and list_entry functions, but it can be better written using list_for_each_entry macro. This patch replaces the while loop containing list_empty and list_entry with list_for_each_entry and list_for_each_entry_safe. list_for_each_entry is a macro which is used to iterate over a list of given type. So while loop used to iterate over a list can be replaced with list_for_each_entry macro. However, if list_del is used in the loop, then list_for_each_entry_safe is a better choice. This transformation is done by using the following coccinelle script. @ rule1 @ expression E1; identifier I1, I2; type T; iterator name list_for_each_entry; @@ - while (list_empty(&E1) == 0) + list_for_each_entry (I1, &E1, I2) { ...when != T *I1; - I1 = list_entry(E1.next, T, I2); ...when != list_del(...); when != list_del_init(...); } @ rule2 @ expression E1; identifier I1, I2; type T; iterator name list_for_each_entry_safe; @@ T *I1; + T *tmp; ... - while (list_empty(&E1) == 0) + list_for_each_entry_safe (I1, tmp, &E1, I2) { ...when != T *I1; - I1 = list_entry(E1.next, T, I2); ... } Signed-off-by: Somya Anand <somyaanand214@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30staging: gdm72xx: Remove useless cast on void pointerTapasweni Pathak1-1/+1
void pointers do not need to be cast to other pointer types. The semantic patch used to find this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T *)x)->f | - (T *) e ) Build tested it. Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20staging: gdm72xx: Removed unnecesarry out of memory usageSarah Khan1-3/+1
WARNING: Possible unnecessary out of memory usage checkpatch.pl warning in gdm_wimax.c Signed-off-by: Sarah Khan <sarahjmi07@gmail.com> Acked-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-06Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-nextLinus Torvalds1-1/+2
Pull networking updates from David Miller: "Highlights: 1) Steady transitioning of the BPF instructure to a generic spot so all kernel subsystems can make use of it, from Alexei Starovoitov. 2) SFC driver supports busy polling, from Alexandre Rames. 3) Take advantage of hash table in UDP multicast delivery, from David Held. 4) Lighten locking, in particular by getting rid of the LRU lists, in inet frag handling. From Florian Westphal. 5) Add support for various RFC6458 control messages in SCTP, from Geir Ola Vaagland. 6) Allow to filter bridge forwarding database dumps by device, from Jamal Hadi Salim. 7) virtio-net also now supports busy polling, from Jason Wang. 8) Some low level optimization tweaks in pktgen from Jesper Dangaard Brouer. 9) Add support for ipv6 address generation modes, so that userland can have some input into the process. From Jiri Pirko. 10) Consolidate common TCP connection request code in ipv4 and ipv6, from Octavian Purdila. 11) New ARP packet logger in netfilter, from Pablo Neira Ayuso. 12) Generic resizable RCU hash table, with intial users in netlink and nftables. From Thomas Graf. 13) Maintain a name assignment type so that userspace can see where a network device name came from (enumerated by kernel, assigned explicitly by userspace, etc.) From Tom Gundersen. 14) Automatic flow label generation on transmit in ipv6, from Tom Herbert. 15) New packet timestamping facilities from Willem de Bruijn, meant to assist in measuring latencies going into/out-of the packet scheduler, latency from TCP data transmission to ACK, etc" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1536 commits) cxgb4 : Disable recursive mailbox commands when enabling vi net: reduce USB network driver config options. tg3: Modify tg3_tso_bug() to handle multiple TX rings amd-xgbe: Perform phy connect/disconnect at dev open/stop amd-xgbe: Use dma_set_mask_and_coherent to set DMA mask net: sun4i-emac: fix memory leak on bad packet sctp: fix possible seqlock seadlock in sctp_packet_transmit() Revert "net: phy: Set the driver when registering an MDIO bus device" cxgb4vf: Turn off SGE RX/TX Callback Timers and interrupts in PCI shutdown routine team: Simplify return path of team_newlink bridge: Update outdated comment on promiscuous mode net-timestamp: ACK timestamp for bytestreams net-timestamp: TCP timestamping net-timestamp: SCHED timestamp on entering packet scheduler net-timestamp: add key to disambiguate concurrent datagrams net-timestamp: move timestamp flags out of sk_flags net-timestamp: extend SCM_TIMESTAMPING ancillary data struct cxgb4i : Move stray CPL definitions to cxgb4 driver tcp: reduce spurious retransmits due to transient SACK reneging qlcnic: Initialize dcbnl_ops before register_netdev ...
2014-07-17staging: gdm72xx: remove debug codeMichalis Pappas1-106/+0
Removed dump_eth_packet() and helper functions called upon packet tx/rx. Signed-off-by: Michalis Pappas <mpappas@fastmail.fm> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-15net: set name_assign_type in alloc_netdev()Tom Gundersen1-1/+2
Extend alloc_netdev{,_mq{,s}}() to take name_assign_type as argument, and convert all users to pass NET_NAME_UNKNOWN. Coccinelle patch: @@ expression sizeof_priv, name, setup, txqs, rxqs, count; @@ ( -alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs) +alloc_netdev_mqs(sizeof_priv, name, NET_NAME_UNKNOWN, setup, txqs, rxqs) | -alloc_netdev_mq(sizeof_priv, name, setup, count) +alloc_netdev_mq(sizeof_priv, name, NET_NAME_UNKNOWN, setup, count) | -alloc_netdev(sizeof_priv, name, setup) +alloc_netdev(sizeof_priv, name, NET_NAME_UNKNOWN, setup) ) v9: move comments here from the wrong commit Signed-off-by: Tom Gundersen <teg@jklm.no> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-09staging: gdm72xx: reorder functions and remove forward declarationsMichalis Pappas1-94/+85
Signed-off-by: Michalis Pappas <mpappas@fastmail.fm> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: gdm72xx: move T_CAPABILITY definitions to hci.hMichalis Pappas1-8/+3
Signed-off-by: Michalis Pappas <mpappas@fastmail.fm> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: gdm72xx: Remove unnecessary memset of netdev private dataTobias Klauser1-2/+0
The memory for struct net_device private data is allocated using kzalloc/vzalloc in alloc_netdev_mqs, thus there is no need to zero it again in the driver. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: gdm72xx: Use net_device_stats from struct net_deviceTobias Klauser1-13/+4
Instead of using an own copy of struct net_device_stats in struct nic, use stats from struct net_device. Also remove the thus unnecessary .ndo_get_stats function, as it would now just return netdev->stats, which is the default in dev_get_stats(). Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: gdm72xx: remove unused codeMichalis Pappas1-18/+0
Remove code surrounded by otherwise unused #define LOOPBACK_TEST Signed-off-by: Michalis Pappas <mpappas@fastmail.fm> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: gdm72xx: clean up endianness conversionsBen Chan1-31/+33
This patch cleans up the endianness conversions in the gdm72xx driver: - Directly use the generic byte-reordering macros for endianness conversion instead of some custom-defined macros. - Convert values on the constant side instead of the variable side when appropriate. - Add endianness annotations. Signed-off-by: Ben Chan <benchan@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26staging: gdm72xx: fix block comment styleBen Chan1-2/+3
This patch fixes the following checkpatch warnings, which are issued when the gdm72xx driver is moved out of staging into drivers/net/wimax: WARNING: networking block comments don't use an empty /* line, use /* Comment... WARNING: networking block comments start with * on subsequent lines WARNING: networking block comments put the trailing */ on a separate line Signed-off-by: Ben Chan <benchan@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26staging: gdm72xx: check return value of sscanfBen Chan1-2/+3
Signed-off-by: Ben Chan <benchan@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24staging: gdm72xx: code cleanupDavide Gianforte1-7/+12
Checkpatch.pl cleanup Thanks again to Greg KH and Dan Carpenter for the patience :) Signed-off-by: Davide Gianforte <davide@gengisdave.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24staging: gdm72xx: return values cleanupGengis Dave1-2/+1
Return values cleanup Signed-off-by: Davide Gianforte <davide@gengisdave.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16staging: gdm72xx: Indentation and other whitespace fixesMichalis Pappas1-11/+10
Signed-off-by: Michalis Pappas <mpappas@fastmail.fm> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16staging: gdm72xx: Whitespace fixes to conform to coding standardsMichalis Pappas1-32/+29
Fixes the following checkpatch.pl issues: WARNING: unnecessary whitespace before a quoted newline CHECK: Alignment should match open parenthesis CHECK: No space is necessary after a cast Also some additional, whitespace related, readability issues. Signed-off-by: Michalis Pappas <mpappas@fastmail.fm> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16staging: gdm72xx: Removed commented-out codeMichalis Pappas1-4/+0
Signed-off-by: Michalis Pappas <mpappas@fastmail.fm> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16staging: gdm72xx: Fix braces to conform with coding styleMichalis Pappas1-8/+8
Fixes the following checkpatch.pl issue: CHECK: braces {} should be used on all arms of this statement Signed-off-by: Michalis Pappas <mpappas@fastmail.fm> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-16staging: gdm72xx: replace printk() and debug macros with dynamic debuggingKristina Martšenko1-19/+9
Replace printk(KERN_DEBUG ...) with netdev_dbg and dev_dbg. Remove debug macros which become unnecessary. This removes the following types of checkpatch warnings from the driver: drivers/staging/gdm72xx/gdm_sdio.c:461: WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ... Signed-off-by: Kristina Martšenko <kristina.martsenko@gmail.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-16staging: gdm72xx: use print_hex_dump_debug and remove debug macrosKristina Martšenko1-39/+1
Since the kernel already has a function for hex dumps, use that instead of the driver's own versions. The function supports dynamic debugging, so also remove some unnecessary debug macros. Signed-off-by: Kristina Martšenko <kristina.martsenko@gmail.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-07Staging: gdm72xx: Fix incorrect type in assignment in gdm_wimax.cMonam Agarwal1-2/+2
This patch fixes following sparse warnings: drivers/staging/gdm72xx/gdm_wimax.c:543:37: warning: incorrect type in argument 1 (different address spaces) drivers/staging/gdm72xx/gdm_wimax.c:543:37: expected void [noderef] <asn:1>*to drivers/staging/gdm72xx/gdm_wimax.c:543:37: got void *buf drivers/staging/gdm72xx/gdm_wimax.c:566:41: warning: incorrect type in argument 2 (different address spaces) drivers/staging/gdm72xx/gdm_wimax.c:566:41: expected void const [noderef] <asn:1>*from drivers/staging/gdm72xx/gdm_wimax.c:566:41: got void *buf Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-07staging:gdm72xx: Fix unnecessary brace errorsHimangi Saraogi1-3/+2
This patch fixes the following warning for gdm_wimax.c WARNING: braces {} are not necessary for any arm of this statement Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-22gdm72xx: remove unnecessary cast in gdm_wimax.cXenia Ragiadakou1-2/+1
This patch removes an unnecessary cast on the return value of alloc_netdev(), since alloc_netdev() returns a pointer to the allocated struct net_device anyway. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-28staging: gdm72xx: use %pI4 format to print IPv4 address and remove last usage of NIP6Shan Wei1-12/+1
commit cf4ca4874fc45 removed the definition of NIPQUAD and NIPQUAD_FMT, and NIP6 also is out of date. commit 2874762b31d8d replace deprecated NIPQUAD marco to C code, but we can use %pI4 to print IPv4 address more simply. And remove constant condition judge. Because DEBUG_SDU is not defined in gdm_wimax.h, no error message when compiling. Signed-off-by: Shan Wei <davidshan@tencent.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30staging/gdm72xx: Use netdev_ or pr_ printks in gdm_wimax.cYAMANE Toshiaki1-29/+31
fixed below checkpatch warnings. - WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... - WARNING: Prefer netdev_emerg(netdev, ... then dev_emerg(dev, ... then pr_emerg(... to printk(KERN_EMERG ... - WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... and add pr_fmt. Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22staging/gdm72xx: gdm_wimax: fix compile error when enable debugMacpaul Lin1-1/+4
Fix compile error when enable DEBUG_SDU and DEBUG_HCI. Replace deprecated NIPQUAD marco to C code. Signed-off-by: Macpaul Lin <macpaul.from.taiwan@gmail.com> Cc: Macpaul Lin <macpaul@gmail.com> Cc: Paul Stewart <pstew@chromium.org> Cc: Ben Chan <benchan@chromium.org> Cc: Sage Ahn <syahn@gctsemi.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-13staging: gdm72xx: fix reference counting in gdm_wimax_event_initBen Chan1-6/+10
This patch fixes the commit "staging/gdm72xx: cleanup little at gdm_wimax_event_rcv" (8df858ea76b76dde9a39d4edd9aaded983582cfe), which mishandles the reference counting of wm_event. Signed-off-by: Ben Chan <benchan@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16staging/gdm72xx: cleanup little at gdm_wimax_event_rcvDevendra Naga1-5/+3
the event sock check is done at the netlink_init itself. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: gdm72xx: use %pM for MACAndy Shevchenko1-7/+2
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Ben Chan <benchan@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-12staging/gdm72xx: Remove version.h includesDevendra Naga1-1/+0
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-17staging: gdm72xx: Set up parent link in sysfs for gdm72xx devicesPaul Stewart1-1/+2
This patch uses SET_NETDEV_DEV to set up a 'device' parent link in sysfs (e.g. /sys/class/net/wm0/device) for a gdm72xx device. Signed-off-by: Paul Stewart <pstew@chromium.org> Signed-off-by: Ben Chan <benchan@chromium.org> Cc: Sage Ahn <syahn@gctsemi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-15staging: gdm72xx: Add GCT GDM72xx WiMAX driver.Sage Ahn1-0/+1025
This patch provides the kernel driver for the GDM72xx WiMAX chips developed by GCT Semiconductor, Inc., which enables mobile WiMAX connection on the Linux host. Signed-off-by: Sage Ahn <syahn@gctsemi.com> Cc: Ben Chan <benchan@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>