platform/kernel/linux-starfive.git
3 years agostaging: vt6655: remove filename from baseband.h
Lucas Henneman [Fri, 23 Jul 2021 14:43:26 +0000 (10:43 -0400)]
staging: vt6655: remove filename from baseband.h

This patch resolves checkpatch's warning, "It's generally not useful to
have the filename in the file" for baseband.h.

Signed-off-by: Lucas Henneman <lucas.henneman@linaro.org>
Link: https://lore.kernel.org/r/20210723144340.15787-1-lucas.henneman@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging/rtl8192u: Remove all strcpy() uses in favor of strscpy()
Len Baker [Sun, 18 Jul 2021 11:32:07 +0000 (13:32 +0200)]
staging/rtl8192u: Remove all strcpy() uses in favor of strscpy()

strcpy() performs no bounds checking on the destination buffer. This
could result in linear overflows beyond the end of the buffer, leading
to all kinds of misbehaviors. The safe replacement is strscpy().

Signed-off-by: Len Baker <len.baker@gmx.com>
Link: https://lore.kernel.org/r/20210718113207.10045-1-len.baker@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging/ks7010: Remove all strcpy() uses in favor of strscpy()
Len Baker [Fri, 23 Jul 2021 14:51:22 +0000 (16:51 +0200)]
staging/ks7010: Remove all strcpy() uses in favor of strscpy()

strcpy() performs no bounds checking on the destination buffer. This
could result in linear overflows beyond the end of the buffer, leading
to all kinds of misbehaviors. The safe replacement is strscpy().

Signed-off-by: Len Baker <len.baker@gmx.com>
Link: https://lore.kernel.org/r/20210723145122.5746-1-len.baker@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging/rtl8192e: Remove all strcpy() uses
Len Baker [Fri, 23 Jul 2021 17:32:16 +0000 (19:32 +0200)]
staging/rtl8192e: Remove all strcpy() uses

strcpy() performs no bounds checking on the destination buffer. This
could result in linear overflows beyond the end of the buffer, leading
to all kinds of misbehaviors. The safe replacement is strscpy().

It is also dangerous a strcpy() followed by a strcat(). In this case,
refactor the code using scnprintf() and avoid this combination.

Signed-off-by: Len Baker <len.baker@gmx.com>
Link: https://lore.kernel.org/r/20210723173216.12157-1-len.baker@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoMAINTAINERS: remove section HISILICON STAGING DRIVERS FOR HIKEY 960/970
Lukas Bulwahn [Tue, 27 Jul 2021 09:31:54 +0000 (11:31 +0200)]
MAINTAINERS: remove section HISILICON STAGING DRIVERS FOR HIKEY 960/970

Commit 9bd9e0de1cf5 ("mfd: hi6421-spmi-pmic: move driver from staging")
moves the last driver out of ./drivers/staging/hikey9xx/ and removes that
directory, but missed to adjust the HISILICON STAGING DRIVERS FOR HIKEY
960/970 section in MAINTAINERS.

Hence, ./scripts/get_maintainer.pl --self-test=patterns complains:

  warning: no file matches    F:    drivers/staging/hikey9xx/

As the directory ./drivers/staging/hikey9xx/ is gone, remove the section
HISILICON STAGING DRIVERS FOR HIKEY 960/970 in MAINTAINERS as well.

Acked-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Link: https://lore.kernel.org/r/20210727093154.553-1-lukas.bulwahn@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove unused IQKMatrixRegSetting array
Martin Kaiser [Sun, 25 Jul 2021 15:59:02 +0000 (17:59 +0200)]
staging: rtl8188eu: remove unused IQKMatrixRegSetting array

The IQKMatrixRegSetting array in struct odm_rf_cal is initialised
but never used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210725155902.32433-18-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: simplify phy_lc_calibrate
Martin Kaiser [Sun, 25 Jul 2021 15:59:01 +0000 (17:59 +0200)]
staging: rtl8188eu: simplify phy_lc_calibrate

phy_lc_calibrate's is2t parameter is always false.
Remove some code that would be called only for is2t == true.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210725155902.32433-17-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: simplify path_adda_on
Martin Kaiser [Sun, 25 Jul 2021 15:59:00 +0000 (17:59 +0200)]
staging: rtl8188eu: simplify path_adda_on

path_adda_on's is2t parameter is always false.
Remove some code that would be called only for is2t == true.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210725155902.32433-16-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: simplify phy_iq_calibrate
Martin Kaiser [Sun, 25 Jul 2021 15:58:59 +0000 (17:58 +0200)]
staging: rtl8188eu: simplify phy_iq_calibrate

phy_iq_calibrate's is2t parameter is always false.
Remove some code that would be called only for is2t == true.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210725155902.32433-15-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: simplify rtl88eu_phy_iq_calibrate
Martin Kaiser [Mon, 26 Jul 2021 19:53:54 +0000 (21:53 +0200)]
staging: rtl8188eu: simplify rtl88eu_phy_iq_calibrate

The boolean is2t variable in rtl88eu_phy_iq_calibrate is always false.
Remove some code that's unused in this case.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210726195354.28548-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove write-only HwRxPageSize
Martin Kaiser [Sun, 25 Jul 2021 15:58:57 +0000 (17:58 +0200)]
staging: rtl8188eu: remove write-only HwRxPageSize

HwRxPageSize from struct hal_data_8188e is set but never read. Remove the
component and the code to initialise it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210725155902.32433-13-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove unused IntrMask
Martin Kaiser [Sun, 25 Jul 2021 15:58:56 +0000 (17:58 +0200)]
staging: rtl8188eu: remove unused IntrMask

The IntrMask array is set but never read. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210725155902.32433-12-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove two write-only hal components
Martin Kaiser [Sun, 25 Jul 2021 15:58:55 +0000 (17:58 +0200)]
staging: rtl8188eu: remove two write-only hal components

RegTxPause and RegBcnCtrlVal from struct hal_data_8188e are set but
never read. Remove them.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210725155902.32433-11-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove write-only power struct component
Martin Kaiser [Sun, 25 Jul 2021 15:58:54 +0000 (17:58 +0200)]
staging: rtl8188eu: remove write-only power struct component

pwrpriv->bFwCurrentInPSMode is initialized and updated but nobody reads
its value. Remove this write-only component.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210725155902.32433-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove unused _HAL_INTF_C_ define
Martin Kaiser [Sun, 25 Jul 2021 15:58:53 +0000 (17:58 +0200)]
staging: rtl8188eu: remove unused _HAL_INTF_C_ define

This define can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210725155902.32433-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove yet another unused enum
Martin Kaiser [Sun, 25 Jul 2021 15:58:52 +0000 (17:58 +0200)]
staging: rtl8188eu: remove yet another unused enum

The hardware_type enum is not used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210725155902.32433-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove a bunch of unused defines
Martin Kaiser [Sun, 25 Jul 2021 15:58:51 +0000 (17:58 +0200)]
staging: rtl8188eu: remove a bunch of unused defines

