OSDN Git Service

tomoyo/tomoyo-test1.git
7 years agostaging: vc04_services: Remove explicit NULL comparison
Gargi Sharma [Thu, 23 Feb 2017 20:28:18 +0000 (01:58 +0530)]
staging: vc04_services: Remove explicit NULL comparison

Replace explicit NULL comparison with ! operator to
simplify code.

Found with Coccinelle script:
@@
expression ptr;
position p;
statement s0, s1;
@@

ptr@p =
\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\|usb_alloc_urb\|
alloc_netdev\|dev_alloc_skb\)(...)
... when != ptr

if (
(
+ !
ptr
- == NULL
)
) s0 else s1

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: Fixed "space prohibited after that open/close parenthesis...
Yamanappagouda Patil [Thu, 23 Feb 2017 14:30:53 +0000 (20:00 +0530)]
staging: vc04_services: Fixed "space prohibited after that open/close parenthesis" erros.

Fixed checkpath.pl erros "space prohibited after that open/close parenthesis" in vchiq_version.c file.

Signed-off-by: Yamanappagouda Patil <goudapatilk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: Using macro DIV_ROUND_UP
simran singhal [Tue, 21 Feb 2017 18:51:03 +0000 (00:21 +0530)]
staging: vc04_services: Using macro DIV_ROUND_UP

The macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)).
It clarifies the divisor calculations. This occurence was detected 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: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: Fixed 'missing a blank line' warnings.
Yamanappagouda Patil [Tue, 21 Feb 2017 16:01:01 +0000 (21:31 +0530)]
staging: vc04_services: Fixed 'missing a blank line' warnings.

Fixed checkpatch.pl "missing a blank line after declarations" warning
messages in vc04_services module.

Signed-off-by: Yamanappagouda Patil <goudapatilk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vt6655: Compress return logic
simran singhal [Sat, 18 Feb 2017 21:22:07 +0000 (02:52 +0530)]
staging: vt6655: Compress return logic

Simplify function returns by merging assignment and return into
one command line.
Found with Coccinelle
@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vt6656: remove blank lines at opening and closing braces
Katie Dunne [Mon, 20 Feb 2017 21:53:07 +0000 (13:53 -0800)]
staging: vt6656: remove blank lines at opening and closing braces

Removes unnecessary blank lines after opening and before closing braces.
These instances were found by checkpatch.pl.

Signed-off-by: Katie Dunne <kdunne@mail.ccsf.edu>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: most: Using macro DIV_ROUND_UP
simran singhal [Wed, 22 Feb 2017 09:10:15 +0000 (14:40 +0530)]
staging: most: Using macro DIV_ROUND_UP

The macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)).
It clarifies the divisor calculations. This occurence was detected 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: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: sm750fb: add spaces around operators
Katie Dunne [Mon, 20 Feb 2017 05:14:29 +0000 (21:14 -0800)]
staging: sm750fb: add spaces around operators

Add spaces around operators -, *, ?:, >>, << to conform to kernel style.
These instances were found with checkpatch.pl

Signed-off-by: Katie Dunne <kdunne@mail.ccsf.edu>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: sm750fb: add curly braces to if-statements
Katie Dunne [Mon, 20 Feb 2017 04:38:57 +0000 (20:38 -0800)]
staging: sm750fb: add curly braces to if-statements

Add curly braces to if-statements for style compliance.
These cases are found by checkpatch.pl

Signed-off-by: Katie Dunne <kdunne@mail.ccsf.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: speakup: Clean up if tests
Sreya Mittal [Fri, 24 Feb 2017 16:00:14 +0000 (21:30 +0530)]
staging: speakup: Clean up if tests

Put logical continuations on the next line;
remove useless parentheses;
and line up the tests.

Signed-off-by: Sreya Mittal <sreyamittal5@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: speakup: i18n: Add spaces around operators
sayli karnik [Thu, 23 Feb 2017 12:07:31 +0000 (17:37 +0530)]
staging: speakup: i18n: Add spaces around operators

The patch adds spaces around binary operators as suggested by
checkpatch.pl

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: speakup: i18n: Replace 'x!=NULL' with 'x'
sayli karnik [Thu, 23 Feb 2017 11:55:08 +0000 (17:25 +0530)]
staging: speakup: i18n: Replace 'x!=NULL' with 'x'

The patch removes the explicit NULL comparison by replacing 'x!=NULL'
with 'x'. This issue was found by checkpatch.pl

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: speakup: Added spaces around arithmetic operators.
Varsha Rao [Wed, 22 Feb 2017 17:46:40 +0000 (23:16 +0530)]
staging: speakup: Added spaces around arithmetic operators.

Added spaces around arithmetic operators (+, -, /), to fix the checkpatch
issue.

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: speakup: Removed blank line after open braces.
Varsha Rao [Wed, 22 Feb 2017 17:41:33 +0000 (23:11 +0530)]
staging: speakup: Removed blank line after open braces.

Remove blank line after open braces, to fix the following checkpatch issue:

