Commit graph

619 commits

Author SHA1 Message Date
Baoyou Xie
af8b19c4a8 staging: rtl8192u: remove unused functions in r8192U_core.c
We get 2 warnings when building kernel with W=1:
drivers/staging/rtl8192u/r8192U_core.c:925:12: warning: no previous declaration for 'ieeerate2rtlrate' [-Wmissing-declarations]
drivers/staging/rtl8192u/r8192U_core.c:958:12: warning: no previous declaration for 'rtl8192_rate2rate' [-Wmissing-declarations]
drivers/staging/rtl8192u/r8192U_core.c:1322:11: warning: no previous declaration for 'rtl8192_IsWirelessBMode' [-Wmissing-declarations]

In fact, these functions are unused in
r8192U_core.c, but should be removed.

So this patch removes the unused functions.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-23 19:00:44 +02:00
Baoyou Xie
3590e78a1d staging: rtl8192u: ieee80211: ieee80211_softmac: mark symbols static where possible
We get 5 warnings when building kernel with W=1:
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:287:13: warning: no previous declaration for 'softmac_ps_mgmt_xmit' [-Wmissing-declarations]
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:323:24: warning: no previous declaration for 'ieee80211_probe_req' [-Wmissing-declarations]
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:643:24: warning: no previous declaration for 'ieee80211_authentication_req' [-Wmissing-declarations]
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:981:24: warning: no previous declaration for 'ieee80211_association_req' [-Wmissing-declarations]
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:3094:24: warning: no previous declaration for 'ieee80211_disassociate_skb' [-Wmissing-declarations]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
so this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-23 19:00:44 +02:00
Bhumika Goyal
efdcb35a82 Staging: rtl8192u: Remove useless type conversion
Some type conversions like casting a pointer to a pointer of same type,
casting to the original type using addressof(&) operator etc. are not
needed. Therefore, remove them. Done using coccinelle:

@@
type t;
t *p;
t a;
@@
(
- (t)(a)
+ a
|
- (t *)(p)
+ p
|
- (t *)(&a)
+ &a
)

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20 13:35:45 +02:00
Xavier Roumegue
182eec0eb7 staging: rtl8192u: r8192U_core: fix checkpatch permission warnings
Fix the following warnings:
Symbolic permissions are not preferred. Consider using octal permissions.

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20 13:33:49 +02:00
Nicolas Iooss
5cb6b91068 staging: rtl8192u: do not use undefined $(TOPDIR) in Makefile
drivers/staging/rtl8192u/ieee80211/Makefile uses $(TOPDIR) to configure
an include directory, without defining this variable first. The path
which is configured is therefore "/drivers/net/wireless", which does not
seem to be the intended path.

Remove the offending line.

Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12 12:29:27 +02:00
Arnd Bergmann
f352a9eeb1 staging/rtl8192u: use s8 instead of char
Compiling the rtlwifi drivers for ARM with gcc -Wextra warns about lots of
incorrect code that results from 'char' being unsigned here, e.g.

staging/rtl8192u/r8192U_core.c:4150:16: error: comparison is always false due to limited range of data type [-Werror=type-limits]
staging/rtl8192u/r8192U_dm.c:646:50: error: comparison is always false due to limited range of data type [-Werror=type-limits]

This patch changes all uses of 'char' in this driver that refer to
8-bit integers to use 's8' instead, which is signed on all architectures.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:21:28 +02:00
Wolfram Sang
e89549b91e staging: rtl8192u: r8192U_core: don't print error when allocating urb fails
kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15 15:56:33 +02:00
Binoy Jayan
b53628cbf9 rtl8192u: Remove unused semaphore rf_sem
The semaphore 'rf_sem' in rtl8192u has no users, hence removing it.

Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18 19:50:48 -07:00
Binoy Jayan
87d63bcc0f rtl8192u: Replace semaphore scan_sem with mutex
The semaphore 'scan_sem' in rtl8192u is a simple mutex, so it should
be written as one. Semaphores are going away in the future.

Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18 19:50:48 -07:00
Binoy Jayan
e379a9a879 rtl8192u: ieee80211_device: Replace semaphore wx_sem with mutex
The semaphore 'wx_sem' in ieee80211_device is a simple mutex,
so it should be written as one. Semaphores are going away in the future.

Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18 19:50:48 -07:00
Binoy Jayan
75deebb42d rtl8192u: r8192_priv: Replace semaphore wx_sem with mutex
The semaphore 'wx_sem' in r8192_priv is a simple mutex, so
it should be written as one. Semaphores are going away in the future.

Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18 19:50:48 -07:00
Salah Triki
ec06d48f24 staging: rtl8192u: propagate errors in write_nic_dword
Propagate errors from kzalloc and usb_control_msg and change the
return type of write_nic_dword from void to int.