Only RF_CHANGE_BY_PS is used by this driver, the other
RF_CHANGE_BY_... defines can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210725155902.32433-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove another unused enum
Martin Kaiser [Sun, 25 Jul 2021 15:58:50 +0000 (17:58 +0200)]
staging: rtl8188eu: remove another unused enum

The rt_eeprom_type enum is not used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210725155902.32433-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove an unused enum
Martin Kaiser [Sun, 25 Jul 2021 15:58:49 +0000 (17:58 +0200)]
staging: rtl8188eu: remove an unused enum

The hal_intf_ps_func enum is not used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210725155902.32433-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: simplify Hal_EfuseParseMACAddr_8188EU
Martin Kaiser [Sun, 25 Jul 2021 15:58:48 +0000 (17:58 +0200)]
staging: rtl8188eu: simplify Hal_EfuseParseMACAddr_8188EU

The hwinfo and AutoLoadFail parameters can be obtained from
struct adapter, there's no need to pass them as separate
function parameters.

Use memcpy instead of bytewise copy if we have to fall back to the
hard-coded mac address.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210725155902.32433-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove HW_VAR_TXPAUSE
Martin Kaiser [Sun, 25 Jul 2021 15:58:47 +0000 (17:58 +0200)]
staging: rtl8188eu: remove HW_VAR_TXPAUSE

The "HAL layer variable" HW_VAR_TXPAUSE is not used in this driver.
Remove its define and the code for setting and for reading a value.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210725155902.32433-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove HW_VAR_MEDIA_STATUS1
Martin Kaiser [Sun, 25 Jul 2021 15:58:46 +0000 (17:58 +0200)]
staging: rtl8188eu: remove HW_VAR_MEDIA_STATUS1

The "HAL layer variable" HW_VAR_MEDIA_STATUS1 is not used in this driver.
Remove its define and the code for setting a value.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210725155902.32433-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove unused defines
Martin Kaiser [Sun, 25 Jul 2021 15:58:45 +0000 (17:58 +0200)]
staging: rtl8188eu: remove unused defines

Now that power cut mask is not used any more, we can also remove the
defines for power cut masks.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210725155902.32433-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove braces from single line if blocks
Michael Straube [Mon, 26 Jul 2021 09:21:29 +0000 (11:21 +0200)]
staging: rtl8188eu: remove braces from single line if blocks

Remove braces from single line if blocks to clear checkpatch warnings.
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210726092129.30334-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove blank lines
Michael Straube [Mon, 26 Jul 2021 09:10:14 +0000 (11:10 +0200)]
staging: rtl8188eu: remove blank lines

Remove unnecessary blank lines reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210726091014.21405-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: Remove no more used functions and variables
Fabio M. De Francesco [Fri, 23 Jul 2021 19:26:20 +0000 (21:26 +0200)]
staging: rtl8188eu: Remove no more used functions and variables

Remove the functions and variables from rtw_security.c that are no more
necessary since the patch that replaces getcrc32() with crc32_le().

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210723192620.10669-3-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: Replace a custom function with crc32_le()
Fabio M. De Francesco [Fri, 23 Jul 2021 19:26:19 +0000 (21:26 +0200)]
staging: rtl8188eu: Replace a custom function with crc32_le()

Use crc32_le() in place of the custom getcrc32().

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210723192620.10669-2-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging/wlan-ng: Remove all strcpy() uses in favor of strscpy()
Len Baker [Sat, 17 Jul 2021 15:20:32 +0000 (17:20 +0200)]
staging/wlan-ng: Remove all strcpy() uses in favor of strscpy()

strcpy() performs no bounds checking on the destination buffer. This
could result in linear overflows beyond the end of the buffer, leading
to all kinds of misbehaviors. The safe replacement is strscpy().

Signed-off-by: Len Baker <len.baker@gmx.com>
Link: https://lore.kernel.org/r/20210717152032.10164-1-len.baker@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging/most: Remove all strcpy() uses in favor of strscpy()
Len Baker [Sat, 17 Jul 2021 16:05:12 +0000 (18:05 +0200)]
staging/most: Remove all strcpy() uses in favor of strscpy()

strcpy() performs no bounds checking on the destination buffer. This
could result in linear overflows beyond the end of the buffer, leading
to all kinds of misbehaviors. The safe replacement is strscpy().

Signed-off-by: Len Baker <len.baker@gmx.com>
Link: https://lore.kernel.org/r/20210717160512.16176-1-len.baker@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: ks7010: Fix the initialization of the 'sleep_status' structure
Christophe JAILLET [Wed, 21 Jul 2021 08:45:11 +0000 (10:45 +0200)]
staging: ks7010: Fix the initialization of the 'sleep_status' structure

'sleep_status' has 3 atomic_t members. Initialize the 3 of them instead of
initializing only 2 of them and setting 0 twice to the same variable.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/d2e52a33a9beab41879551d0ae2fdfc99970adab.1626856991.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: Line over 100 characters
Jignesh Patel [Fri, 23 Jul 2021 09:45:16 +0000 (15:15 +0530)]
staging: rtl8188eu: Line over 100 characters

Break lines into multiple lines to respect 100 character width limit.
Reported by checkpatch.pl

Signed-off-by: Jignesh Patel <jigs0101@gmail.com>
Link: https://lore.kernel.org/r/20210723094524.8811-1-jigs0101@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove unnecessary blank lines in core/rtw_ap.c
Benjamin Philip [Thu, 22 Jul 2021 06:44:51 +0000 (12:14 +0530)]
staging: rtl8188eu: remove unnecessary blank lines in core/rtw_ap.c

This commit fixes some checkpatch checks for blank lines before
and after braces in drivers/staging/rtl8188eu/core/rtw_ap.c

Signed-off-by: Benjamin Philip <benjamin.philip495@gmail.com>
Link: https://lore.kernel.org/r/20210722064451.10331-1-benjamin.philip495@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: Remove unused iw_operation_mode[]
Fabio M. De Francesco [Wed, 21 Jul 2021 11:28:29 +0000 (13:28 +0200)]
staging: rtl8188eu: Remove unused iw_operation_mode[]

Remove unused iw_operation_mode array.

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210721112829.17317-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: fix camel case in struct ndis_802_11_wep
Fabio Aiuto [Wed, 21 Jul 2021 13:37:23 +0000 (15:37 +0200)]
staging: rtl8723bs: fix camel case in struct ndis_802_11_wep

fix camel case in struct ndis_802_11_wep all over the driver.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/d3a1407e1bcb07d423dfa0c9bd33021a59bc0b61.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unused struct ndis_801_11_ai_resfi
Fabio Aiuto [Wed, 21 Jul 2021 13:37:22 +0000 (15:37 +0200)]
staging: rtl8723bs: remove unused struct ndis_801_11_ai_resfi