CHECK: Blank lines aren't necessary after an open brace '{'

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: speakup: (coding style) Limit line to 80 chars
Olav Haugan [Fri, 17 Feb 2017 05:08:32 +0000 (21:08 -0800)]
staging: speakup: (coding style) Limit line to 80 chars

Fix checkpatch warning about line being over 80 characters.

Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: speakup: (coding style) Simplify comparisons to NULL
Olav Haugan [Fri, 17 Feb 2017 05:08:31 +0000 (21:08 -0800)]
staging: speakup: (coding style) Simplify comparisons to NULL

Fix checkpatch check notices by simplifying comparisons to NULL.

Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: greybus: loopback_test: Fix open error path
sayli karnik [Mon, 20 Feb 2017 17:10:28 +0000 (22:40 +0530)]
staging: greybus: loopback_test: Fix open error path

Change array index from the loop bound variable to loop index.
If a poll file fails to open for any intermediate device, all poll files with
fds of devices from 0 upto that device must be closed in the open_poll_files()
function. The current code only closes the poll file with the most recent fd
allocated, and at times tries to close the same file multiple times.

Detected by coccinelle:

@@
expression arr,ex1,ex2;
@@

for(ex1 = 0; ex1 < ex2; ex1++) { <...
  arr[
- ex2
+ ex1
  ]
  ...> }

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: greybus: loopback_test: fix device-name leak
Gargi Sharma [Wed, 22 Feb 2017 15:38:21 +0000 (21:08 +0530)]
staging: greybus: loopback_test: fix device-name leak

All the device names were being always leaked. Also,
illegal free was being called upon namelist[n] which
was coincidentally NULL. The pointer to dirent structures
must be individually freed before freeing the pointer array.

Coccinelle Script:
@@
expression arr,ex1,ex2;
@@

for(ex1 = 0; ex1 < ex2; ex1++) { <...
  arr[
- ex2
+ ex1
  ]
  ...> }

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Reviewed by: Johan Hovold <johan@kernel.org>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8712: Moved logical OR operator to previous line.
Varsha Rao [Fri, 17 Feb 2017 05:12:38 +0000 (10:42 +0530)]
staging: rtl8712: Moved logical OR operator to previous line.

Moved logical OR operator to previous line to fix the following
checkpatch issue:

CHECK: Logical continuations should be on the previous line.

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8712: Remove unnecessary parentheses.
Varsha Rao [Sat, 18 Feb 2017 14:14:15 +0000 (19:44 +0530)]
staging: rtl8712: Remove unnecessary parentheses.

Removed unnecessary parentheses around pointers to fix the following
checkpatch issues:

CHECK: Unnecessary parentheses around padapter->xmitpriv
CHECK: Unnecessary parentheses around padapter->recvpriv

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8712: Match alignment with open parenthesis.
Varsha Rao [Sat, 18 Feb 2017 14:33:07 +0000 (20:03 +0530)]
staging: rtl8712: Match alignment with open parenthesis.

Matched function arguments alignment with its open parenthesis. This patch
fixes the following checkpatch issue:

CHECK: Alignment should match open parenthesis

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8192e: replace explicit NULL comparison
Gargi Sharma [Thu, 23 Feb 2017 20:06:59 +0000 (01:36 +0530)]
staging: rtl8192e: replace explicit NULL comparison

Replace explicit NULL comparison with ! operator to
simplify code.

Found with Coccinelle script:
@@
expression ptr;
position p;
statement s0, s1;
@@

ptr@p =
\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\|usb_alloc_urb\|
alloc_netdev\|dev_alloc_skb\)(...)
... when != ptr

if (
(
+ !
ptr
- == NULL
)
) s0 else s1

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8192u: Replace explicit NULL comparison
Gargi Sharma [Thu, 23 Feb 2017 20:16:46 +0000 (01:46 +0530)]
staging: rtl8192u: Replace explicit NULL comparison

Replace explicit NULL comparison with ! operator to
simplify code.

Found with Coccinelle script:
@@
expression ptr;
position p;
statement s0, s1;
@@

ptr@p =
\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\|usb_alloc_urb\|
alloc_netdev\|dev_alloc_skb\)(...)
... when != ptr

if (
(
+ !
ptr
- == NULL
)
) s0 else s1

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8188eu: replace explicit NULL comparison
Gargi Sharma [Thu, 23 Feb 2017 19:40:51 +0000 (01:10 +0530)]
staging: rtl8188eu: replace explicit NULL comparison

Replace explicit NULL comparison with ! operator to
simplify code.

Found with Coccinelle script:
@@
expression ptr;
position p;
statement s0;
@@

ptr@p =
\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\|usb_alloc_urb\|
alloc_netdev\|dev_alloc_skb\)(...)
... when != ptr

if (
(
+ !
ptr
- == NULL
)
) s0

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8192e: Remove useless parentheses
Gargi Sharma [Wed, 22 Feb 2017 15:02:12 +0000 (20:32 +0530)]
staging: rtl8192e: Remove useless parentheses

Parentheses are not needed on the right side of assignment.

Additionally added space around '+'and '*' to remove
checkpatch issue, space required around '+' and '*'.

Parentheses Removed using the coccinelle script:
@@
binary operator bop = {+,-,>>,<<};
expression e, e1, e2;
@@

e =
-(
        e1 bop e2
-)

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8188eu: Fixed "Missing a blank line after declarations".
Yamanappagouda Patil [Tue, 21 Feb 2017 14:59:21 +0000 (20:29 +0530)]
staging: rtl8188eu: Fixed "Missing a blank line after declarations".

Fixed checkpatch.pl "missing a blank line after declarations" waring
messages from rtl8188eu module.

Signed-off-by: Yamanappagouda Patil <goudapatilk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8192u: Fix endianness warnings in ieee80211_rx.c
Sebastian Haas [Mon, 20 Feb 2017 23:31:47 +0000 (00:31 +0100)]
staging: rtl8192u: Fix endianness warnings in ieee80211_rx.c

Fixes the endianness warning "restricted __le16 degrades to integer" by
converting __le16 to short before using it in bitmasks or in the
macro WLAN_FC_GET_STYPE.

Signed-off-by: Sebastian Haas <sehaas@deebas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8192u: Fix warnings about endianness
maomao xu [Fri, 17 Feb 2017 12:04:02 +0000 (20:04 +0800)]
staging: rtl8192u: Fix warnings about endianness

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:564:37: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:564:37:    expected unsigned short [unsigned] [usertype] len
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:564:37:    got restricted __be16 [usertype] <noident>