Signed-off-by: Salah Triki <salah.triki@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18 19:49:02 -07:00
Salah Triki
28d653d7d1 staging: rtl8192u: propagate errors in write_nic_word
Propagate errors from kzalloc and usb_control_msg and change the
return type of write_nic_word from void to int.

Signed-off-by: Salah Triki <salah.triki@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18 19:49:02 -07:00
Salah Triki
6ae4e4b302 staging: rtl8192u: propagate errors in write_nic_byte_E
Propagate errors from  kzalloc and usb_control_msg and change the
return type of write_nic_byte_E from void to int.

Signed-off-by: Salah Triki <salah.triki@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18 19:49:02 -07:00
Salah Triki
ba15f657ce staging: rtl8192u: propagate errors in write_nic_byte
Propagate errors from  kzalloc and usb_control_msg and change the
return type of write_nic_byte from void to int.

Signed-off-by: Salah Triki <salah.triki@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18 19:49:02 -07:00
Salah Triki
4dc2abb852 staging: rtl8192u: check return value of rtl8192_read_eeprom_info
The call of rtl8192_read_eeprom_info may fail, therefore its return
value must be checked and propagated in the case of error

Signed-off-by: Salah Triki <salah.triki@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18 19:49:02 -07:00
Salah Triki
eafe8261c1 staging: rtl8192u: propagate errors in rtl8192_read_eeprom_info
Propagate error from eprom_read and change the return type of
rtl8192_read_eeprom_info from void to int.

Signed-off-by: Salah Triki <salah.triki@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18 19:49:02 -07:00
Salah Triki
16feab644f staging: rtl8192u: check return value eprom_read
The call of eprom_read may fail, therefore its return value must be
checked

Signed-off-by: Salah Triki <salah.triki@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18 19:49:02 -07:00
Salah Triki
6ceb65b837 staging: rtl8192u: propagate errors in eprom_read
Propagate error from eprom_r and change the return type of eprom_read
from u32 to int.

Signed-off-by: Salah Triki <salah.triki@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18 19:49:02 -07:00
Salah Triki
2fe9262e7e staging: rtl8192u: check return value of read_nic_word_E
The call of read_nic_word_E may fail, therefore its return value must be
checked and propagated in the case of error.

Signed-off-by: Salah Triki <salah.triki@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18 19:49:02 -07:00
Linus Torvalds
2f37dd131c Staging and IIO driver update for 4.7-rc1
Here's the big staging and iio driver update for 4.7-rc1.
 
 I think we almost broke even with this release, only adding a few more
 lines than we removed, which isn't bad overall given that there's a
 bunch of new iio drivers added.  The Lustre developers seem to have
 woken up from their sleep and have been doing a great job in cleaning up
 the code and pruning unused or old cruft, the filesystem is almost
 readable :)
 
 Other than that, just a lot of basic coding style cleanups in the churn.
 All have been in linux-next for a while with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlc/00QACgkQMUfUDdst+ynXYQCdG9oEsw4CCItbjGfQau5YVGbd
 TOcAnA19tZz+Wcg3sLT8Zsm979dgVvDt
 =9UG/
 -----END PGP SIGNATURE-----

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

Pull staging and IIO driver updates from Greg KH:
 "Here's the big staging and iio driver update for 4.7-rc1.

  I think we almost broke even with this release, only adding a few more
  lines than we removed, which isn't bad overall given that there's a
  bunch of new iio drivers added.

  The Lustre developers seem to have woken up from their sleep and have
  been doing a great job in cleaning up the code and pruning unused or
  old cruft, the filesystem is almost readable :)

  Other than that, just a lot of basic coding style cleanups in the
  churn.  All have been in linux-next for a while with no reported
  issues"