remove unused struct ndis_801_11_ai_resfi.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/23f5764080f84e3704654b11db455e4d5ad499bb.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unused struct ndis_802_11_ai_reqfi
Fabio Aiuto [Wed, 21 Jul 2021 13:37:21 +0000 (15:37 +0200)]
staging: rtl8723bs: remove unused struct ndis_802_11_ai_reqfi

remove unused struct ndis_802_11_ai_reqfi.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/00ed84b66a0a325cb1a09ad6e2d2c0fa19686a88.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: fix camel case in IE structures
Fabio Aiuto [Wed, 21 Jul 2021 13:37:20 +0000 (15:37 +0200)]
staging: rtl8723bs: fix camel case in IE structures

fix camel case in IE structures all over the driver.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/c1b36466fb5e17aa0dbbcdf6dfef3a82f9739c00.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: fix camel case in struct wlan_bcn_info
Fabio Aiuto [Wed, 21 Jul 2021 13:37:19 +0000 (15:37 +0200)]
staging: rtl8723bs: fix camel case in struct wlan_bcn_info

fix camel case in struct wlan_bcn_info all over the driver.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/52c74cf0183da44f2ddaac2607e4b7ccaf9abd91.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: fix camel case in struct wlan_phy_info
Fabio Aiuto [Wed, 21 Jul 2021 13:37:18 +0000 (15:37 +0200)]
staging: rtl8723bs: fix camel case in struct wlan_phy_info

fix camel case in struct wlan_phy_info all over the driver.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/caadcfc157d62b633fd757d5696c1abce5ef9ae9.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: fix camel case in struct ndis_802_11_ssid
Fabio Aiuto [Wed, 21 Jul 2021 13:37:17 +0000 (15:37 +0200)]
staging: rtl8723bs: fix camel case in struct ndis_802_11_ssid

fix camel case in struct ndis_802_11_ssid all over the driver.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/e7c4cc09840e112d59ed7dcf8465f1916f95b819.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove struct ndis_802_11_conf_fh
Fabio Aiuto [Wed, 21 Jul 2021 13:37:16 +0000 (15:37 +0200)]
staging: rtl8723bs: remove struct ndis_802_11_conf_fh

all members of struct ndis_802_11_conf_fh fh_config in
struct ndis_802_11_conf are set to zero and their values
are never used. So remove struct ndis_802_11_conf_fh.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/9c203ab5fe8a36b96f1f24e1fbf1a08ea0fa82af.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: fix camel case in struct ndis_802_11_conf
Fabio Aiuto [Wed, 21 Jul 2021 13:37:15 +0000 (15:37 +0200)]
staging: rtl8723bs: fix camel case in struct ndis_802_11_conf

fix camel case in struct ndis_802_11_conf

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/90317df66de1476515bf46477ac097a73f35cf81.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: fix camel case in struct wlan_bssid_ex
Fabio Aiuto [Wed, 21 Jul 2021 13:37:14 +0000 (15:37 +0200)]
staging: rtl8723bs: fix camel case in struct wlan_bssid_ex

fix camel case in struct wlan_bssid_ex.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/561065e95ff38f0dbedf030c3acf0498396a1759.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove commented out condition
Fabio Aiuto [Wed, 21 Jul 2021 13:37:13 +0000 (15:37 +0200)]
staging: rtl8723bs: remove commented out condition

remove commented out condition checking channel > 14.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/83762719c0c13ac8b78612a32db26e691eef17d1.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove 5Ghz code blocks
Fabio Aiuto [Wed, 21 Jul 2021 13:37:12 +0000 (15:37 +0200)]
staging: rtl8723bs: remove 5Ghz code blocks

remove 5 Ghz code blocks, related to networks
working over channel numbers above 14.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/c64443b92ce1a60f568db153842a62e3244a8c3a.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: add spaces around operator
Fabio Aiuto [Wed, 21 Jul 2021 13:37:11 +0000 (15:37 +0200)]
staging: rtl8723bs: add spaces around operator

fix the following post-commit hook checkpatch warning:

CHECK: spaces preferred around that '+' (ctx:VxV)
29: FILE: drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:2238:
+ hal_get_chnl_group_8723b(ch+1, &group);

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/e9f65e7600a3c935ef9c310e782790e04cc1f17f.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: convert function name to snake case
Fabio Aiuto [Wed, 21 Jul 2021 13:37:10 +0000 (15:37 +0200)]
staging: rtl8723bs: convert function name to snake case

convert Hal_GetChnlGroup8723B() function name to snake
case.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/78bbc5cb8531bc03eccfa2f67ee71979cbfbf12e.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: fix camel case inside function
Fabio Aiuto [Wed, 21 Jul 2021 13:37:09 +0000 (15:37 +0200)]
staging: rtl8723bs: fix camel case inside function

fix camel case inside function Hal_GetChnlGroup8723B()

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/831b5f56cc6df8885ac61837fe53f63e021b289b.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: simplify function selecting channel group
Fabio Aiuto [Wed, 21 Jul 2021 13:37:08 +0000 (15:37 +0200)]
staging: rtl8723bs: simplify function selecting channel group

simplify function Hal_GetChnlGroup8723B(). It returns
an unused and unnecessary bool value telling which
band the device works on. Since we work only on
2.4Ghz band and the useful return value is the
second function argument we convert the return type to
void.

remove 5Ghz dead code either (for channel > 14).

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/a5536788004c44fe819c0eab0d19504824af46cd.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agomfd: hi6421-spmi-pmic: move driver from staging
Mauro Carvalho Chehab [Fri, 23 Jul 2021 07:40:06 +0000 (09:40 +0200)]
mfd: hi6421-spmi-pmic: move driver from staging

This driver is ready for mainstream. So, move it out of staging.

Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/dd150f3ffa19c2dda0171f7dbe1dd63cce2a7af5.1627025657.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: hisilicon,hi6421-spmi-pmic.yaml: fix patternProperties
Mauro Carvalho Chehab [Sat, 17 Jul 2021 09:58:17 +0000 (11:58 +0200)]
staging: hisilicon,hi6421-spmi-pmic.yaml: fix patternProperties

The regex at the patternProperties is wrong, although this was
not reported as the DT schema was not enforcing properties.

Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/46b2f30df235481cb1404913380e45706dfd8253.1626515862.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: hikey9xx: split hi6421v600 irq into a separate driver
Mauro Carvalho Chehab [Sat, 17 Jul 2021 09:58:15 +0000 (11:58 +0200)]
staging: hikey9xx: split hi6421v600 irq into a separate driver

Per MFD subsystem requirements, split the IRQ part of the
driver into a separate one with just the IRQ handling code
and the powerkey support.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/709e01c9ffafe6cd0ecb23336b44f9bcde2b5bc2.1626515862.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: hi6421-spmi-pmic: add a missing dot at copyright
Mauro Carvalho Chehab [Sat, 17 Jul 2021 09:58:14 +0000 (11:58 +0200)]
staging: hi6421-spmi-pmic: add a missing dot at copyright