Signed-off-by: maomao xu <albert008.xu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8192u: ieee80211: Remove typedef to the tx_pending_t structure
sayli karnik [Fri, 17 Feb 2017 10:13:07 +0000 (15:43 +0530)]
staging: rtl8192u: ieee80211: Remove typedef to the tx_pending_t structure

Using typedef for a structure type is not suggested in Linux kernel coding
style guidelines. So remove typedef from structure tx_pending_t.
The typedef name is not used anywhere. All variables of this type are declared
using "struct tx_pending_t".
Also change the structure name to tx_pending since it is normally only
typedefs that have names that end in _t.

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8188eu: Add a blank line
Gargi Sharma [Fri, 17 Feb 2017 06:20:30 +0000 (11:50 +0530)]
staging: rtl8188eu: Add a blank line

Add a blank line after function declaration to fix the
checkpatch issue Please use a blank line after
function/struct/union/enum declarations.

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8188eu: Remove multiple blank lines
Gargi Sharma [Fri, 17 Feb 2017 06:20:29 +0000 (11:50 +0530)]
staging: rtl8188eu: Remove multiple blank lines

Remove blank lines to fix the checkpatch issue,
don't use multiple blank lines.

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8188eu: Remove unnecessary blank lines
Gargi Sharma [Fri, 17 Feb 2017 06:20:28 +0000 (11:50 +0530)]
staging: rtl8188eu: Remove unnecessary blank lines

Remove unnecessary blank lines to fix the checkpatch issue,
blank lines are not required before '}'.

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8188eu: Put constant on right side of comparison
Gargi Sharma [Fri, 17 Feb 2017 06:20:27 +0000 (11:50 +0530)]
staging: rtl8188eu: Put constant on right side of comparison

Constants should be on the right side of comparisons.

Issue found by checkpatch.pl script.

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8188eu: Fix block comments warning
Gargi Sharma [Fri, 17 Feb 2017 06:20:26 +0000 (11:50 +0530)]
staging: rtl8188eu: Fix block comments warning

Align * on each line and move final */ to a new line, to
conform to the kernel coding style for block comments.

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8188eu: Replace x==NULL by !x
Gargi Sharma [Fri, 17 Feb 2017 06:20:25 +0000 (11:50 +0530)]
staging: rtl8188eu: Replace x==NULL by !x

Replace x==NULL by !x, to fix the checkpatch issue
comparsion with NULL could be written as !x.

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8192u: Fixed 'tabstop' coding style warning
simran singhal [Thu, 16 Feb 2017 21:22:05 +0000 (02:52 +0530)]
staging: rtl8192u: Fixed 'tabstop' coding style warning

Replace a mix of tabs and spaces indentation by tabs only.

Fixed checkpatch warning "Statements should start on a tabstop" in
rtl8192u module.

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8192u: Replace symbolic permissions with octal permissions
simran singhal [Thu, 16 Feb 2017 20:36:56 +0000 (02:06 +0530)]
staging: rtl8192u: Replace symbolic permissions with octal permissions

Octal permissions should be used instead of symbolic ones for easier
reading.

WARNING: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred.
Consider using octal permissions '0644'.
This warning is detected by checkpatch.pl

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging:r8188eu: remove unused MCS_rate_2R array
Ivan Safonov [Tue, 14 Feb 2017 22:25:32 +0000 (01:25 +0300)]
staging:r8188eu: remove unused MCS_rate_2R array

MCS_rate_2R[] does not used. Remove it.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging:r8188eu: remove unused HW_VAR_RF_TYPE parameter of HT_caps_handler
Ivan Safonov [Tue, 14 Feb 2017 22:25:31 +0000 (01:25 +0300)]
staging:r8188eu: remove unused HW_VAR_RF_TYPE parameter of HT_caps_handler

rtw_hal_get_hwreg() does not used with HW_VAR_RF_TYPE parameter.
Remove HW_VAR_RF_TYPE switch case in rtw_hal_get_hwreg and definition.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging:r8188eu: refactor HT_caps_handler() - remove rtw_hal_get_hwreg() call
Ivan Safonov [Tue, 14 Feb 2017 22:25:30 +0000 (01:25 +0300)]
staging:r8188eu: refactor HT_caps_handler() - remove rtw_hal_get_hwreg() call

rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value.
Replace the function call with RF_1T1R value and refactor HT_caps_handler().

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging:r8188eu: refactor rtw_update_ht_cap() - remove rtw_hal_get_hwreg() call
Ivan Safonov [Tue, 14 Feb 2017 22:25:29 +0000 (01:25 +0300)]
staging:r8188eu: refactor rtw_update_ht_cap() - remove rtw_hal_get_hwreg() call

rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value.
Replace the function call with RF_1T1R value and refactor rtw_update_ht_cap().

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging:r8188eu: refactor issue_assocreq() - remove rtw_hal_get_hwreg() call
Ivan Safonov [Tue, 14 Feb 2017 22:25:28 +0000 (01:25 +0300)]
staging:r8188eu: refactor issue_assocreq() - remove rtw_hal_get_hwreg() call

rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value.
Replace the function call with RF_1T1R value and refactor issue_assocreq().

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging:r8188eu: refactor rtw_get_cur_max_rate() - remove rtw_hal_get_hwreg() call
Ivan Safonov [Tue, 14 Feb 2017 22:25:27 +0000 (01:25 +0300)]
staging:r8188eu: refactor rtw_get_cur_max_rate() - remove rtw_hal_get_hwreg() call

rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value.
Replace the function call with RF_1T1R value
and refactor rtw_get_cur_max_rate().

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging:r8188eu: refactor rtw_check_beacon_data() - remove rtw_hal_get_hwreg() call
Ivan Safonov [Tue, 14 Feb 2017 22:25:26 +0000 (01:25 +0300)]
staging:r8188eu: refactor rtw_check_beacon_data() - remove rtw_hal_get_hwreg() call

rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value.
Replace the function call with RF_1T1R value
and refactor rtw_check_beacon_data().

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging:r8188eu: refactor add_RATid() - remove rtw_hal_get_hwreg() call
Ivan Safonov [Tue, 14 Feb 2017 22:25:25 +0000 (01:25 +0300)]
staging:r8188eu: refactor add_RATid() - remove rtw_hal_get_hwreg() call

rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value.
Replace the function call with RF_1T1R value and refactor add_RATid().

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging:r8188eu: use DIV_ROUND_UP() in rtw_signal_stat_timer_hdl()
Ivan Safonov [Tue, 14 Feb 2017 22:25:24 +0000 (01:25 +0300)]
staging:r8188eu: use DIV_ROUND_UP() in rtw_signal_stat_timer_hdl()

DIV_ROUND_UP macro is shorter and look better than if-else construction.
DIV_ROUND_UP used in rtw_signal_stat_timer_hdl().

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ks7010: remove unecessary spaces after casts
Katie Dunne [Mon, 20 Feb 2017 02:30:00 +0000 (18:30 -0800)]
staging: ks7010: remove unecessary spaces after casts

Remove spaces after casts found by checkpatch.pl. In some cases,
remove returns after casts and place them on a single line.

Signed-off-by: Katie Dunne <kdunne@mail.ccsf.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: ks7010: ks_*: Braces should be used on all arms of these statements
Shiva Kerdel [Fri, 17 Feb 2017 21:41:54 +0000 (22:41 +0100)]
Staging: ks7010: ks_*: Braces should be used on all arms of these statements

Braces should be used on all arms of these statements (CHECK)..

Signed-off-by: Shiva Kerdel <shiva@exdev.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: ks7010: ks_*: Use the BIT macro for bitwise checks
Shiva Kerdel [Thu, 16 Feb 2017 23:18:35 +0000 (00:18 +0100)]
Staging: ks7010: ks_*: Use the BIT macro for bitwise checks

Changed bit swifting operators to BIT macros (preferred),
This change will also solve the preferred space surrounding
the operator checks.

Signed-off-by: Shiva Kerdel <shiva@exdev.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: olpc_dcon: add whitespace around binary operators
Kenneth Hsu [Thu, 23 Feb 2017 02:58:14 +0000 (18:58 -0800)]
staging: olpc_dcon: add whitespace around binary operators

This fixes a coding style issue where whitespace characters were missing
around some binary OR operators.

Signed-off-by: Kenneth Hsu <kennethhsu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: Using macro DIV_ROUND_UP
simran singhal [Wed, 22 Feb 2017 09:32:04 +0000 (15:02 +0530)]
staging: lustre: Using macro DIV_ROUND_UP

The macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)).
It clarifies the divisor calculations. This occurence was detected 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: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: lprocfs: move lprocfs_stats_[un]lock to a source file
James Simmons [Sat, 18 Feb 2017 21:47:15 +0000 (16:47 -0500)]
staging: lustre: lprocfs: move lprocfs_stats_[un]lock to a source file

When compiling the kernel without optimization, when using GCOV,
the lprocfs_stats_alloc_one() symbol is not properly exported to
other modules and causes the ptlrpc module to fail loading with
an unknown symbol. There is no reason to export the function
lprocfs_stats_alloc_one. The reason is due to the functions
lprocfs_stats_[un]lock being inline functions in a header file.
Lets untangle this mess and turn those inline functions
into real functions in a source file.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8836
Reviewed-on: https://review.whamcloud.com/23773
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: ldlm: fix race of starting bl threads
Niu Yawei [Sat, 18 Feb 2017 21:47:12 +0000 (16:47 -0500)]
staging: lustre: ldlm: fix race of starting bl threads

There is race in the code of starting bl threads which leads to
thread number exceeds the maximum number when race happened, it
can also lead to duplicated thread name. This patch fixes the
race and cleanup the code a bit.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7330
Reviewed-on: http://review.whamcloud.com/17026
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: ldlm: disconnect speedup
Vitaly Fertman [Sat, 18 Feb 2017 21:47:11 +0000 (16:47 -0500)]
staging: lustre: ldlm: disconnect speedup

disconnect takes too long time if there are many locks to cancel.
besides the amount of time spent on each lock cancel, there is a
resched() in cfs_hash_for_each_relax(), i.e. disconnect or eviction
may take unexpectedly long time. While this patch only contains
the client side fixes the original fix covered changes to both
the server and client code to ensure proper disconnect handling.
Below details the change done on both the server and client so
people can examine the disconnect behavior with both source bases.

- do not cancel locks on disconnect_export;
- export will be left in obd_unlinked_exports list pinned by live
  locks;
- new re-connects will created other non-conflicting exports;
- new locks will cancel obsolete locks on conflicts;
- once all the locks on the disconnected export will be cancelled,
  the export will be destroyed on the last ref put;
- do not cancel in small portions, cancel all together in just 1
  dedicated thread - use server side blocking thread for that;
- cancel blocked locks first so that waiting locks could proceed;
- take care about blocked waiting locks, so that they would get
  cancelled quickly too;
- do not remove lock from waiting list on AST error before moving
  it to elt_expired_locks list, because it removes it from export
  list too; otherwise this blocked lock will not be cancelled
  immediately on failed export;
- cancel lock instead of just destroy for failed export, to make
  full cleanup, i.e. remove it from export list.

Signed-off-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3031
Xyratex-bug-id: MRP-395 MRP-1366 MRP-1366
Reviewed-by: Andriy Skulysh <Andriy_Skulysh@xyratex.com>
Reviewed-by: Alexey Lyashkov <Alexey_Lyashkov@xyratex.com>
Reviewed-on: http://review.whamcloud.com/5843
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: ldlm: reduce ldlm pool recalc window
Vitaly Fertman [Sat, 18 Feb 2017 21:47:10 +0000 (16:47 -0500)]
staging: lustre: ldlm: reduce ldlm pool recalc window

