Commit graph

116 commits

Author SHA1 Message Date
Andy Pusch 8f3614c5c6 Staging: wlan-ng: hfa384x_usb: fixed two line limit coding style issues
Fixed two coding style issues.

Signed-off-by: Andy Pusch <drag@black-pixel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:41:36 +01:00
Greg Kroah-Hartman f7056d335d staging: wlan-ng: add SPDX identifiers to all wlan-ng driver files
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the wlan-ng driver files with the correct SPDX license identifier
based on the license text in the file itself.  The SPDX identifier is a
legally binding shorthand, which can be used instead of the full boiler
plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28 13:20:47 +01:00
Linus Torvalds 894025f24b USB/PHY patches for 4.15-rc1
Here is the big set of USB and PHY driver updates for 4.15-rc1.
 
 There is the usual amount of gadget and xhci driver updates, along with
 phy and chipidea enhancements.  There's also a lot of SPDX tags and
 license boilerplate cleanups as well, which provide some churn in the
 diffstat.
 
 Other major thing is the typec code that moved out of staging and into
 the "real" part of the drivers/usb/ tree, which was nice to see happen.
 
 All of these have been in linux-next with no reported issues for a
 while.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCWgm/Vw8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+yktXwCdGgpInfOEvOGFd83EPDL7a1ncyc4AoM5wI8yl
 1CeLipqVIN3IsMMJptvb
 =zvDI
 -----END PGP SIGNATURE-----

Merge tag 'usb-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB/PHY updates from Greg KH:
 "Here is the big set of USB and PHY driver updates for 4.15-rc1.

  There is the usual amount of gadget and xhci driver updates, along
  with phy and chipidea enhancements. There's also a lot of SPDX tags
  and license boilerplate cleanups as well, which provide some churn in
  the diffstat.

  Other major thing is the typec code that moved out of staging and into
  the "real" part of the drivers/usb/ tree, which was nice to see
  happen.

  All of these have been in linux-next with no reported issues for a
  while"

* tag 'usb-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (263 commits)
  usb: gadget: f_fs: Fix use-after-free in ffs_free_inst
  USB: usbfs: compute urb->actual_length for isochronous
  usb: core: message: remember to reset 'ret' to 0 when necessary
  USB: typec: Remove remaining redundant license text
  USB: typec: add SPDX identifiers to some files
  USB: renesas_usbhs: rcar?.h: add SPDX tags
  USB: chipidea: ci_hdrc_tegra.c: add SPDX line
  USB: host: xhci-debugfs: add SPDX lines
  USB: add SPDX identifiers to all remaining Makefiles
  usb: host: isp1362-hcd: remove a couple of redundant assignments
  USB: adutux: remove redundant variable minor
  usb: core: add a new usb_get_ptm_status() helper
  usb: core: add a 'type' parameter to usb_get_status()
  usb: core: introduce a new usb_get_std_status() helper
  usb: core: rename usb_get_status() 'type' argument to 'recip'
  usb: core: add Status Type definitions
  USB: gadget: Remove redundant license text
  USB: gadget: function: Remove redundant license text
  USB: gadget: udc: Remove redundant license text
  USB: gadget: legacy: Remove redundant license text
  ...
2017-11-13 21:14:07 -08:00
Felipe Balbi d9e1e1484a usb: core: introduce a new usb_get_std_status() helper
This new helper is a simple wrapper around usb_get_status(). This
patch is in preparation to adding support for fetching PTM_STATUS
types. No functional changes.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-07 15:47:19 +01:00
Kees Cook 5eb54a9997 staging: wlan-ng: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Cc: Adrien Descamps <adrien.descamps@gmail.com>
Cc: Thibaut SAUTEREAU <thibaut.sautereau@telecom-sudparis.eu>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-20 14:42:50 +02:00
Alex Briskin bf334c024f staging: wlan-ng: hfa384x_usb: Fix multiple line dereference
Refactor code to be more readable and eliminate the checkpatch
warning