The Huawei's copyright is missing a dot at the end. Add it,
in order to make it similar to the other two copyrights.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/8e280ebe4e577e6c2d919346868f0d27f98ebd49.1626515862.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: hi6421-spmi-pmic: rename GPIO IRQ OF node
Mauro Carvalho Chehab [Sat, 17 Jul 2021 09:58:13 +0000 (11:58 +0200)]
staging: hi6421-spmi-pmic: rename GPIO IRQ OF node

Instead of using the standard name ("gpios"), use "interrupts".

Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/8b2cad1e9b9904c6a2aaea8786d5e5a39f09ac19.1626515862.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: hi6421-spmi-pmic: rename spmi_device struct
Mauro Carvalho Chehab [Sat, 17 Jul 2021 09:58:12 +0000 (11:58 +0200)]
staging: hi6421-spmi-pmic: rename spmi_device struct

Let's not call a pointer to spmi_device as pdev, as it is
something else.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/758e98d7f59d739b68b33723a02aca8b9464f8da.1626515862.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: bcm2835-audio: Enclose complex macro value in parentheses
Diego Roux [Fri, 16 Jul 2021 02:49:00 +0000 (21:49 -0500)]
staging: bcm2835-audio: Enclose complex macro value in parentheses

This patch fixes the checkpatch.pl error:

ERROR: Macros with complex values should be enclosed in parentheses

Signed-off-by: Diego Roux <me@diegoroux04.dynv6.net>
Link: https://lore.kernel.org/r/20210716024909.39411-1-me@diegoroux04.dynv6.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: board: Fix uninitialized spinlock when attaching genpd
Geert Uytterhoeven [Wed, 14 Jul 2021 10:13:46 +0000 (12:13 +0200)]
staging: board: Fix uninitialized spinlock when attaching genpd

On Armadillo-800-EVA with CONFIG_DEBUG_SPINLOCK=y:

    BUG: spinlock bad magic on CPU#0, swapper/1
     lock: lcdc0_device+0x10c/0x308, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
    CPU: 0 PID: 1 Comm: swapper Not tainted 5.11.0-rc5-armadillo-00036-gbbca04be7a80-dirty #287
    Hardware name: Generic R8A7740 (Flattened Device Tree)
    [<c010c3c8>] (unwind_backtrace) from [<c010a49c>] (show_stack+0x10/0x14)
    [<c010a49c>] (show_stack) from [<c0159534>] (do_raw_spin_lock+0x20/0x94)
    [<c0159534>] (do_raw_spin_lock) from [<c040858c>] (dev_pm_get_subsys_data+0x8c/0x11c)
    [<c040858c>] (dev_pm_get_subsys_data) from [<c05fbcac>] (genpd_add_device+0x78/0x2b8)
    [<c05fbcac>] (genpd_add_device) from [<c0412db4>] (of_genpd_add_device+0x34/0x4c)
    [<c0412db4>] (of_genpd_add_device) from [<c0a1ea74>] (board_staging_register_device+0x11c/0x148)
    [<c0a1ea74>] (board_staging_register_device) from [<c0a1eac4>] (board_staging_register_devices+0x24/0x28)

of_genpd_add_device() is called before platform_device_register(), as it
needs to attach the genpd before the device is probed.  But the spinlock
is only initialized when the device is registered.

Fix this by open-coding the spinlock initialization, cfr.
device_pm_init_common() in the internal drivers/base code, and in the
SuperH early platform code.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/57783ece7ddae55f2bda2f59f452180bff744ea0.1626257398.git.geert+renesas@glider.be
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging/rtl8712: Remove all strcpy() uses in favor of strscpy()
Len Baker [Sat, 17 Jul 2021 15:51:45 +0000 (17:51 +0200)]
staging/rtl8712: Remove all strcpy() uses in favor of strscpy()

strcpy() performs no bounds checking on the destination buffer. This
could result in linear overflows beyond the end of the buffer, leading
to all kinds of misbehaviors. The safe replacement is strscpy().

Signed-off-by: Len Baker <len.baker@gmx.com>
Link: https://lore.kernel.org/r/20210717155145.15041-1-len.baker@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8712: Fix alignment
Alexander Greyling [Sat, 10 Jul 2021 22:08:15 +0000 (00:08 +0200)]
staging: rtl8712: Fix alignment

This patch fixes the checkpatch.pl issue:

CHECK: Alignment should match open parenthesis.

Signed-off-by: Alexander Greyling <alexandergreyling5@gmail.com>
Link: https://lore.kernel.org/r/20210710220815.GA1654486@alexlaptop
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8712: Remove some unused #define and enum
Christophe JAILLET [Mon, 5 Jul 2021 07:43:07 +0000 (09:43 +0200)]
staging: rtl8712: Remove some unused #define and enum

These #define and the enum WIFI_REG_DOMAIN are unused.
They can be removed.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/6d5b505e7de20fdaba1831557baee1daf4656845.1625470822.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove unnecessary logging
Jan Gruber [Mon, 5 Jul 2021 17:21:01 +0000 (19:21 +0200)]
staging: rtl8188eu: remove unnecessary logging

This commit fixes the following checkpatch.pl issues:

+               pr_debug("===> %s\n", __func__);

WARNING: Unnecessary ftrace-like logging - prefer using ftrace
158: FILE: drivers/staging/rtl8188eu/os_dep/usb_intf.c:158:

WARNING: Unnecessary ftrace-like logging - prefer using ftrace
177: FILE: drivers/staging/rtl8188eu/os_dep/usb_intf.c:177:
+       pr_debug("<=== %s\n", __func__);

and removes another line of unnecessary logging, which was not
identified by checkpatch.pl in an automated manner.

Signed-off-by: Jan Gruber <j4n6ru@gmail.com>
Link: https://lore.kernel.org/r/20210705172101.239899-1-j4n6ru@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: qlge: Remove unnecessary parentheses around references
Nishal Kulkarni [Sat, 26 Jun 2021 11:30:21 +0000 (17:00 +0530)]
staging: qlge: Remove unnecessary parentheses around references

This patch fixes checkpatch.pl warning:

CHECK: Unnecessary parentheses around mpi_coredump->mpi_global_header

Signed-off-by: Nishal Kulkarni <nishalkulkarni@gmail.com>
Link: https://lore.kernel.org/r/YNcPzWXkKkmip95x@nishal-pc
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove cut_mask field from wl_pwr_cfg
Martin Kaiser [Sun, 18 Jul 2021 17:36:10 +0000 (19:36 +0200)]
staging: rtl8188eu: remove cut_mask field from wl_pwr_cfg

We're no longer matching power transitions and commands against a
power cut version mask.

The cut_mask field from struct wl_pwr_cfg can be removed. It was set to
PWR_CUT_ALL_MSK for all remaining commands.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210718173610.894-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove PWR_CMD_READ
Martin Kaiser [Sun, 18 Jul 2021 17:36:09 +0000 (19:36 +0200)]
staging: rtl8188eu: remove PWR_CMD_READ