Reduce the sleep period from 50 seconds down to
LDLM_POOL_CLI_DEF_RECALC_PERIOD which is 10 seconds.

Signed-off-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3031
Xyratex-bug-id: MRP-395 MRP-1366 MRP-1366
Reviewed-by: Andriy Skulysh <Andriy_Skulysh@xyratex.com>
Reviewed-by: Alexey Lyashkov <Alexey_Lyashkov@xyratex.com>
Reviewed-on: http://review.whamcloud.com/5843
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: llite: remove extraneous export parameter
Andreas Dilger [Sat, 18 Feb 2017 21:47:09 +0000 (16:47 -0500)]
staging: lustre: llite: remove extraneous export parameter

The ll_close_inode_openhandle() and ll_md_close() functions passed an
extra "obd_export *md_exp" parameter, but it turns out that all of the
callers already pass inode->i_sb->s_fs_info->lsi_llsbi->ll_md_exp in
one form or another, so it can just be extracted from "inode" directly
as needed.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6627
Reviewed-on: http://review.whamcloud.com/14953
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: lov: trying smaller memory allocations
Yang Sheng [Sat, 18 Feb 2017 21:47:08 +0000 (16:47 -0500)]
staging: lustre: lov: trying smaller memory allocations

Reduce struct lov_io_sub to smaller memory usage
on wide-stripe file systems.

Signed-off-by: Yang Sheng <yang.sheng@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7085
Reviewed-on: http://review.whamcloud.com/17476
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: osc: further LRU OSC cleanup after eviction
Jinshan Xiong [Sat, 18 Feb 2017 21:47:07 +0000 (16:47 -0500)]
staging: lustre: osc: further LRU OSC cleanup after eviction

Define osc_lru_reserve() and osc_lru_unreserve() to reserve LRU
slots in osc_io_write_iter_init() and unreserve them in fini();

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6271
Reviewed-on: http://review.whamcloud.com/16456
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: ldlm: handle ldlm lock cancel race when evicting client.
Jinshan Xiong [Sat, 18 Feb 2017 21:47:06 +0000 (16:47 -0500)]
staging: lustre: ldlm: handle ldlm lock cancel race when evicting client.

A ldlm lock could be canceled simutaneously by ldlm bl thread and
cleanup_resource(). In this case, only one side will win the race
and the other side should wait for the work to complete. Eviction
on group lock is now well supported.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6271
Reviewed-on: http://review.whamcloud.com/16456
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: lov: cleanup when cl_io_iter_init() fails
Jinshan Xiong [Sat, 18 Feb 2017 21:47:05 +0000 (16:47 -0500)]
staging: lustre: lov: cleanup when cl_io_iter_init() fails

In lov_io_iter_init(), if cl_io_iter_init() against sub io fails,
it should call cl_io_iter_fini() to cleanup leftover information;

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6271
Reviewed-on: http://review.whamcloud.com/16456
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: osc: remove obsolete asserts
Jinshan Xiong [Sat, 18 Feb 2017 21:47:04 +0000 (16:47 -0500)]
staging: lustre: osc: remove obsolete asserts

Remove the no longer needed assert in the function
osc_cache_truncate_start(). The assertion in
osc_object_prune() will become faulty with upcoming
changes. The reason this will become a problem is
that there may exist freeing pages in object's
radix tree at the time of osc_object_prune(), which
causes failure at the assertion of (osc->oo_npages == 0).
This patch prevents that problem from happening.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6271
Reviewed-on: http://review.whamcloud.com/16456
Reviewed-on: http://review.whamcloud.com/16727
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: llite: omit to update wire data
Bobi Jam [Sat, 18 Feb 2017 21:47:03 +0000 (16:47 -0500)]
staging: lustre: llite: omit to update wire data

In ll_setattr_raw(), after op_data->op_attr has been copied, the attr
is updated and op_data->op_attr does not get updated afterward.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6813
Reviewed-on: http://review.whamcloud.com/16462
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: llite: lower message level for ll_setattr_raw()
Bobi Jam [Sat, 18 Feb 2017 21:47:02 +0000 (16:47 -0500)]
staging: lustre: llite: lower message level for ll_setattr_raw()

Truncate and write can happen at the same time, so that a file can
be set modified even though the file is not restored from released
state, and ll_hsm_state_set() is not applicable for the file, and
it will return error in this case, we'd lower the error message level
in this case.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6817
Reviewed-on: http://review.whamcloud.com/15541
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: ko2iblnd: Adapt to the removal of ib_get_dma_mr()
Doug Oucharek [Sat, 18 Feb 2017 18:04:10 +0000 (10:04 -0800)]
staging: lustre: ko2iblnd: Adapt to the removal of ib_get_dma_mr()

In Linux kernel 4.9-rc1, the function ib_get_dma_mr()
was removed and a second parameter was added to ib_alloc_pd().
As this broke the building of the ko2iblnd module in
staging, the Kconfig for LNet has marked ko2iblnd as broken
and stopped building it.

This patch fixes this breakage by:

- Removing the BROKEN tag from lnet/Kconfig.
- Make it so the module parameter map_on_demand can no longer be
  zero (we have to configure FMR/FastReg pools; it can no longer be
  off).
- No longer try to use the global DMA memory region, but make use
  of the FMR/FastReg pool for all RDMA Tx operations.
- Everywhere we are using the device DMA mr to derive the
  L-key for non-registered memory regions, use the
  pd->local_dma_lkey value instead.
- Make the default map_on_demand = 256.  This will allow nodes with
  this patch to still connected to older nodes without this patch
  and FMR/FastReg turned off.  When FMR/FastReg is turned off, we
  use 256 as the max frags so the two sides will still be able to
  communicate and work.
