Commit graph

20 commits

Author SHA1 Message Date
Georgiana Rodica Chelu
03806ab307 staging: ks7010: ks_wlan_net: Use netdev_info instead of printk
Pass the net_device structure to print_hif_event function
in order to use netdev_info instead of printk.

Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-27 13:03:57 +02:00
Georgiana Rodica Chelu
c8be646105 staging: ks7010: ks_wlan_net: Use netdev_ instead of printk
The checkpatch.pl script found the following warning:

WARNING: printk() should include KERN_ facility level

After adding the KERN_ facility level to printk(), the script showed
another warning:

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then
dev_info(dev, ... then pr_info(...  to printk(KERN_INFO ...

The warning is similar for KERN_ERR and KERN_DEBUG. In conclusion,
use netdev_info(), netdev_err() or netdev_dbg() when there is
a netdev device.

Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-27 13:03:57 +02:00
Georgiana Rodica Chelu
7a4abee97f staging: ks7010: ks_wlan_net: Remove return statement from void function
Remove the return statement from the end of a void function
to clean up the code.

Issue found by checkpatch.pl script.

Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-25 12:37:14 +02:00
Georgiana Rodica Chelu
55adb7bf5a staging: ks7010: ks_wlan_net: Remove unnecessary variable used to store return value
Remove unneeded code in order to make clear
that the function returns 0(success) in all cases.

Done using returnvar.cocci script.

Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-25 12:37:14 +02:00
Baoyou Xie
e4e8d968a3 Staging: ks7010: remove unused function in ks_wlan_net.c
We get 1 warning when building kernel with W=1:
drivers/staging/ks7010/ks_wlan_net.c:3520:5: warning: no previous prototype for 'ks_wlan_reset' [-Wmissing-prototypes]

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

So this patch removes the unused function.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-23 19:00:59 +02:00
Bhumika Goyal
2751bc918e Staging: ks7010: Remove extern keyword from function declaration
Remove extern specifier from function declaration as they have
it by default. Also move extern declaration from .c files to
their respective header file 'ks_hostif.h'. Coccinelle was used
to remove extern and other changes were done by hand.
Script:
@@
identifier func;
type T;
@@
- extern
T func(...);

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-17 23:36:53 +02:00
Bhumika Goyal
30b48e2dbe Staging: ks7010: Replace memset with eth_zero_addr
Use eth_zero_addr to assign zero address to the given address array
instead of memset when the second argument in memset is address
of zero. Coccinelle was used to do the replacement and add the
header file linux/etherdevice.h if not already present.
Script:
@header@
@@
#include <linux/etherdevice.h>

@r1@
expression e;
@@

-memset(e,0,ETH_ALEN);
+eth_zero_addr(e);

@includeheader depends on r1 && !header@
@@
+ #include <linux/etherdevice.h>
#include <...>

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-17 23:32:13 +02:00
Wei Yongjun
e30ed33d19 staging: ks7010: remove unused including <linux/version.h>
Remove including <linux/version.h> that don't need it.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16 09:58:50 +02:00
sayli karnik
c7e65f4d2f staging: ks7010: Remove the explicit NULL comparison
The patch removes the explicit null comparisons entirely for the ks7010 driver.
This was detected by checkpatch.pl

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 15:01:29 +02:00
Colin Ian King
8defffb208 staging: ks7010: avoid dereferencing packet if it is null
Updating tx_bytes from packet->len if packet is null will cause
a null pointer dereference, so only update tx_bytes if it packet
is not null.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12 11:18:15 +02:00
Dan Carpenter
453e102db5 staging: ks7010: remove bogus NULL checks
enc->rx_seq[] and enc->key[] are arrays, not pointers and they can't be
NULL.  Let's remove these NULL checks.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18 19:47:00 -07:00
Wolfram Sang
516a4f04a3 staging: ks7010: drop private handler for driver version
We are upstream now, we don't need seperate driver versioning.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18 19:45:55 -07:00
Wolfram Sang
c5d9a03031 staging: ks7010: cleanup file headers
Remove svn-ids and fix typos in the licence declaration. Add my
copyright to the sdio code which I worked on mainly.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-07 22:42:53 -07:00
Wolfram Sang
4e66308e7d staging: ks7010: adapt to new trans_start handling
trans_start is gone from netdevice, so use the new helper function to
set the mark.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-07 22:42:53 -07:00
Wolfram Sang
1df655478e staging: ks7010: indent ks_wlan_net.c
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-07 22:42:53 -07:00
Wolfram Sang
feedcf1a5f staging: ks7010: remove unecessary typedef
Let's simply specify the struct to keep in sync with kernel coding
style.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-07 22:42:53 -07:00
Wolfram Sang
564efd7935 staging: ks7010: delete seperate debug header
Move the one debug macro to the generic wlan header.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-07 22:42:53 -07:00
Wolfram Sang
72bf750007 staging: ks7010: remove code for old kernel versions
No need to be backwards compatible.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-07 22:42:53 -07:00
Wolfram Sang
4ab274017b staging: ks7010: remove checks for WIRELESS_EXT version
We are by far newer than that anyhow.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-07 22:42:53 -07:00
Wolfram Sang
13a9930d15 staging: ks7010: add driver from Nanonote extra-repository
See the TODO for details where this driver came from. Only a few minor
changes were made to make the driver suitable for staging:

* updated Kconfig help text and dependencies
* added TODO
* removed two __DATE__ and __TIME__ printouts to allow reproducible builds
* added to staging main Kconfig + Makefile

Tested on a Renesas Salvator-X board with a Spectec SDW-823 card. I
could connect to a WPA-protected network.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-07 22:42:53 -07:00