None of the power flows and transitions includes a read command.
PWR_CMD_READ can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210718173610.894-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove constant function parameter
Martin Kaiser [Sun, 18 Jul 2021 17:36:08 +0000 (19:36 +0200)]
staging: rtl8188eu: remove constant function parameter

The rtl88eu_pwrseqcmdparsing function takes a parameter to restrict
commands to certain power cut versions of the rtl8188eu chipset.
This mechanism is not used, the callers always select all versions.

Remove the power cut parameter.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210718173610.894-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove unused power flows and transitions
Martin Kaiser [Sun, 18 Jul 2021 17:36:07 +0000 (19:36 +0200)]
staging: rtl8188eu: remove unused power flows and transitions

The driver defines a couple of "flows" to move the chip into a certain
power state. Each flow is a sequence of "transitions".

This patch removes flows and transitions which are not used.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210718173610.894-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove efuse write support
Martin Kaiser [Sun, 18 Jul 2021 17:36:06 +0000 (19:36 +0200)]
staging: rtl8188eu: remove efuse write support

This driver does not need write access to the rtl1888eu chip's efuses.
Remove the code to set the voltages for writing the efuses.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210718173610.894-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove struct eeprom_priv's EepromOrEfuse
Martin Kaiser [Sun, 18 Jul 2021 17:36:05 +0000 (19:36 +0200)]
staging: rtl8188eu: remove struct eeprom_priv's EepromOrEfuse

This setting is used only in one place. There's no need to store it
in a global struct.

While at it, merge the two-line Hal_InitPGData88E function and its
only caller.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210718173610.894-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove _CHIP_TYPE enum
Martin Kaiser [Sun, 18 Jul 2021 17:36:04 +0000 (19:36 +0200)]
staging: rtl8188eu: remove _CHIP_TYPE enum

This enum is not used and can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210718173610.894-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove RTL871X_HCI_TYPE enum
Martin Kaiser [Sun, 18 Jul 2021 17:36:03 +0000 (19:36 +0200)]
staging: rtl8188eu: remove RTL871X_HCI_TYPE enum

This enum is not used and can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210718173610.894-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove the "trigger gpio 0" hal variable
Martin Kaiser [Sun, 18 Jul 2021 17:36:02 +0000 (19:36 +0200)]
staging: rtl8188eu: remove the "trigger gpio 0" hal variable

The hal variable to trigger gpio 0 seems to be a leftover from debugging
code that was removed. An empty function is called when this variable is
written to.

Remove the empty function and the variable itself. It should be safe to
remove an entry from the hw_variables enum as this enum is used only
within the rtl8188eu driver.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210718173610.894-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: merge two functions
Martin Kaiser [Sun, 18 Jul 2021 17:36:01 +0000 (19:36 +0200)]
staging: rtl8188eu: merge two functions

All that rtw_hal_read_chip_info does is call _ReadPROMContent. Merge the
two functions.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210718173610.894-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: move hal/mac_cfg.c and rename function and array
Phillip Potter [Tue, 20 Jul 2021 22:58:26 +0000 (23:58 +0100)]
staging: rtl8188eu: move hal/mac_cfg.c and rename function and array

Move source file hal/mac_cfg.c to the 'core' driver directory, and also
rename its array from array_MAC_REG_8188E to array_MAC_REG, as well as
renaming the function rtl88eu_phy_mac_config to phy_mac_config. Also
modify single call-site for this function to reflect new name.

This file contains no code which touches the adapter's HalData structure,
and is a good candidate for therefore moving out of 'hal'. Also, no
need for these signatures to include the model number as this driver
only supports RTL8188eu.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210720225826.454516-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: fix camel case argument name in macro is_supported_tx_cck
Fabio Aiuto [Sat, 17 Jul 2021 14:56:51 +0000 (16:56 +0200)]
staging: rtl8723bs: fix camel case argument name in macro is_supported_tx_cck

fix camel case argument name in is_supported_tx_cck

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/f38fbb1388a54c78602750ecb86d0716d1aaf66b.1626533647.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: fix camel case name in macro IsSupportedTxCCK
Fabio Aiuto [Sat, 17 Jul 2021 14:56:50 +0000 (16:56 +0200)]
staging: rtl8723bs: fix camel case name in macro IsSupportedTxCCK

fix camel case name in macro IsSupportedTxCCK

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/65aec26a3c25f1e756e33bf5f7f5af0cd3b105df.1626533647.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unused macros in include/ieee80211.h
Fabio Aiuto [Sat, 17 Jul 2021 14:56:49 +0000 (16:56 +0200)]
staging: rtl8723bs: remove unused macros in include/ieee80211.h

remove unused macros in include/ieee80211.h

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/c50cba3974772347888bd55085b1e5e44ef0687d.1626533647.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: fix post-commit camel case issues
Fabio Aiuto [Sat, 17 Jul 2021 14:56:48 +0000 (16:56 +0200)]
staging: rtl8723bs: fix post-commit camel case issues

fix the following post-commit camel case issues:

CHECK: Avoid CamelCase: <Adapter>
33: FILE: drivers/staging/rtl8723bs/hal/hal_com.c:152:
+ if (is_supported_24g(Adapter->
registrypriv.wireless_mode) == false)

CHECK: Avoid CamelCase: <NetType>
46: FILE: drivers/staging/rtl8723bs/include/ieee80211.h:159:
+#define is_supported_24g(NetType)
((NetType) & SUPPORTED_24G_NETTYPE_MSK ? true : false)

CHECK: Avoid CamelCase: <IsEnableHWCCK>
49: FILE: drivers/staging/rtl8723bs/include/ieee80211.h:161:
+#define IsEnableHWCCK(NetType)
is_supported_24g(NetType)

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/6fd6d3266b5119330e15006ae610cb49b767bc59.1626533647.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: fix camel case name in macro IsSupported24G
Fabio Aiuto [Sat, 17 Jul 2021 14:56:47 +0000 (16:56 +0200)]
staging: rtl8723bs: fix camel case name in macro IsSupported24G

fix camel case name in macro IsSupported24G

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/fd5e1873f72e7d5f72b6f4bf801ede882e9df4e2.1626533647.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: fix camel case in argument of macro is_legacy_only
Fabio Aiuto [Sat, 17 Jul 2021 14:56:46 +0000 (16:56 +0200)]
staging: rtl8723bs: fix camel case in argument of macro is_legacy_only

fix camel case in argument of macro is_legacy_only

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/404028e00ca4a32bfaed753d5927d9b673e6058d.1626533647.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: fix camel case name in macro IsLegacyOnly()
Fabio Aiuto [Sat, 17 Jul 2021 14:56:45 +0000 (16:56 +0200)]
staging: rtl8723bs: fix camel case name in macro IsLegacyOnly()