- Fix a mistake with BUILD_BUG_ON calls in o2iblnd.c which caused
  compiling to fail.

Signed-off-by: Doug Oucharek <doug.s.oucharek@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9026
Reviewed-on: https://review.whamcloud.com/#/c/24931/
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: wlan-ng: prism2mgmt: Removed an empty line
Georgios Emmanouil [Thu, 16 Feb 2017 20:13:32 +0000 (22:13 +0200)]
Staging: wlan-ng: prism2mgmt: Removed an empty line

Removed an empty line.

Signed-off-by: Georgios Emmanouil <geo.emmnl@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: wlan-ng: remove extra parentheses
Gargi Sharma [Sat, 18 Feb 2017 05:37:41 +0000 (11:07 +0530)]
staging: wlan-ng: remove extra parentheses

Removes extra parentheses around function arguments. Issue
detected and resolved using the following coccinelle script:

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: fix coding style warning
Lucian Zala [Thu, 16 Feb 2017 18:42:47 +0000 (20:42 +0200)]
staging: fsl-mc: fix coding style warning

Fix for "WARNING: Avoid multiple line dereference - prefer
'mc_msi_domain->host_data'" found by checkpatch.pl in
bus/irq-gic-v3-its-fsl-mc-msi.c.

Signed-off-by: Lucian Zala <zala.lucian@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: xgifb: function prototype argument should also have an identifier name
Arushi Singhal [Wed, 22 Feb 2017 18:16:39 +0000 (23:46 +0530)]
staging: xgifb: function prototype argument should also have an identifier name

function prototype argument 'struct vb_device_info *' and 'unsigned
long' should also have an identifier name.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: xgifb: add braces around if-statements
Katie Dunne [Mon, 20 Feb 2017 20:24:40 +0000 (12:24 -0800)]
staging: xgifb: add braces around if-statements

Add braces to instances of if-statements found by checkpatch.pl
to conform to kernel style.

Signed-off-by: Katie Dunne <kdunne@mail.ccsf.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: xgifb: add braces around if statement
Gargi Sharma [Thu, 16 Feb 2017 18:39:55 +0000 (00:09 +0530)]
staging: xgifb: add braces around if statement

add braces around if statment to fix the checkpatch issue, braces {}
should be used on all arms of this statement.

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fbtft: Make some s16 arrays const
Joe Perches [Thu, 23 Feb 2017 05:54:57 +0000 (21:54 -0800)]
staging: fbtft: Make some s16 arrays const

Using const reduces data size.

$ size drivers/staging/fbtft/built-in.o*
   text    data     bss     dec     hex filename
  89909   41584    2928  134421   20d15 drivers/staging/fbtft/built-in.o.new
  88053   43392    2928  134373   20ce5 drivers/staging/fbtft/built-in.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fbtft: Make the pointers to s16 init arrays const
Joe Perches [Thu, 23 Feb 2017 05:54:56 +0000 (21:54 -0800)]
staging: fbtft: Make the pointers to s16 init arrays const

This allows making some of the actual arrays const.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging:fbtft: Fix some warnings regarding types.
Anthony Brandon [Tue, 21 Feb 2017 13:25:28 +0000 (14:25 +0100)]
staging:fbtft: Fix some warnings regarding types.

Running make C=1 M=drivers/staging/fbtft reports warnings about conversion
from __be16 to unsigned short. Change the type of the variables being
assigned into __be16 to remove those warnings.

Signed-off-by: Anthony Brandon <anthony@amarulasolutions.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: fbtft: fb_watterott: fix incorrect type in assignments
Julián de Gortari [Mon, 20 Feb 2017 03:02:32 +0000 (21:02 -0600)]
Staging: fbtft: fb_watterott: fix incorrect type in assignments

__be16 type variables should be used with return value of macro
cpu_to_be16()

Signed-off-by: Julián de Gortari <kiototeko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fbtft: Remove blank line
Gargi Sharma [Thu, 16 Feb 2017 20:11:57 +0000 (01:41 +0530)]
staging: fbtft: Remove blank line

Remove blank line before closing brace to fix the checkpatch
issue blank lines aren't necessary before a close brace '}'.

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fbtft: Match alignment with open parentheses
Gargi Sharma [Thu, 16 Feb 2017 20:11:56 +0000 (01:41 +0530)]
staging: fbtft: Match alignment with open parentheses

Indent code to match alignment with open parentheses, to
fix the checkpatch issue alignment should match open parenthesis.

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fbtft: Add check on strlcpy() return value
Tobin C. Harding [Wed, 15 Feb 2017 03:27:25 +0000 (14:27 +1100)]
staging: fbtft: Add check on strlcpy() return value

Return value of strlcpy() is not checked. Name string is silently
truncated if longer that SPI_NAME_SIZE, whilst not detrimental to
the program logic it would be nice to notify the user. Module is
currently quite verbose, adding extra pr_warn() calls will not overly
impact this verbosity.

Check return value from call to strlcpy(). If source string is
truncated call pr_warn() to notify user.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fbtft: Replace magic number with constant
Tobin C. Harding [Wed, 15 Feb 2017 03:27:24 +0000 (14:27 +1100)]
staging: fbtft: Replace magic number with constant

Current call to strncmp() uses a magic number. There is a compile
time constant defined for this buffer, included and used already at
other sites in the file.

Remove magic number. Replace with pre-existing compile time constant.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fbtft: Fix buffer overflow vulnerability
Tobin C. Harding [Wed, 15 Feb 2017 03:27:23 +0000 (14:27 +1100)]
staging: fbtft: Fix buffer overflow vulnerability

Module copies a user supplied string (module parameter) into a buffer
using strncpy() and does not check that the buffer is null terminated.

Replace call to strncpy() with call to strlcpy() ensuring that the
buffer is null terminated.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: gdm724x: Drop useless initialisation
simran singhal [Wed, 22 Feb 2017 02:01:09 +0000 (07:31 +0530)]
staging: gdm724x: Drop useless initialisation

