Commit graph

27 commits

Author SHA1 Message Date
Colin Ian King 0985f006ec staging: rtlwifi: fix spelling mistake: "Hightest" -> "Highest"
Trivial fix to spelling mistake in ODM_RT_TRACE message text, fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-19 11:12:08 +01:00
Colin Ian King 44b44c98ca staging: rtlwifi: fix spelling mistake "disnabled" -> "disabled"
There is a spelling mistake in an ODM_RT_TRACE message, fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-05 09:39:45 +01:00
Maya Nakamura c4da110919 staging: rtlwifi: Add spaces for comments
Add spaces before and after text in comments.

Signed-off-by: Maya Nakamura <m.maya.nakamura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-08 03:59:48 -08:00
Maya Nakamura b4a6993ec4 staging: rtlwifi: Remove empty comment
Remove a comment that does not contain any text.

Signed-off-by: Maya Nakamura <m.maya.nakamura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-08 03:59:47 -08:00
Maya Nakamura 868b5d7d99 staging: rtlwifi: Improve line endings
Edit statements so that the line does not end with an assignment operator
or a parenthesis.

Signed-off-by: Maya Nakamura <m.maya.nakamura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-08 03:59:47 -08:00
Colin Ian King c4aacbb981 drivers: staging: rtl*: fix spelling mistake "Orginial" -> "Original"
Trivial fix to common spelling mistakes in some rtl* drivers

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07 12:35:10 +01:00
Maya Nakamura 459b678571 staging: rtlwifi: Keep expressions on one line
Edit two statements to keep expressions on one line--one from Julia's
feedback.

Signed-off-by: Maya Nakamura <m.maya.nakamura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-05 14:53:58 +01:00
Maya Nakamura ec5043bf85 staging: rtlwifi: Remove unnecessary conditions
Remove conditions with no effect. Issues found by Coccinelle's semantic
patch results for cond_no_effect.cocci. Eliminate checkpatch result, a
line should not end with a parenthesis.

Signed-off-by: Maya Nakamura <m.maya.nakamura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-05 14:53:58 +01:00
Maya Nakamura 95a32556da staging: rtlwifi: Replace 1 with true and remove comparison for bool
Replace 1 with true for bool assignments and remove a comparison of a bool
with 1. Issues found by Coccinelle's semantic patch results for
boolinit.cocci.

Signed-off-by: Maya Nakamura <m.maya.nakamura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-05 14:53:58 +01:00
Maya Nakamura 33593a9630 staging: rtlwifi: Remove unused functions
Remove the five functions that are not used from the source and header
files. Issue found by Coccinelle's semantic patch results for
returnvar.cocci.

Signed-off-by: Maya Nakamura <m.maya.nakamura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-05 14:16:33 +01:00
Maya Nakamura f400dc6a66 staging: rtlwifi: Remove function that only returns zero
Because the odm_sq_process_patch_rt_cid_819x_lenovo function is only called
to return zero, remove the unnecessary function and change the section that
calls it. Issues found by Coccinelle's semantic patch results for
returnvar.cocci and checkpatch.pl.

Signed-off-by: Maya Nakamura <m.maya.nakamura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-05 14:16:33 +01:00
Maya Nakamura 948569b72a staging: rtlwifi: Remove function that only returns the second argument
Because the odm_signal_scale_mapping function is only called to return the
second argument, remove the unnecessary function and change the statements
that call it, including removing unneeded braces and adding a blank line.

Note that removing casts (u8 to s32 and back to u8) will not lose
information because the value converted should be between 0 and 100.

Signed-off-by: Maya Nakamura <m.maya.nakamura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-05 14:16:33 +01:00
Colin Ian King 9e269dcdec staging: rtlwifi: phydm: fix spelling mistake "Abnrormal" -> "Abnormal"
Trivial fix to spelling mistake in message text

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-14 13:31:53 +02:00
Nathan Chancellor b99e0ce20f staging: rtlwifi: Remove unnecessary parentheses
Clang warns when multiple pairs of parentheses are used for a single
conditional statement.