fix camel case name in macro IsLegacyOnly()

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/52656190cefed1b0f9a2dd6dcb080adf2ca0a89b.1626533647.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: fix camel case issue
Fabio Aiuto [Sat, 17 Jul 2021 14:56:44 +0000 (16:56 +0200)]
staging: rtl8723bs: fix camel case issue

fix following post commit hook checkpatch issue:

CHECK: Avoid CamelCase: <NetType>
45: FILE: drivers/staging/rtl8723bs/include/ieee80211.h:170:
+#define is_supported_ht(NetType) (((NetType)
& (WIRELESS_11_24N)) ? true : false)

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/a708b2b9902bedf5bd0466b05516a4c5b4f43723.1626533647.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: convert IsSupportedHT to snake_case
Fabio Aiuto [Sat, 17 Jul 2021 14:56:43 +0000 (16:56 +0200)]
staging: rtl8723bs: convert IsSupportedHT to snake_case

convert IsSupportedHT to snake case is_supported_ht.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/d3e115f3a553db07a52cc51b71d04de9c383f697.1626533647.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: add get_channel cfg80211 implementation
Fabio Aiuto [Sat, 17 Jul 2021 14:56:42 +0000 (16:56 +0200)]
staging: rtl8723bs: add get_channel cfg80211 implementation

add get_channel cfg80211 implementation to let userspace
programs rely on nl80211 protocol to display channel
information.

Old iw dev output:

phy#0
Interface wlan0
ifindex 2
wdev 0x1
addr 34:c3:d2:73:eb:c7
ssid Fabio
type managed
txpower 12.00 dBm

Fixed output:

phy#0
Interface wlan0
ifindex 2
wdev 0x1
addr 34:c3:d2:73:eb:c7
ssid Fabio
type managed
new--> channel 11 (2462 MHz), width: 20 MHz, center1: 2462 Mhz
txpower 12.00 dBm

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/2f00479d8369b82b590291bb0edf27bc3041b0f0.1626533647.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: fix wpa_set_auth_algs() function
Fabio Aiuto [Thu, 15 Jul 2021 14:57:00 +0000 (16:57 +0200)]
staging: rtl8723bs: fix wpa_set_auth_algs() function

fix authentication algorithm constants.
wpa_set_auth_algs() function contains some conditional
statements masking the checked value with the wrong
constants. This produces some unintentional dead code.
Mask the value with the right macros.

Fixes: 5befa937e8da ("staging: rtl8723bs: Fix IEEE80211 authentication algorithm constants.")
Reported-by: Colin Ian King <colin.king@canonical.com>
Tested-on: Lenovo Ideapad MiiX 300-10IBY
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/20210715145700.9427-1-fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove custom endian conversion macros
Bryan Brattlof [Tue, 29 Jun 2021 14:02:52 +0000 (14:02 +0000)]
staging: rtl8723bs: remove custom endian conversion macros

The rtw_cpu_to_leXX() and rtw_leXX_to_cpu() family of macros are
unnecessary and should be removed.

Signed-off-by: Bryan Brattlof <hello@bryanbrattlof.com>
Link: https://lore.kernel.org/r/20210629135824.47749-1-hello@bryanbrattlof.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: Fix while-loop that iterates only once
Colin Ian King [Wed, 30 Jun 2021 06:56:47 +0000 (07:56 +0100)]
staging: r8188eu: Fix while-loop that iterates only once

The while-loop only iterates once becase the post increment test of count
being non-zero is false on the first iteration because count is zero. Fix
this by using a for-loop instead. Static analysis found the issue on the
count > POLLING_LLT_THRESHOLD check always being false since the loop
currently just iterates once.

Thanks to David Laight for suggesting using for-loop instead to improve
the readability of the fix.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210630065647.5641-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove unnecessary braces
Jan Gruber [Mon, 5 Jul 2021 07:21:25 +0000 (09:21 +0200)]
staging: rtl8188eu: remove unnecessary braces

This commit fixes the following checkpatch.pl warning:
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Jan Gruber <j4n6ru@gmail.com>
Link: https://lore.kernel.org/r/20210705072125.199810-1-j4n6ru@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove rtw_wx_set_rate handler function
Phillip Potter [Fri, 25 Jun 2021 19:16:58 +0000 (20:16 +0100)]
staging: rtl8188eu: remove rtw_wx_set_rate handler function

Remove rtw_wx_set_rate handler function, which currently handles the
SIOCSIWRATE wext ioctl. This function (although containing a lot of
code) set nothing outside its own local variables, and did nothing other
than call a now removed debugging statement repeatedly. Removing it and
leaving its associated entry in rtw_handlers as NULL is therefore the
better option. Removing this function also fixes a kernel test robot
warning.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625191658.1299-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove set but unused variable from rtw_get_sec_ie
Phillip Potter [Fri, 25 Jun 2021 18:30:07 +0000 (19:30 +0100)]
staging: rtl8188eu: remove set but unused variable from rtw_get_sec_ie

Remove set but unused variable 'sec_idx' from the rtw_get_sec_ie
function inside core/rtw_ieee80211.c, to fix a kernel test robot warning
introduced by recent removal of erroneous debug statements.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210625183007.7065-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoLinux 5.14-rc2
Linus Torvalds [Sun, 18 Jul 2021 21:13:49 +0000 (14:13 -0700)]
Linux 5.14-rc2

3 years agoMerge tag 'perf-tools-fixes-for-v5.14-2021-07-18' of git://git.kernel.org/pub/scm...
Linus Torvalds [Sun, 18 Jul 2021 19:20:27 +0000 (12:20 -0700)]
Merge tag 'perf-tools-fixes-for-v5.14-2021-07-18' of git://git./linux/kernel/git/acme/linux

Pull perf tools fixes from Arnaldo Carvalho de Melo:

 - Skip invalid hybrid PMU on hybrid systems when the atom (little) CPUs
   are offlined.

 - Fix 'perf test' problems related to the recently added hybrid
   (BIG/little) code.

 - Split ARM's coresight (hw tracing) decode by aux records to avoid
   fatal decoding errors.

 - Fix add event failure in 'perf probe' when running 32-bit perf in a
   64-bit kernel.

 - Fix 'perf sched record' failure when CONFIG_SCHEDSTATS is not set.

 - Fix memory and refcount leaks detected by ASAn when running 'perf
   test', should be clean of warnings now.

 - Remove broken definition of __LITTLE_ENDIAN from tools'
   linux/kconfig.h, which was breaking the build in some systems.

 - Cast PTHREAD_STACK_MIN to int as it may turn into 'long
   sysconf(__SC_THREAD_STACK_MIN_VALUE), breaking the build in some
   systems.

 - Fix libperf build error with LIBPFM4=1.

 - Sync UAPI files changed by the memfd_secret new syscall.