Signed-off-by: Alex Briskin <br.shurik@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-20 11:10:23 -07:00
Linus Torvalds 5518b69b76 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller:
 "Reasonably busy this cycle, but perhaps not as busy as in the 4.12
  merge window:

   1) Several optimizations for UDP processing under high load from
      Paolo Abeni.

   2) Support pacing internally in TCP when using the sch_fq packet
      scheduler for this is not practical. From Eric Dumazet.

   3) Support mutliple filter chains per qdisc, from Jiri Pirko.

   4) Move to 1ms TCP timestamp clock, from Eric Dumazet.

   5) Add batch dequeueing to vhost_net, from Jason Wang.

   6) Flesh out more completely SCTP checksum offload support, from
      Davide Caratti.

   7) More plumbing of extended netlink ACKs, from David Ahern, Pablo
      Neira Ayuso, and Matthias Schiffer.

   8) Add devlink support to nfp driver, from Simon Horman.

   9) Add RTM_F_FIB_MATCH flag to RTM_GETROUTE queries, from Roopa
      Prabhu.

  10) Add stack depth tracking to BPF verifier and use this information
      in the various eBPF JITs. From Alexei Starovoitov.

  11) Support XDP on qed device VFs, from Yuval Mintz.

  12) Introduce BPF PROG ID for better introspection of installed BPF
      programs. From Martin KaFai Lau.

  13) Add bpf_set_hash helper for TC bpf programs, from Daniel Borkmann.

  14) For loads, allow narrower accesses in bpf verifier checking, from
      Yonghong Song.

  15) Support MIPS in the BPF selftests and samples infrastructure, the
      MIPS eBPF JIT will be merged in via the MIPS GIT tree. From David
      Daney.

  16) Support kernel based TLS, from Dave Watson and others.

  17) Remove completely DST garbage collection, from Wei Wang.

  18) Allow installing TCP MD5 rules using prefixes, from Ivan
      Delalande.

  19) Add XDP support to Intel i40e driver, from Björn Töpel

  20) Add support for TC flower offload in nfp driver, from Simon
      Horman, Pieter Jansen van Vuuren, Benjamin LaHaise, Jakub
      Kicinski, and Bert van Leeuwen.

  21) IPSEC offloading support in mlx5, from Ilan Tayari.

  22) Add HW PTP support to macb driver, from Rafal Ozieblo.

  23) Networking refcount_t conversions, From Elena Reshetova.

  24) Add sock_ops support to BPF, from Lawrence Brako. This is useful
      for tuning the TCP sockopt settings of a group of applications,
      currently via CGROUPs"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1899 commits)
  net: phy: dp83867: add workaround for incorrect RX_CTRL pin strap
  dt-bindings: phy: dp83867: provide a workaround for incorrect RX_CTRL pin strap
  cxgb4: Support for get_ts_info ethtool method
  cxgb4: Add PTP Hardware Clock (PHC) support
  cxgb4: time stamping interface for PTP
  nfp: default to chained metadata prepend format
  nfp: remove legacy MAC address lookup
  nfp: improve order of interfaces in breakout mode
  net: macb: remove extraneous return when MACB_EXT_DESC is defined
  bpf: add missing break in for the TCP_BPF_SNDCWND_CLAMP case
  bpf: fix return in load_bpf_file
  mpls: fix rtm policy in mpls_getroute
  net, ax25: convert ax25_cb.refcount from atomic_t to refcount_t
  net, ax25: convert ax25_route.refcount from atomic_t to refcount_t
  net, ax25: convert ax25_uid_assoc.refcount from atomic_t to refcount_t
  net, sctp: convert sctp_ep_common.refcnt from atomic_t to refcount_t
  net, sctp: convert sctp_transport.refcnt from atomic_t to refcount_t
  net, sctp: convert sctp_chunk.refcnt from atomic_t to refcount_t
  net, sctp: convert sctp_datamsg.refcnt from atomic_t to refcount_t
  net, sctp: convert sctp_auth_bytes.refcnt from atomic_t to refcount_t
  ...
2017-07-05 12:31:59 -07:00
yuan linyu b952f4dff2 net: manual clean code which call skb_put_[data:zero]
Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-20 13:30:15 -04:00
Johannes Berg 59ae1d127a networking: introduce and use skb_put_data()
A common pattern with skb_put() is to just want to memcpy()
some data into the new space, introduce skb_put_data() for
this.

An spatch similar to the one for skb_put_zero() converts many
of the places using it:

    @@
    identifier p, p2;
    expression len, skb, data;
    type t, t2;
    @@
    (
    -p = skb_put(skb, len);
    +p = skb_put_data(skb, data, len);
    |
    -p = (t)skb_put(skb, len);
    +p = skb_put_data(skb, data, len);
    )
    (
    p2 = (t2)p;
    -memcpy(p2, data, len);
    |
    -memcpy(p, data, len);
    )

    @@
    type t, t2;
    identifier p, p2;
    expression skb, data;
    @@
    t *p;
    ...
    (
    -p = skb_put(skb, sizeof(t));
    +p = skb_put_data(skb, data, sizeof(t));
    |
    -p = (t *)skb_put(skb, sizeof(t));
    +p = skb_put_data(skb, data, sizeof(t));
    )
    (
    p2 = (t2)p;
    -memcpy(p2, data, sizeof(*p));
    |
    -memcpy(p, data, sizeof(*p));
    )

    @@
    expression skb, len, data;
    @@
    -memcpy(skb_put(skb, len), data, len);
    +skb_put_data(skb, data, len);