drivers/staging/rtlwifi/phydm/phydm_adc_sampling.c:558:33: warning:
equality comparison with extraneous parentheses [-Wparentheses-equality]
                } else if ((is_enable_la_mode == 1)) {
                            ~~~~~~~~~~~~~~~~~~^~~~
drivers/staging/rtlwifi/phydm/phydm_adc_sampling.c:558:33: note: remove
extraneous parentheses around the comparison to silence this warning
                } else if ((is_enable_la_mode == 1)) {
                           ~                  ^   ~
drivers/staging/rtlwifi/phydm/phydm_adc_sampling.c:558:33: note: use '='
to turn this equality comparison into an assignment
                } else if ((is_enable_la_mode == 1)) {
                                              ^~
                                              =
1 warning generated.

Link: https://github.com/ClangBuiltLinux/linux/issues/172
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-09 15:13:24 +02:00
Sabin Mihai Rapan dba1b8ac73 staging: rtlwifi: Fix "Trafic"->"Traffic"
Trivial fix to spelling mistake in comment text.

Signed-off-by: Sabin Mihai Rapan <sabin.rapan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-17 09:05:14 +02:00
Colin Ian King 70ac74619c staging: rtlwifi: fix spelling mistake: "Platfoem" -> "Platform"
Trivial fix to spelling mistake in ODM_RT_TRACE message text

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25 18:44:13 +02:00
Colin Ian King fb28c0e0fe staging: rtlwifi: fix spelling mistake: "traking" -> "tracking"
Trivial fix to spelling mistake in ODM_RT_TRACE message text

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-11 11:48:24 +02:00
Colin Ian King cddef80270 staging: r8822be: fix typo in variable name "offest" -> "offset"
There are multiple occurrances of typos of "offest" that should be
"offset". Fix these.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:09:24 -07:00
Nathan Chancellor a67cfe3905 staging: rtlwifi: Replace license boilerplate with SPDX identifiers
This satisfies a checkpatch.pl warning and is the preferred method for
notating the license due to its lack of ambiguity.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:01:29 -07:00
Colin Ian King 250f26c584 staging: r8822be: fix typos in header guard macros
The macros for __PHYDMKFREE_H__ and __PHYDM_FEATURES_H__ contain
typos and don't match the #if guard check. Defined them correctly.

Cleans up clang warnings:
warning: '__PHYDMKFREE_H__' is used as a header guard here, followed
by #define of a different macro [-Wheader-guard]
warning: '__PHYDM_FEATURES_H__' is used as a header guard here, followed
by #define of a different macro [-Wheader-guard]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-29 11:54:38 +02:00
Arushi Singhal 314af4f77c staging: rtlwifi: Remove nonessential semicolon
Remove non-essential semicolon after 'else' and 'switch' statements. Issue
found using semicolon.cocci Coccinelle script.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06 04:01:11 -08:00
Santha Meena Ramamoorthy 3334a76c3a staging: rtlwifi: remove unneeded semicolon
Remove unneeded semicolon after 'while' and 'switch' statements. Issue
found using semicolon.cocci Coccinelle script.

Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06 04:01:11 -08:00
Frank A. Cancio Bello 38b2b2e822 staging: rtlwifi: phydm: Remove useless parentheses
Remove unnecessary parentheses to comply with preferred coding style for
the linux kernel and avoid the following checkpatch's message:
'CHECK: Unnecessary parentheses around'.

Credits to checkpatch.

Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-18 15:53:50 +02:00
Kees Cook f8af6a3233 staging: rtlwifi: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly. Also drops unused odm timer code.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: shaofu <shaofu@realtek.com>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-18 15:52:39 +02:00
Larry Finger 43d15c2013 staging: rtl8822be: Keep array subscript no lower than zero
The kbuild test robot reports the following:
   drivers/staging//rtlwifi/phydm/phydm_dig.c: In function 'odm_pause_dig':
   drivers/staging//rtlwifi/phydm/phydm_dig.c:494:45: warning: array subscript is below array bounds [-Warray-bounds]
      odm_write_dig(dm, dig_tab->pause_dig_value[max_level]);

This condition is caused when a loop falls through. The fix is to pin
max_level to be >= 0.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
c: kbuild test robot <fengguang.wu@intel.com>
Fixes: 9ce99b04b5 staging: r8822be: Add phydm mini driver
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-18 15:33:15 +02:00
Jérémy Lefaure 2595587d7e staging: rtlwifi: use ARRAY_SIZE
Using the ARRAY_SIZE macro improves the readability of the code. Also,
it is useless to use a variable to store this constant calculated at
compile time.

Found with Coccinelle with the following semantic patch:
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
 (sizeof(E)@p /sizeof(*E))
|
 (sizeof(E)@p /sizeof(E[...]))
|
 (sizeof(E)@p /sizeof(T))
)

Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03 18:34:56 +02:00
Ping-Ke Shih 9ce99b04b5 staging: r8822be: Add phydm mini driver
The RTL8822BE, an 802.11ac wireless network card, is now appearing in
new computers. Its driver is being placed in staging to reduce the time
that users of this new card will have access to in-kernel drivers.

New Realtek wireless devices have a new method for PHY control and
dynamic management. The RTL8822BE is the first of these devices, thus
there is additional code required.

In the final version, this code will be a separate module; however,
it is combined with the r8822be driver to minimize the interference
with the drivers in the wireless tree.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-20 11:13:12 -07:00