* tag 'staging-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (938 commits)
  Staging: emxx_udc: emxx_udc: fixed coding style issue
  staging/gdm724x: fix "alignment should match open parenthesis" issues
  staging/gdm724x: Fix avoid CamelCase
  staging: unisys: rename misleading var ii with frag
  staging: unisys: visorhba: switch success handling to error handling
  staging: unisys: visorhba: main path needs to flow down the left margin
  staging: unisys: visorinput: handle_locking_key() simplifications
  staging: unisys: visorhba: fail gracefully for thread creation failures
  staging: unisys: visornic: comment restructuring and removing bad diction
  staging: unisys: fix format string %Lx to %llx for u64
  staging: unisys: remove unused struct members
  staging: unisys: visorchannel: correct variable misspelling
  staging: unisys: visorhba: replace functionlike macro with function
  staging: dgnc: Need to check for NULL of ch
  staging: dgnc: remove redundant condition check
  staging: dgnc: fix 'line over 80 characters'
  staging: dgnc: clean up the dgnc_get_modem_info()
  staging: lustre: lnet: enable configuration per NI interface
  staging: lustre: o2iblnd: properly set ibr_why
  staging: lustre: o2iblnd: remove last of kiblnd_tunables_fini
  ...
2016-05-20 22:20:48 -07:00
Florian Westphal
860e9538a9 treewide: replace dev->trans_start update with helper
Replace all trans_start updates with netif_trans_update helper.
change was done via spatch:

struct net_device *d;
@@
- d->trans_start = jiffies
+ netif_trans_update(d)

Compile tested only.

Cc: user-mode-linux-devel@lists.sourceforge.net
Cc: linux-xtensa@linux-xtensa.org
Cc: linux1394-devel@lists.sourceforge.net
Cc: linux-rdma@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: MPT-FusionLinux.pdl@broadcom.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-can@vger.kernel.org
Cc: linux-parisc@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Cc: linux-hams@vger.kernel.org
Cc: linux-usb@vger.kernel.org
Cc: linux-wireless@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: devel@driverdev.osuosl.org
Cc: b.a.t.m.a.n@lists.open-mesh.org
Cc: linux-bluetooth@vger.kernel.org
Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Acked-by: Antonio Quartulli <a@unstable.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-05-04 14:16:49 -04:00
Florian Westphal
4d0e965732 drivers: replace dev->trans_start accesses with dev_trans_start
a trans_start struct member exists twice:
- in struct net_device (legacy)
- in struct netdev_queue

Instead of open-coding dev->trans_start usage to obtain the current
trans_start value, use dev_trans_start() instead.

This is not exactly the same, as dev_trans_start also considers
the trans_start values of the netdev queues owned by the device
and provides the most recent one.

For legacy devices this doesn't matter as dev_trans_start can cope
with netdev trans_start values of 0 (they are ignored).

This is a prerequisite to eventual removal of dev->trans_start.

Cc: linux-rdma@vger.kernel.org
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-05-04 14:16:47 -04:00
Ben Hutchings
c3f463484b staging: rtl8192u: Fix crash due to pointers being "confusing"
There's no net_device stashed in skb->cb, there's a net_device * there.

To make it *really* clear, also change the write of the dev pointer
into skb->cb from a memcpy() to an assignment.

Fixes: 3fe5632493 ("staging: rtl8192u: r8192U_core.c: Cleaning up ...")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:53:47 -07:00
Nicholas Sim
b8a99fb513 staging: rtl8192u: rewrite NULL comparison for pointers
When testing pointers, it is not necessary to explicitly compare to
NULL. Rewrite if condition as (!ptr) or (ptr) 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:53:47 -07:00
Nicholas Sim
b7141cbaf9 staging: rtl8192u: add blank line after declarations
Add a blank line after function/struct/union/enum declarations for
readability, 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:53:47 -07:00
Nicholas Sim
345c32ab9b staging: rtl8192u: remove blank lines after braces (opening)
Remove unneeded blank lines appearing after opening braces as suggested
by checkpatch.pl

Signed-off-by: Nicholas Sim <nicholassimws@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:53:47 -07:00
Nicholas Sim
708075cf1b staging: rtl8192u: remove blank lines before braces (closing)
Remove unneeded blank lines occuring before closing braces

Signed-off-by: Nicholas Sim <nicholassimws@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:53:47 -07:00
Nik Nyby
58493d8e40 staging: rtl8192u: fix typo in debug message
This fixes a mis-spelled word in a few debug statements.

Signed-off-by: Nik Nyby <nikolas@gnu.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Sandhya Bankar
46347b3e09 Staging: rtl8192u: Remove unnecessary semicolon.
Remove unnecessary semicolon.This issue is found by coccinelle script.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Ben Marsh
6c1c9f9d5a Staging: rtl8192u: remove extra blank lines.
This patch removes blank lines in r8192U_wx.c that were flagged by
checkpatch.pl