(again, manually post-processed to retain some comments)

Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-16 11:48:37 -04:00
Nikola Jelic 126ef7760b staging: wlan-ng: hfa384x: fix several type issues.
There were several in-place conversions of 16 and 32-bit data, which caused
sparse to detect them. Changed them to the in situ versions, such as:
le16_to_cpu -> le16_to_cpus

Signed-off-by: Nikola Jelic <nikola.jelic83@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:41:38 +02:00
Adrien Descamps 68e009ed1c Staging: wlan-ng: Fix endian error
sparse report fixed:
drivers/staging//wlan-ng//hfa384x_usb.c:3517:35: warning: restricted __be64 degrades to integer
drivers/staging//wlan-ng//hfa384x_usb.c:3517:33: warning: incorrect type in assignment (different base types)
drivers/staging//wlan-ng//hfa384x_usb.c:3517:33:    expected restricted __be64 [usertype] mactime
drivers/staging//wlan-ng//hfa384x_usb.c:3517:33:    got unsigned long long

Computation on the value should be done when in machine format, not in big endian format.

Signed-off-by: Adrien Descamps <adrien.descamps@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12 15:17:02 +01:00
Adrien Descamps a18ffdf4ea Staging: wlan-ng: Fix sparse warnings by using appropriate endian types
Fix some sparse warning by using correct endian types in structs and
local variables.
This patch only fix sparse warnings and do not change the logic.

Signed-off-by: Adrien Descamps <adrien.descamps@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12 15:17:02 +01:00
Tobias Klauser 4a7c972644 net: Remove usage of net_device last_rx member
The network stack no longer uses the last_rx member of struct net_device
since the bonding driver switched to use its own private last_rx in
commit 9f24273837 ("bonding: use last_arp_rx in slave_last_rx()").

However, some drivers still (ab)use the field for their own purposes and
some driver just update it without actually using it.