* tag 'perf-tools-fixes-for-v5.14-2021-07-18' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (35 commits)
  perf sched: Fix record failure when CONFIG_SCHEDSTATS is not set
  perf probe: Fix add event failure when running 32-bit perf in a 64-bit kernel
  perf data: Close all files in close_dir()
  perf probe-file: Delete namelist in del_events() on the error path
  perf test bpf: Free obj_buf
  perf trace: Free strings in trace__parse_events_option()
  perf trace: Free syscall tp fields in evsel->priv
  perf trace: Free syscall->arg_fmt
  perf trace: Free malloc'd trace fields on exit
  perf lzma: Close lzma stream on exit
  perf script: Fix memory 'threads' and 'cpus' leaks on exit
  perf script: Release zstd data
  perf session: Cleanup trace_event
  perf inject: Close inject.output on exit
  perf report: Free generated help strings for sort option
  perf env: Fix memory leak of cpu_pmu_caps
  perf test maps__merge_in: Fix memory leak of maps
  perf dso: Fix memory leak in dso__new_map()
  perf test event_update: Fix memory leak of unit
  perf test event_update: Fix memory leak of evlist
  ...

3 years agoMerge tag 'xfs-5.14-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Linus Torvalds [Sun, 18 Jul 2021 18:27:25 +0000 (11:27 -0700)]
Merge tag 'xfs-5.14-fixes-1' of git://git./fs/xfs/xfs-linux

Pull xfs fixes from Darrick Wong:
 "A few fixes for issues in the new online shrink code, additional
  corrections for my recent bug-hunt w.r.t. extent size hints on
  realtime, and improved input checking of the GROWFSRT ioctl.

  IOW, the usual 'I somehow got bored during the merge window and
  resumed auditing the farther reaches of xfs':

   - Fix shrink eligibility checking when sparse inode clusters enabled

   - Reset '..' directory entries when unlinking directories to prevent
     verifier errors if fs is shrinked later

   - Don't report unusable extent size hints to FSGETXATTR

   - Don't warn when extent size hints are unusable because the sysadmin
     configured them that way

   - Fix insufficient parameter validation in GROWFSRT ioctl

   - Fix integer overflow when adding rt volumes to filesystem"

* tag 'xfs-5.14-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
  xfs: detect misaligned rtinherit directory extent size hints
  xfs: fix an integer overflow error in xfs_growfs_rt
  xfs: improve FSGROWFSRT precondition checking
  xfs: don't expose misaligned extszinherit hints to userspace
  xfs: correct the narrative around misaligned rtinherit/extszinherit dirs
  xfs: reset child dir '..' entry when unlinking child
  xfs: check for sparse inode clusters that cross new EOAG when shrinking

3 years agoMerge tag 'iomap-5.14-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Linus Torvalds [Sun, 18 Jul 2021 18:17:06 +0000 (11:17 -0700)]
Merge tag 'iomap-5.14-fixes-1' of git://git./fs/xfs/xfs-linux

Pull iomap fixes from Darrick Wong:
 "A handful of bugfixes for the iomap code.

  There's nothing especially exciting here, just fixes for UBSAN (not
  KASAN as I erroneously wrote in the tag message) warnings about
  undefined behavior in the SEEK_DATA/SEEK_HOLE code, and some
  reshuffling of per-page block state info to fix some problems with
  gfs2.

   - Fix KASAN warnings due to integer overflow in SEEK_DATA/SEEK_HOLE

   - Fix assertion errors when using inlinedata files on gfs2"

* tag 'iomap-5.14-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
  iomap: Don't create iomap_page objects in iomap_page_mkwrite_actor
  iomap: Don't create iomap_page objects for inline files
  iomap: Permit pages without an iop to enter writeback
  iomap: remove the length variable in iomap_seek_hole
  iomap: remove the length variable in iomap_seek_data

3 years agoMerge tag 'kbuild-fixes-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/masah...
Linus Torvalds [Sun, 18 Jul 2021 18:10:30 +0000 (11:10 -0700)]
Merge tag 'kbuild-fixes-v5.14' of git://git./linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

 - Restore the original behavior of scripts/setlocalversion when
   LOCALVERSION is set to empty.

 - Show Kconfig prompts even for 'make -s'

 - Fix the combination of COFNIG_LTO_CLANG=y and CONFIG_MODVERSIONS=y
   for older GNU Make versions

* tag 'kbuild-fixes-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  Documentation: Fix intiramfs script name
  Kbuild: lto: fix module versionings mismatch in GNU make 3.X
  kbuild: do not suppress Kconfig prompts for silent build
  scripts/setlocalversion: fix a bug when LOCALVERSION is empty

3 years agoDocumentation: Fix intiramfs script name
Robert Richter [Thu, 15 Jul 2021 09:26:02 +0000 (11:26 +0200)]
Documentation: Fix intiramfs script name