Removed initialisation of a varible if it is immediately reassigned.

Changes were made using Coccinelle.

@@
type T;
constant C;
expression e;
identifier i;
@@
T i
- = C
;
i = e;

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: gdm724x: modify icmp6_checksum for returning a correct data type.
Javier Rodriguez [Tue, 14 Feb 2017 17:16:22 +0000 (18:16 +0100)]
staging: gdm724x: modify icmp6_checksum for returning a correct data type.

The icmp6_checksum was returning an invalid data type as the expected type
is __sum16. For returning such data type, icmp6_checksum, now, is using
the kernel functions for computing the checksum.

Here, the sparse message:

drivers/staging/gdm724x/gdm_lte.c:311:39: warning: incorrect type in assignment (different base types)
drivers/staging/gdm724x/gdm_lte.c:311:39:    expected restricted __sum16 [addressable] [assigned] [usertype] icmp6_cksum
drivers/staging/gdm724x/gdm_lte.c:311:39:    got int

Signed-off-by: Javier Rodriguez <jrodbar@yahoo.es>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: comedi: drivers: comedi_test: Avoid multiple line dereference
Cheah Kok Cheong [Tue, 21 Feb 2017 17:25:08 +0000 (01:25 +0800)]
Staging: comedi: drivers: comedi_test: Avoid multiple line dereference

Fix checkpatch warning "Avoid multiple line dereference"
using a pointer variable to avoid line wrap.

Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: Using macro DIV_ROUND_UP
simran singhal [Tue, 21 Feb 2017 18:28:26 +0000 (23:58 +0530)]
staging: comedi: Using macro DIV_ROUND_UP

The macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)).
It clarifies the divisor calculations. This occurence was detected 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: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: s626: Kernel doc format comments
Tobin C. Harding [Tue, 21 Feb 2017 22:45:41 +0000 (09:45 +1100)]
staging: comedi: s626: Kernel doc format comments

Checkpatch emits WARNING: Block comments use a trailing */ on a
separate line. Offending comments are commenting variables within
the main data structure of s626 driver. We can move these comments
to kernel doc format with the benefit of clearing the warning and
improving the documentation for the driver.

Remove comments on structure members. Add original comments to the
head of the structure definition in kernel doc format.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: jr3_pci: replace devpriv->iobase with dev->mmio
Ian Abbott [Fri, 17 Feb 2017 11:09:18 +0000 (11:09 +0000)]
staging: comedi: jr3_pci: replace devpriv->iobase with dev->mmio

The "jr3_pci" driver currently uses the `iobase` member of its private
device data `struct jr3_pci_dev_private` to store a pointer to its
ioremapped register region.  Use the `mmio` member of the `struct
comedi_device` to store this instead, and remove the `iobase` member.
The `iobase` member was of type `struct jr3_t __iomem *`, with the
board's complicated register layout described by `struct jr3_t`.  The
`mmio` member is a generic `void __iomem *`, so its value needs
converting to a `struct jr3_t __iomem *` for our purposes.

Change the clean-up in `jr3_pci_detach()` to call `comedi_pci_detach()`
instead of `comedi_pci_disable()`, as that will iounmap `dev->mmio` for
us.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: jr3_pci: pass transform by reference
Ian Abbott [Fri, 17 Feb 2017 11:09:17 +0000 (11:09 +0000)]
staging: comedi: jr3_pci: pass transform by reference

Local function `set_transforms` has a parameter of type `struct
jr3_pci_transform`.  This has a size 32 bytes, which is quite large for
passing around in a function call.  Change it to use type `const struct
jr3_pci_transform *`.  (In practice, it is probably inlined by the
compiler anyway, but doing this seems to save a few bytes.)

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: jr3_pci: re-work struct jr3_pci_subdev_private range
Ian Abbott [Fri, 17 Feb 2017 11:09:16 +0000 (11:09 +0000)]
staging: comedi: jr3_pci: re-work struct jr3_pci_subdev_private range

The `range` member of `struct jr3_pci_subdev_private` is an array of a
tag-less `struct` type whose layout is similar to `struct
comedi_lrange`.  Both `struct` types end with a member also called
`range`.  In the case of tag-less `struct` type, it is a single `struct
comedi_krange`.  In the case of `struct comedi_lrange`, it is a flexible
array of `struct comedi_krange`.

Elements of the `range` array member in `struct jr3_pci_subdev_private`
are pointed to by elements of the `range_table_list` array member, which
are of type `const struct comedi_lrange *`.  This requires some dodgy
type casting.

