Commit graph

82 commits

Author SHA1 Message Date
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
Melike Yurtoglu
fb282bcd9c staging: wlan-ng: remove unnecessary 'out of memory' message
This patch fixes "Possible unnecessary 'out of memory' message"
checkpatch.pl warning in hfa384x_usb.c

Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:17 +08:00
Aybuke Ozdemir
34c376fe07 Staging: wlan-ng: Fix return in void function warning
This fixes checkpatch.pl warning:
WARNING: void function return statements are not generally useful

Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19 17:42:15 -07:00
Ilja Sidoroff
cc5bcbbdbf Staging: wlan-ng: Remove redundant break/goto statements in hfa384x_usb.c
This patch removes redundant goto or break statements in hfa384x_usb.c as found by checkpatch.pl

Signed-off-by: Ilja Sidoroff <ilja.sidoroff@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:02:48 -07:00
Tobias Klauser
9630f6b97a staging: wlan-ng: Use net_device_stats from struct net_device
Instead of using an own copy of struct net_device_stats in struct
wlandevice, 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().

Furthermore, convert prefix increment of stats counters to the more
common postfix increment idiom.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 11:59:51 -07:00
Cheng-Wei Lee
4d525ef61f staging: wlan-ng/hfa384x_usb.c: add blank line after declarations
This patch fixes the following checkpatch.pl issues in hfa384x_usb.c:
WARNING: Missing a blank line after declarations

Signed-off-by: Quentin Lee <lee.rhapsody@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-29 14:34:42 -07:00
Peter Senna Tschudin
4764ca981b drivers/staging: Remove useless return variables
This patch remove variables that are initialized with a constant,
are never updated, and are only used as parameter of return.
Return the constant instead of using a variable.

Verified by compilation only.

The coccinelle script that find and fixes this issue is:
// <smpl>
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
    when strict
return
- ret
+ C
;
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-26 10:32:15 -07:00
Sherif Shehab Aldin
5d85fe346f driver: staging: wlan-ng: Removed unnecessary spaces after cast from hfa384x_usb.c
Fixed: No space is necessary after a cast

Signed-off-by: Sherif Shehab Aldin <shehabaldin.sherif@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 14:54:11 -07:00
Sherif Shehab Aldin
638f81b849 driver: staging: wlan-ng: Removed #if 0 lines from hfa384x_usb.c
Removed lines that were ignored by #if 0

Signed-off-by: Sherif Shehab Aldin <shehabaldin.sherif@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 14:54:11 -07:00
Sherif Shehab Aldin
96b1971ace driver: staging: wlan-ng: Removed multiple assignments
Removed multiple assignments from hfa384x_usb.c

Signed-off-by: Sherif Shehab Aldin <shehabaldin.sherif@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 14:54:11 -07:00
Sherif Shehab Aldin
a3542e664b driver: staging: wlan-ng: Fixed white spaces issues
In hfa384x_usb.c:
Moved Logical continuations to the correct lines
Removed unnecessary blank lines

Signed-off-by: Sherif Shehab Aldin <shehabaldin.sherif@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 14:54:11 -07:00
Sherif Shehab Aldin
3f2d656481 driver: staging: wlan-ng: Fixed Alignment to match open parenthesis
Fixed Alignment to match open parenthesis in hfa384x_usb.c

Signed-off-by: Sherif Shehab Aldin <shehabaldin.sherif@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 14:54:11 -07:00
Sherif Shehab Aldin
83f91687b0 driver: staging: wlan-ng: Removed Unnecessary space after function pointer name
Removed Unnecessary space after function pointer name

Signed-off-by: Sherif Shehab Aldin <shehabaldin.sherif@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 14:53:29 -07:00
Sherif Shehab Aldin
d6ae4a9995 driver: staging: wlan-ng: Setting character pointers as const
changed declaration of ctlx_str to:
static const char * const ctlx_str[]