Signed-off-by: Ben Marsh <bmarsh94@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Linus Torvalds
9dffdb38d8 Staging driver patches for 4.6-rc1
Here is the big staging driver pull request for 4.6-rc1.
 
 Lots of little things here, over 1600 patches or so.  Notible is all of
 the good Lustre work happening, those developers have finally woken up
 and are cleaning up their code greatly.  The Outreachy intern
 application process is also happening, which brought in another 400 or
 so patches.  Full details are in the very long shortlog.
 
 All of these have been in linux-next with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlbrc3EACgkQMUfUDdst+ylu5ACgpdTKjrZn2vHElW3GRhTpzJdQ
 wz8AoJDeur2DmBkQrKD5/u/WL4UTRNZJ
 =+Q6N
 -----END PGP SIGNATURE-----

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

Pull staging driver updates from Greg KH:
 "Here is the big staging driver pull request for 4.6-rc1.

  Lots of little things here, over 1600 patches or so.  Notable is all
  of the good Lustre work happening, those developers have finally woken
  up and are cleaning up their code greatly.  The Outreachy intern
  application process is also happening, which brought in another 400 or
  so patches.  Full details are in the very long shortlog.

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

* tag 'staging-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1673 commits)
  staging: lustre: fix aligments in lnet selftest
  staging: lustre: report minimum of two buffers for LNet selftest load test
  staging: lustre: test for proper errno code in lstcon_rpc_trans_abort
  staging: lustre: filter remaining extra spacing for lnet selftest
  staging: lustre: remove extra spacing when setting variable for lnet selftest
  staging: lustre: remove extra spacing of variable declartions for lnet selftest
  staging: lustre: fix spacing issues checkpatch reported in lnet selftest
  staging: lustre: remove returns in void function for lnet selftest
  staging: lustre: fix bogus lst errors for lnet selftest
  staging: netlogic: Replacing pr_err with dev_err after the call to devm_kzalloc
  staging: mt29f_spinand: Replacing pr_info with dev_info after the call to devm_kzalloc
  staging: android: ion: fix up file mode
  staging: ion: debugfs invalid gfp mask
  staging: rts5208: Replace pci_enable_device with pcim_enable_device
  Staging: ieee80211: Place constant on right side of the test.
  staging: speakup: Replace del_timer with del_timer_sync
  staging: lowmemorykiller: fix 2 checks that checkpatch complained
  staging: mt29f_spinand: Drop void pointer cast
  staging: rdma: hfi1: file_ops: Replace ALIGN with PAGE_ALIGN
  staging: rdma: hfi1: driver: Replace IS_ALIGNED with PAGE_ALIGNED
  ...
2016-03-17 22:13:41 -07:00
Sandhya Bankar
56c4a79958 Staging: ieee80211: Place constant on right side of the test.
Place constant on right side of the test.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar
db7425b130 staging: rtl8192u: ieee80211_crypt: Remove unnecessary else after return
This patch fixes the checkpatch warning that else is not generally
useful after a break or return.

This was done using Coccinelle:
@@
expression e2;
statement s1;
@@
if(e2) { ... return ...; }
-else
         s1

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhumika Goyal
0834ffac90 Staging: rtl8192u: Replace random_ether_addr with eth_random_addr
The macro random_ether_addr is calling the function eth_random_addr.
Therefore, the call to random_ether_addr can be replaced with
eth_random_addr.
Remove the wrapper function ieee80211_randomize_cell and replace its
call with eth_random_addr as it is wrapping random_ether_addr.
Done using coccinelle:

@@
expression addr;
@@
- random_ether_addr(addr);
+ eth_random_addr(addr);

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhumika Goyal
f80c1d5763 Staging: rtl8192u: Replace memset with eth_broadcast_addr
Use eth_broadcast_addr to assign the broadcast address to the given
address array instead of memset when the second argument is a broacast
address 0xff. ETH_ALEN is a macro with value 6, so 6 is treated as
ETH_ALEN if it is the third argument of memset.

Done using coccinelle.
@@
expression e;
@@
- memset(e,\(0xff\|0xFF\|255\),\(ETH_ALEN\|6\));
+ eth_broadcast_addr(e);

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar
7288cadc19 staging: rtl8192u: ieee80211: Remove unused variables
The pointer *skb2 is declared 'globally' inside  ifdef NOT_YET.
It's used nowhere in the directory.
Another pointer *skb2 is declared 'locally', again inside another ifdef NOT_YET
in the function ieee80211_rx_frame_mgmt.
Hence, skb2 stays unused and has been removed.