To avoid the dodgy type casting, change the element type of the `range`
member of `struct jr3_pci_subdev_private` to be a new type `union
jr3_pci_single_range`.  This contains a member `l` of type `struct
comedi_lrange`, and an array member `_reserved` that is large enough to
encompass the `struct comedi_lrange` plus a single `struct
comedi_krange`.  It is the same size as the previous type.  Accesses to
`spriv->range[i].length` and `spriv->range[i].range` are replaced with
`spriv->range[i].l.length` and `spriv->range[i].l.range[0]` respectively
(where `spriv` is a `struct jr3_pci_subdev_private *`, and `i` is an
array index).  Type-casted pointers to `spriv->range[i]` are replaced
with pointers to `spriv->range[i].l`, which do not require the type
casts.  Since we defined a new type, we can define local variables of
the corresponding pointer type to shorten some lines of code.  This is
made use of in `jr3_pci_alloc_spriv()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: jr3_pci: separate out poll state enum
Ian Abbott [Fri, 17 Feb 2017 11:09:15 +0000 (11:09 +0000)]
staging: comedi: jr3_pci: separate out poll state enum

The type of the `state` member of `struct jr3_pci_subdev_private` is
defined in-situ as an enumerated type without a tag.  For aesthetic
reasons, define the type as `enum jr3_pci_poll_state` outside the
containing `struct`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: jr3_pci: remove next_time_max member
Ian Abbott [Fri, 17 Feb 2017 11:09:14 +0000 (11:09 +0000)]
staging: comedi: jr3_pci: remove next_time_max member

The `next_time_max` member of `struct jr3_pci_subdev_private` is
assigned to, but never read.  Remove it.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: jr3_pci: remove unneeded 'spriv' checks
Ian Abbott [Fri, 17 Feb 2017 11:09:13 +0000 (11:09 +0000)]
staging: comedi: jr3_pci: remove unneeded 'spriv' checks

If `jr3_pci_auto_attach()` returns with no error, we can now be sure
that the COMEDI subdevice private data structures have been allocated.
Remove the tests for a valid pointer to the private data structure in
`jr3_pci_ai_insn_read()`, `jr3_pci_open()`, and
`jr3_pci_poll_subdevice()`, since they will not be called if the pointer
is invalid.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: jr3_pci: re-work firmware copyright display
Ian Abbott [Fri, 17 Feb 2017 11:09:12 +0000 (11:09 +0000)]
staging: comedi: jr3_pci: re-work firmware copyright display

If debug messages are enabled, the card initialization done in
`jr3_pci_auto_attach()` spits out 24 (0x18) debug messages to show the
null-terminated copyright string embedded in the firmware, one character
at a time, including the ASCII NUL characters at the end.  Factor out
the copyright display into a new function `jr3_pci_show_copyright()` and
re-work it to copy the whole copyright string into a buffer, so that it
can be shown with a single debug message.

Incidentally, this also removes a checkpatch warning "Avoid multiple
line dereference" in the original code.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: jr3_pci: struct comedi_lrange should normally be const
Ian Abbott [Fri, 17 Feb 2017 11:09:11 +0000 (11:09 +0000)]
staging: comedi: jr3_pci: struct comedi_lrange should normally be const

Fix three checkpatch warnings of the form:

WARNING: struct comedi_lrange should normally be const

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: jr3_pci: Reset all DSPs
Ian Abbott [Fri, 17 Feb 2017 11:09:10 +0000 (11:09 +0000)]
staging: comedi: jr3_pci: Reset all DSPs

The various JR3 PCI models have from 1 to 4 DSPs, one per subdevice.
Prior to loading the firmware to all the DSPs, the initialization code
in `jr3_pci_auto_attach()` resets the first DSP.  As far as I can tell,
it should reset all of them.  Change it to do so.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: jr3_pci: cope with jiffies wraparound
Ian Abbott [Fri, 17 Feb 2017 11:09:09 +0000 (11:09 +0000)]
staging: comedi: jr3_pci: cope with jiffies wraparound

The timer expiry routine `jr3_pci_poll_dev()` checks for expiry by
checking whether the absolute value of `jiffies` (stored in local
variable `now`) is greater than the expected expiry time in jiffy units.
This will fail when `jiffies` wraps around.  Also, it seems to make
sense to handle the expiry one jiffy earlier than the current test.  Use
`time_after_eq()` to check for expiry.

Cc: <stable@vger.kernel.org> # 3.15+
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: comedi: jr3_pci: fix possible null pointer dereference
Ian Abbott [Fri, 17 Feb 2017 11:09:08 +0000 (11:09 +0000)]
staging: comedi: jr3_pci: fix possible null pointer dereference

For some reason, the driver does not consider allocation of the
subdevice private data to be a fatal error when attaching the COMEDI
device.  It tests the subdevice private data pointer for validity at
certain points, but omits some crucial tests.  In particular,
`jr3_pci_auto_attach()` calls `jr3_pci_alloc_spriv()` to allocate and
initialize the subdevice private data, but the same function
subsequently dereferences the pointer to access the `next_time_min` and
`next_time_max` members without checking it first.  The other missing
test is in the timer expiry routine `jr3_pci_poll_dev()`, but it will
crash before it gets that far.

Fix the bug by returning `-ENOMEM` from `jr3_pci_auto_attach()` as soon
as one of the calls to `jr3_pci_alloc_spriv()` returns `NULL`.  The
COMEDI core will subsequently call `jr3_pci_detach()` to clean up.

Cc: <stable@vger.kernel.org> # 3.15+
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: remove visorchipset_platform_device
Sameer Wadgaonkar [Tue, 21 Feb 2017 17:53:31 +0000 (12:53 -0500)]
staging: unisys: visorbus: remove visorchipset_platform_device

Removed visorchipset_platform_device and all the unused structures
and functions and using chipset_dev.acpi_device instead.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: remove character device interface
Sameer Wadgaonkar [Tue, 21 Feb 2017 17:53:30 +0000 (12:53 -0500)]
staging: unisys: visorbus: remove character device interface

Removed the character device interface from visorchipset and
removed the major and minor numbers.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: added struct visorchipset_device
Sameer Wadgaonkar [Tue, 21 Feb 2017 17:53:29 +0000 (12:53 -0500)]
staging: unisys: visorbus: added struct visorchipset_device

Added the structure visorchipset_device and moved the globals to
the struct. The visorchipset_init() function saves acpi_device
within this structure.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorhba: visorhba_main.c: Remove kernel-doc comments
David Binder [Tue, 21 Feb 2017 17:53:28 +0000 (12:53 -0500)]
staging: unisys: visorhba: visorhba_main.c: Remove kernel-doc comments

Removes kernel-doc formatting for comments that precede static functions.

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visornic: visornic_main.c: Remove kernel-doc comments
David Binder [Tue, 21 Feb 2017 17:53:27 +0000 (12:53 -0500)]
staging: unisys: visornic: visornic_main.c: Remove kernel-doc comments

Removes kernel-doc formatting for comments that precede static functions.

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>