Previously, there was an accompanying comment for the last_rx member
added in commit 4dc89133f4 ("net: add a comment on netdev->last_rx")
which asked drivers not to update is, unless really needed. However,
this commend was removed in commit f8ff080dac ("bonding: remove
useless updating of slave->dev->last_rx"), so some drivers added later
on still did update last_rx.

Remove all usage of last_rx and switch three drivers (sky2, atp and
smc91c92_cs) which actually read and write it to use their own private
copy in netdev_priv.

Compile-tested with allyesconfig and allmodconfig on x86 and arm.

Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Jay Vosburgh <j.vosburgh@gmail.com>
Cc: Veaceslav Falico <vfalico@gmail.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Cc: Mirko Lindner <mlindner@marvell.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-18 17:22:49 -05:00
Yan Laijun e895f00a84 Staging: wlan-ng: hfa384x_usb.c Fixed too long code line warnings.
Fixed checkpatch warning "line over 80 characters" in
wlan-ng/hfa384x_usb.c file.

Signed-off-by: Yan Laijun <yan.laijun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-12-06 10:18:07 +01:00
Sergio Paracuellos d1866af104 staging: wlan-ng: match open parenthesis alignment in hfa384x_usb.c
This patch fix open parenthesis alignment in hfa384x_usb.c file to
comply with the standard kernel coding style.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-10 13:25:32 +01:00
Sergio Paracuellos 1bca0df4ab staging: wlan-ng: replace BUG_ON() into WARN_ON() on hfa384x_usbin_callback
This patch avoids using BUG_ON() from driver,
and return from hfa384x_usbin_callback with WARN_ON()
if skb was NULL or data in skb is different from expected one.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-10 13:25:32 +01:00
Sergio Paracuellos 3883cd56b5 staging: wlan-ng: remove unnecessary parenthesis in hfa384x_usb.c
This patch removes unnecessary parentheses in different statements of
hfa384x_usb.c file in order to to comply with the standard kernel
coding style.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-10 13:25:32 +01:00
Sergio Paracuellos a567d0d47f staging: wlan-ng: Replace data type declaration with variable of same type in hfa384x_usb.c
sizeof(var) instead of sizeof(struct XXX) is preferred.
Fix it in hfa384x_usb.c file.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:26:21 +02:00
Sergio Paracuellos 173bf7e37f staging: wlan-ng: avoid new typedef CTLX_STATE
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs

It applies for typedef CTLX_STATE

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:25:44 +02:00
Sergio Paracuellos d3fcb8a276 staging: wlan-ng: fix block comment warnings in hfa384x_usb.c
This patch fix the following checkpatch.pl warnings in hfa384x_usb.c:
 WARNING: Block comments should align the * on each line
 WARNING: Block comments use a trailing */ on a separate line

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:25:33 +02:00
Sergio Paracuellos 5a919c7887 staging: wlan-ng: fix line style warnings in hfa384x_usb.c
This patch fix the following checkpatch.pl warnings in hfa384x_usb.c:
WARNING: line over 80 characters

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:25:32 +02:00
Sergio Paracuellos 5a2214e2e0 staging: wlang-ng: avoid new typedef: hfa384x_t
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs

It applies for typedef hfa384x_t

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02 17:05:56 +02:00
Sergio Paracuellos e2f503c40d staging: wlang-ng: avoid new typedef: hfa384x_metacmd_t
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs

It applies for typedef hfa384x_metacmd_t

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02 17:03:56 +02:00
Sergio Paracuellos a10d36b083 staging: wlang-ng: avoid new typedef: hfa384x_usbctlx_t
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs

It applies for typedef hfa384x_usbctlx_t

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02 17:03:56 +02:00
Sergio Paracuellos b3fd890e1b staging: wlang-ng: avoid new typedef: hfa384x_rridresult_t
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs

It applies for typedef hfa384x_rridresult_t

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02 17:03:56 +02:00
Sergio Paracuellos 501f5f96b3 staging: wlang-ng: avoid new typedef: hfa384x_cmdresult_t
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs

It applies for typedef hfa384x_cmdresult_t

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02 17:03:56 +02:00
Sergio Paracuellos 3e4180c3e8 staging: wlang-ng: avoid new typedef: hfa384x_usbin_t
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs

It applies for typedef hfa384x_usbin_t

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02 17:03:53 +02:00
Sergio Paracuellos 1ed548063b staging: wlang-ng: avoid new typedef: hfa384x_usb_rmemresp_t
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs

It applies for typedef hfa384x_usb_rmemresp_t

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02 17:03:53 +02:00
Sergio Paracuellos a988c9f3ea staging: wlang-ng: avoid new typedef: hfa384x_usb_rridresp_t
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs

It applies for typedef hfa384x_usb_rridresp_t

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02 17:03:52 +02:00
Sergio Paracuellos 385a79df4b staging: wlang-ng: avoid new typedef: hfa384x_usb_cmdresp_t
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs

It applies for typedef hfa384x_usb_cmdresp_t

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02 17:03:52 +02:00
Sergio Paracuellos 684b2e087f staging: wlang-ng: avoid new typedef: hfa384x_usb_rxfrm_t
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs

It applies for typedef hfa384x_usb_rxfrm_t

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02 17:03:52 +02:00
Sergio Paracuellos 70adf50956 staging: wlang-ng: avoid new typedef: hfa384x_rx_frame_t
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs

It applies for typedef hfa384x_rx_frame_t

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02 17:00:48 +02:00
Sergio Paracuellos eb76afc917 staging: wlang-ng: avoid new typedef: hfa384x_tx_frame_t
This patch fixes the following checkpatch.pl warning in hfa384x.h:
WARNING: do not add new typedefs

It applies for typedef hfa384x_tx_frame_t

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02 17:00:48 +02:00
sayli karnik c9573a8d19 staging: wlan-ng: Remove the typedef to the 'wlandevice' structure
This patch removes the typedef 'wlandevice_t' to the 'wlandevice'
structure.

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-18 12:39:31 +02:00
Nicholas Sim 02e020480d staging: wlan-ng: rewrite NULL comparison
It is not necessary to compare explicitly to NULL. Rewrite if condition
as (!dev) or (dev) as suggested in Documentation/CodingStyle

Signed-off-by: Nicholas Sim <nicholassimws@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:43:15 -07:00
Eva Rachel Retuya e2e77528a7 staging: wlan-ng: simplify NULL tests
Replace direct comparisons to NULL i.e. 'x == NULL' with '!x' for
consistency. Coccinelle semantic patch used:

@@
identifier func;
expression x;
statement Z;
@@

x = func(...);

if (
(
+	!
	x
-	== NULL
|
+	!
-	NULL ==
	x
)
   ) Z

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Amitoj Kaur Chawla 5850c251fa staging: wlan-ng: Remove unnecessary macro
Remove unnecessary macro SUBMIT_URB by replacing it with a direct call
to usb_submit_urb()

This change was made with the help of the following Coccinelle semantic
patch:

//<smpl>
@@
identifier f,g;
@@
* #define f(...) g(...)
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhumika Goyal 896774f631 Staging: wlan-ng: Remove unused functions and prototypes
hfa384x_drvr_getconfig_async is not used anywhere in the kernel
so remove it. Also remove its prototype from the header file. Also
the function hfa384x_cb_rrid was only used by hfa384x_drvr_getconfig_async
so remove its definition and prototype as well.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:53:27 -08:00
Bhumika Goyal 49e845a087 Staging: wlan-ng: Remove function hfa384x_drvr_commtallies
The function hfa384x_drvr_commtallies is not used anywhere in the kernel
so remove it. Also remove its prototype from the header file.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:53:27 -08:00
Bhumika Goyal ca026a3504 Staging:wlan-ng:Merged two lines into one
The last two lines of these functions are compressed into one.
Also removed the variable ret as it is now not used.
Found using coccinelle:
@@
expression e, ret;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-09 17:43:09 -08:00
Geliang Tang 57477bf0d9 staging: wlan-ng: use list_for_each_entry*
Use list_for_each_entry*() instead of list_for_each*() to simplify
the code.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:06:36 -08:00
Bogicevic Sasa 6c37e1f957 drivers:staging:wlan-ng Fix space preferred around that messages
This fixes all "space preferred around that ..." messages from
checkpatch.pl

Signed-off-by: Bogicevic Sasa <brutallesale@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:06:36 -08:00
Amitoj Kaur Chawla 6ba714bb5f staging: wlan-ng: hfa384x_usb: Remove wrapper function
Remove wrapper function that can be replaced by a single line of code.

As a result of the change, there is an unused variable which has also
been removed in this patch.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Amitoj Kaur Chawla 4e2cdf9324 staging: wlan-ng: Remove wrapper function
Remove wrapper function that can be replaced by a single line of code.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Amitoj Kaur Chawla df18b9304e staging: wlan-ng: Remove useless initialization
Remove intialisation of a variable that is immediately reassigned.

The semantic patch used to find this is:

// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@

T x
- = C
 ;
x = e;
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:51:48 -07:00
Navya Sri Nizamkari d0edf4bcfa staging: wlan-ng: Use kzalloc instead of kmalloc.
This patch uses kzalloc instead of kmalloc function.
A coccinelle script was used to make this change.

Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15 18:41:10 +01:00
Aya Mahfouz 2f83aeda56 staging: wlan-ng: replace init_timer by setup_timer
This patch replaces init_timer and the 2 step initialization of function
and data by setup_timer to make the code more concise.

The issue was discovered using the following coccinelle script:

@@
expression ds, e1, e2;
@@

-init_timer (&ds);
+setup_timer (&ds, e1, e2);
...
(
-ds.function = e1;
...
-ds.data = e2;
|
-ds.data = e2;
...
-ds.function = e1;
)

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 13:12:40 -08:00
Asaf Vertz a78d131265 staging: wlan-ng: hfa384x_usb: fix sparse endianness warnings
Fixed the following warnings (reported by sparse):
drivers/staging/wlan-ng/hfa384x_usb.c:3828:36: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3229:16: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3430:18: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3349:51: warning: restricted __le16 degrades to integer
drivers/staging/wlan-ng/hfa384x_usb.c:3357:37: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3358:37: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3393:36: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3102:28: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3004:28: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:1308:37: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:2713:25: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/hfa384x_usb.c:2713:25:    expected unsigned short [unsigned] [usertype] type
drivers/staging/wlan-ng/hfa384x_usb.c:2713:25:    got restricted __le16 [usertype] <noident>

Signed-off-by: Asaf Vertz <asaf.vertz@tandemg.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:19 +08:00
Masanari Iida 1a6dfce737 staging: wlan-ng: Fix typo in comments and printk
This patch fix spelling typo in comments and print.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 16:10:48 -08:00
Eduardo Barretto 81980c16e2 Staging: wlan-ng: hfa384x_usb: fixed an 'else' statement coding style issue
Removed useless 'else' statement that followed an 'if' statement that
had a return 1 and moved all the content from the 'else' to outside of
the switch case, this way if any case is sufficient it returns '1',
otherwise it will return 0.

Signed-off-by: Eduardo Barretto <edusbarretto@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 16:10:48 -08:00