This was done using Coccinelle:

@@ type T; identifier i; constant c; @@
-T i;
<... when != i
-i = c;
...>

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhumika Goyal
5a95f073b6 Staging: rtl8192u: Remove debug messages
As kmalloc generates a backtrace on failure so there is no need of
these debug messages when kmalloc fails. Also remove unwanted {} around if
block after removal of these messages.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhumika Goyal
61645cc312 Staging: rtl8192u: Clean up tests if NULL returned on failure
Some functions return Null as their return value on failure. !x is
generally preferred over x==NULL or NULL==x. So make use of !x if
the value returned on failure is NULL.
Done using coccinelle:
@@
expression e;
statement S;
@@
e = \(kmalloc\|devm_kzalloc\|kmalloc_array
     \|devm_ioremap\|usb_alloc_urb\|alloc_netdev\)(...);
- if(e==NULL)
+ if(!e)
  S

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar
f705a2dddd staging: rtl8192u: ieee802111: Drop Useless Initialization
Removed initialisation of a varible if it is immediately reassigned.
Changes were made using Coccinelle.
@bad@
identifier i;
position p;
@@

i =@p <+...i...+>;

@@
type T;
constant C;
expression e;
identifier i;
position p != bad.p;
@@
T i
- = C
;
i =@p e;

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar
b1b20e7155 staging: rtl8192u: ieee80211: Use macro DIV_ROUND_UP
The macro DIV_ROUND_UP performs the computation
(((n) + (d) - 1) /(d)). It clarifies the divisor calculations.
This was done using the coccinelle script:
@@
expression e1;
expression e2;
@@
(
- ((e1) + e2 - 1) / (e2)
+ DIV_ROUND_UP(e1,e2)
|
- ((e1) + (e2 - 1)) / (e2)
+ DIV_ROUND_UP(e1,e2)
)

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar
1761a85c3b staging: rtl8192u: Remove create_workqueue()
With cmwq, use of dedicated workqueues can be replaced by system_wq.
Removed the dedicated workqueue and used system_wq instead.

Since the work items in the workqueues do not need to
be ordered, increase of concurrency by switching to system_wq should
not break anything.

All work items are sync canceled so it is guaranteed that no work is
running when driver is detached.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:09:57 -08:00
Bhumika Goyal
f59140964b Staging: rtl8192u: Convert long if-else block to switch-case
Replace long if-else block with switch-case to make it more readable and
compact.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:09:57 -08:00
Bhumika Goyal
8cce78a73f Staging: rtl819u: ieee80211: Remove function ieee80211_wep_null
Remove function ieee80211_wep_null from the file as is it blank and
remove its declaration from the header file.
Also remove its function call as it is of no use calling this function.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:49:09 -08:00
Bhumika Goyal
c8279611f3 Staging: rtl8192u: Remove useless comments
Remove the commented out places where macros PlatformAcquireSpinLock and
PlatformReleaseSpinLock are called as these macros are no longer used.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:49:09 -08:00
Janani Ravichandran
04bdfd20e0 staging: rtl8192u: ieee80211: Fix comment style
This patch changes some C99-style "//..." comments to C89 "/* ... */" style.

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:38:11 -08:00
Amitoj Kaur Chawla
e4d31fbad2 staging: rtl8192u: ieee80211: Remove msleep_interruptible_rsl Macro
Remove driver specific macro msleep_interruptible_rsl as it has been
replaced by a direct call to msleep_interruptible in the single
instance referencing it.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Reviewed-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:38:11 -08:00
Amitoj Kaur Chawla
3a341db3db staging: rtl8192u: ieee80211: ieee80211_softmac: Replace driver specific macro msleep_interruptible_rsl
Replace driver specific msleep_interruptible_rsl macro with direct
call to msleep_interruptible.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Reviewed-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:38:11 -08:00
Amitoj Kaur Chawla
4ebeaf5133 staging: rtl8192u: ieee80211: Remove MSECS macro
Remove driver specific macro MSECS since all instances of this macro
have been replaced by direct calls to msecs_to_jiffies().

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:38:11 -08:00
Amitoj Kaur Chawla
e6be66fff7 staging: rtl8192u: r8192U_dm: Replace MSECS with msecs_to_jiffies
Replace driver specific macro MSECS with msecs_to_jiffies().

This was found using the following Coccinelle semantic patch:

//<smpl>
@@
expression e;
@@

- MSECS(e)
+ msecs_to_jiffies(e)
//</smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:38:11 -08:00