Documentation was not changed when renaming the script in commit
80e715a06c2d ("initramfs: rename gen_initramfs_list.sh to
gen_initramfs.sh"). Fixing this.

Basically does:

 $ sed -i -e s/gen_initramfs_list.sh/gen_initramfs.sh/g $(git grep -l gen_initramfs_list.sh)

Fixes: 80e715a06c2d ("initramfs: rename gen_initramfs_list.sh to gen_initramfs.sh")
Signed-off-by: Robert Richter <rrichter@amd.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
3 years agoKbuild: lto: fix module versionings mismatch in GNU make 3.X
Lecopzer Chen [Thu, 15 Jul 2021 07:37:16 +0000 (15:37 +0800)]
Kbuild: lto: fix module versionings mismatch in GNU make 3.X

When building modules(CONFIG_...=m), I found some of module versions
are incorrect and set to 0.
This can be found in build log for first clean build which shows

WARNING: EXPORT symbol "XXXX" [drivers/XXX/XXX.ko] version generation failed,
symbol will not be versioned.

But in second build(incremental build), the WARNING disappeared and the
module version becomes valid CRC and make someone who want to change
modules without updating kernel image can't insert their modules.

The problematic code is
+ $(foreach n, $(filter-out FORCE,$^), \
+ $(if $(wildcard $(n).symversions), \
+ ; cat $(n).symversions >> $@.symversions))

For example:
  rm -f fs/notify/built-in.a.symversions    ; rm -f fs/notify/built-in.a; \
llvm-ar cDPrST fs/notify/built-in.a fs/notify/fsnotify.o \
fs/notify/notification.o fs/notify/group.o ...

`foreach n` shows nothing to `cat` into $(n).symversions because
`if $(wildcard $(n).symversions)` return nothing, but actually
they do exist during this line was executed.

-rw-r--r-- 1 root root 168580 Jun 13 19:10 fs/notify/fsnotify.o
-rw-r--r-- 1 root root    111 Jun 13 19:10 fs/notify/fsnotify.o.symversions

The reason is the $(n).symversions are generated at runtime, but
Makefile wildcard function expends and checks the file exist or not
during parsing the Makefile.

Thus fix this by use `test` shell command to check the file
existence in runtime.

Rebase from both:
1. [https://lore.kernel.org/lkml/20210616080252.32046-1-lecopzer.chen@mediatek.com/]
2. [https://lore.kernel.org/lkml/20210702032943.7865-1-lecopzer.chen@mediatek.com/]

Fixes: 38e891849003 ("kbuild: lto: fix module versioning")
Co-developed-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Lecopzer Chen <lecopzer.chen@mediatek.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
3 years agokbuild: do not suppress Kconfig prompts for silent build
Masahiro Yamada [Wed, 14 Jul 2021 04:23:49 +0000 (13:23 +0900)]
kbuild: do not suppress Kconfig prompts for silent build

When a new CONFIG option is available, Kbuild shows a prompt to get
the user input.

  $ make
  [ snip ]
  Core Scheduling for SMT (SCHED_CORE) [N/y/?] (NEW)

This is the only interactive place in the build process.

Commit 174a1dcc9642 ("kbuild: sink stdout from cmd for silent build")
suppressed Kconfig prompts as well because syncconfig is invoked by
the 'cmd' macro. You cannot notice the fact that Kconfig is waiting
for the user input.

Use 'kecho' to show the equivalent short log without suppressing stdout
from sub-make.

Fixes: 174a1dcc9642 ("kbuild: sink stdout from cmd for silent build")
Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Tested-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
3 years agoscripts/setlocalversion: fix a bug when LOCALVERSION is empty
Mikulas Patocka [Mon, 12 Jul 2021 19:35:46 +0000 (15:35 -0400)]
scripts/setlocalversion: fix a bug when LOCALVERSION is empty

The commit 042da426f8eb ("scripts/setlocalversion: simplify the short
version part") reduces indentation. Unfortunately, it also changes behavior
in a subtle way - if the user has empty "LOCALVERSION" variable, the plus
sign is appended to the kernel version. It wasn't appended before.

This patch reverts to the old behavior - we append the plus sign only if
the LOCALVERSION variable is not set.

Fixes: 042da426f8eb ("scripts/setlocalversion: simplify the short version part")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
3 years agoperf sched: Fix record failure when CONFIG_SCHEDSTATS is not set
Yang Jihong [Tue, 13 Jul 2021 11:23:58 +0000 (19:23 +0800)]
perf sched: Fix record failure when CONFIG_SCHEDSTATS is not set

The tracepoints trace_sched_stat_{wait, sleep, iowait} are not exposed to user
if CONFIG_SCHEDSTATS is not set, "perf sched record" records the three events.
As a result, the command fails.

Before:

  #perf sched record sleep 1
  event syntax error: 'sched:sched_stat_wait'
                       \___ unknown tracepoint

  Error:  File /sys/kernel/tracing/events/sched/sched_stat_wait not found.
  Hint:   Perhaps this kernel misses some CONFIG_ setting to enable this feature?.

  Run 'perf list' for a list of valid events

   Usage: perf record [<options>] [<command>]
      or: perf record [<options>] -- <command> [<options>]

      -e, --event <event>   event selector. use 'perf list' to list available events

Solution:
  Check whether schedstat tracepoints are exposed. If no, these events are not recorded.

After:
  # perf sched record sleep 1
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.163 MB perf.data (1091 samples) ]
  # perf sched report
  run measurement overhead: 4736 nsecs
  sleep measurement overhead: 9059979 nsecs
  the run test took 999854 nsecs
  the sleep test took 8945271 nsecs
  nr_run_events:        716
  nr_sleep_events:      785
  nr_wakeup_events:     0
  ...
  ------------------------------------------------------------

Fixes: 2a09b5de235a6 ("sched/fair: do not expose some tracepoints to user if CONFIG_SCHEDSTATS is not set")
Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Yafang Shao <laoar.shao@gmail.com>
Link: http://lore.kernel.org/lkml/20210713112358.194693-1-yangjihong1@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
3 years agoperf probe: Fix add event failure when running 32-bit perf in a 64-bit kernel
Yang Jihong [Thu, 15 Jul 2021 06:37:23 +0000 (14:37 +0800)]
perf probe: Fix add event failure when running 32-bit perf in a 64-bit kernel

The "address" member of "struct probe_trace_point" uses long data type.
If kernel is 64-bit and perf program is 32-bit, size of "address"
variable is 32 bits.

As a result, upper 32 bits of address read from kernel are truncated, an
error occurs during address comparison in kprobe_warn_out_range().

Before:

  # perf probe -a schedule
  schedule is out of .text, skip it.
    Error: Failed to add events.

Solution:
  Change data type of "address" variable to u64 and change corresponding
address printing and value assignment.

After:

  # perf.new.new probe -a schedule
  Added new event:
    probe:schedule       (on schedule)

  You can now use it in all perf tools, such as:

          perf record -e probe:schedule -aR sleep 1

  # perf probe -l
    probe:schedule       (on schedule@kernel/sched/core.c)
  # perf record -e probe:schedule -aR sleep 1
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.156 MB perf.data (1366 samples) ]
  # perf report --stdio
  # To display the perf.data header info, please use --header/--header-only options.
  #
  #
  # Total Lost Samples: 0
  #
  # Samples: 1K of event 'probe:schedule'
  # Event count (approx.): 1366
  #
  # Overhead  Command          Shared Object      Symbol
  # ........  ...............  .................  ............
  #
       6.22%  migration/0      [kernel.kallsyms]  [k] schedule
       6.22%  migration/1      [kernel.kallsyms]  [k] schedule
       6.22%  migration/2      [kernel.kallsyms]  [k] schedule
       6.22%  migration/3      [kernel.kallsyms]  [k] schedule
       6.15%  migration/10     [kernel.kallsyms]  [k] schedule
       6.15%  migration/11     [kernel.kallsyms]  [k] schedule
       6.15%  migration/12     [kernel.kallsyms]  [k] schedule
       6.15%  migration/13     [kernel.kallsyms]  [k] schedule
       6.15%  migration/14     [kernel.kallsyms]  [k] schedule
       6.15%  migration/15     [kernel.kallsyms]  [k] schedule
       6.15%  migration/4      [kernel.kallsyms]  [k] schedule
       6.15%  migration/5      [kernel.kallsyms]  [k] schedule
       6.15%  migration/6      [kernel.kallsyms]  [k] schedule
       6.15%  migration/7      [kernel.kallsyms]  [k] schedule
       6.15%  migration/8      [kernel.kallsyms]  [k] schedule
       6.15%  migration/9      [kernel.kallsyms]  [k] schedule
       0.22%  rcu_sched        [kernel.kallsyms]  [k] schedule
  ...
  #
  # (Cannot load tips.txt file, please install perf!)
  #

Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Frank Ch. Eigler <fche@redhat.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jianlin Lv <jianlin.lv@arm.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Li Huafei <lihuafei1@huawei.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Link: http://lore.kernel.org/lkml/20210715063723.11926-1-yangjihong1@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>