Signed-off-by: Sherif Shehab Aldin <shehabaldin.sherif@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 14:53:29 -07:00
Sherif Shehab Aldin
baa8a6c008 driver: staging: wlan-ng: switched to pr_warn
changed printk(KERN_WARNING .. to pr_warn

Signed-off-by: Sherif Shehab Aldin <shehabaldin.sherif@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 14:53:29 -07:00
Sherif Shehab Aldin
a03742ac96 driver: staging: wlan-ng: Removed unnecessary typedefs from hfa384x_usb.c
Removed unnecessary typedefs from hfa384x_usb.c

Signed-off-by: Sherif Shehab Aldin <shehabaldin.sherif@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 14:50:03 -07:00
Sherif Shehab Aldin
a212013695 driver: staging: wlan-ng: Fixed Breaking long lines and strings style rule
Fixed coding style rule "Breaking long lines and strings" for hfa384x_usb.c

Signed-off-by: Sherif Shehab Aldin <shehabaldin.sherif@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 14:50:03 -07:00
Avinash Kumar
263b8bb910 staging: wlan-ng: hfa384x_usb.c: replaced printk() debugs with netdev_warn()/netdev_err()
replaced the printk debug lines with respective netdev_warn()/netdev_err()

Signed-off-by: Avinash kumar <avi.kp.137@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-17 07:47:44 -07:00
Kumar Amit Mehta
32adf1e553 staging: wlan-ng: hfa384x_usb.c: fixed a coding style issue
checkpatch.pl throws error message for the current code. This patch fixes
coding style issue.

Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:30:19 -07:00
Devendra Naga
675be12f45 staging:wlan-ng: clean hfa384x_usbctlx_submit
else is not required as such we can do with just with a single if

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-13 20:22:24 -07:00
Devendra Naga
102db1fc4a staging:wlan-ng: cleanup prism2sta_commsqual_defer and hfa384x_drvr_getconfig
the function prism2sta_commsqual_defer defines a goto done lable, which just
jumps to end of function, which we can achieve with out it

the hfa384x_drvr_getconfig doesn't need the result variable, we can
remove and just return the function

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10 15:42:52 -07:00
Devendra Naga
89e6302ce7 staging:wlan-ng: cleanup hfa384x_ctlxout_callback
goto done is not required and actually having goto done does
jumps the program to end of the function and calls return.
instead call return directly

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10 15:42:51 -07:00
Devendra Naga
3f51425830 staging:wlan-ng: cleanup hfa384x_usbctlx_resptimerfn
goto done is not required and simple return is fine

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10 15:42:51 -07:00
Ilia Mirkin
a6f9c48fdd staging: wlan-ng: Remove NULL check before kfree
This patch was generated by the following semantic patch:
// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);

@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-14 11:57:38 -07:00
Uwe Kleine-König
9b0131cb24 staging/trivial: fix typos concerning "initiali[zs]e"
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-04 21:23:26 -07:00
Edgardo Hames
51e4896ada Staging: wlan-ng: fix style issues in p80211conv.h
This patch removes typedefs in p80211conv.h.

Signed-off-by: Edgardo Hames <ehames@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-02 18:20:03 -07:00
Edgardo Hames
93df38e593 Staging: wlan-ng: fix style issues for p80211hdr.h
Removed typedef and other style issues.

Signed-off-by: Edgardo Hames <ehames@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-02 18:20:03 -07:00
Dan Carpenter
594578979d Staging: wlan-ng: silence a sparse warning
This doesn't change the behavior.  It just silences a sparse warning.

drivers/staging/wlan-ng/hfa384x_usb.c:2810:62: warning: dubious: !x | !y

The point of the bitwise OR is so that a logical OR could short circuit
the second call to test_and_set_bit().

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 15:33:57 -07:00
Edgardo Hames
4ffab68882 Staging: wlan-ng: rework code style after feedback
This patch includes the feedback received from Richard Kennedy.

Signed-off-by: Edgardo Hames <ehames@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:50 -07:00
Edgardo Hames
631c8dec07 Staging: wlan-ng: fix coding style in hfa834x_usb.c
This is a patch in hfa834x_usb.c to fix typedef declarations and long lines.

Signed-off-by: Edgardo Hames <ehames@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:33 -07:00
Greg Kroah-Hartman
b02957d58a Staging: Merge two branches of coding style fixes together
Turns out that multiple people sent pretty much the same patch
for the same staging drivers.  Commit these in two different
branches and merge them together to get a more complete coverage
of the cleanup and properly credit everyone for the work that they
did.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-04 08:14:54 -08:00
Andrew Elwell
3f4b4e7797 Staging: wlan-ng: More checkpatch.pl error cleanups
Signed-off-by: Andrew Elwell <Andrew.Elwell@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-04 07:59:02 -08:00
Andrew Elwell
ef1a0ed7f1 Staging: wlan-ng - checkpatch.pl fixups
Basic fixups in the staging/wlan-ng directory.
(First kernel patch - thanks to FOSDEM talk)

Signed-off-by: Andrew Elwell <Andrew.Elwell@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-04 07:59:02 -08:00
Svenne Krap
5dd8acc8fd Staging: wlan-ng: multiple safe style cleanups
Cleanups as suggested by checkpatch.pl utiltiy.
.o's from before and after cleanup have matching SHA1s.

Signed-off-by: Svenne Krap <svenne@krap.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:58 -08:00
Svenne Krap
46800b225f Staging: wlan-ng: clean up assignments in if statements
Trivial changes to code-paths.

Signed-off-by: Svenne Krap <svenne@krap.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:58 -08:00