Skip to content
Permalink
Alexandru-Arde…
Switch branches/tags

Commits on Aug 16, 2021

  1. iio: st_sensors: remove reference to parent device object on st_senso…

    …r_data
    
    I'm not completely sure whether this change makes much sense.
    The idea behind it, is that all devm_ calls in ST sensors are bound to the
    parent device object.
    
    However, the reference to that object is kept on both the st_sensor_data
    struct and the IIO object parent (indio_dev->dev.parent).
    
    This change only adds a bit consistency and uses the reference stored on
    indio_dev->dev.parent, to enforce the assumption that all ST sensors' devm_
    calls are bound to the same reference as the one store on st_sensor_data.
    
    Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
    commodo authored and intel-lab-lkp committed Aug 16, 2021
  2. iio: st_sensors: remove all driver remove functions

    At this point all ST driver remove functions do iio_device_unregister().
    This change removes them from them and replaces all iio_device_register()
    with devm_iio_device_register().
    
    This can be done in a single change relatively easy, since all these remove
    functions are define in st_sensors.h.
    
    Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
    commodo authored and intel-lab-lkp committed Aug 16, 2021
  3. iio: st_sensors: remove st_sensors_power_disable() function

    This change converts the st_sensors_power_enable() function to use
    devm_add_action_or_reset() handlers to register regulator_disable hooks for
    when the drivers get unloaded.
    
    The parent device of the IIO device object is used. This is based on the
    assumption that all other devm_ calls in the ST sensors use this reference.
    
    This makes the st_sensors_power_disable() un-needed.
    Removing this also changes unload order a bit, as all ST drivers would call
    st_sensors_power_disable() first and iio_device_unregister() after that.
    
    Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
    commodo authored and intel-lab-lkp committed Aug 16, 2021
  4. iio: st_sensors: remove st_sensors_deallocate_trigger() function

    This change converts the st_sensors_allocate_trigger() to use
    device-managed functions.
    
    The parent device of the IIO device object is used. This is based on the
    assumption that all other devm_ calls in the ST sensors use this reference.
    
    That makes the st_sensors_deallocate_trigger() function un-needed, so it
    can be removed.
    
    Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
    commodo authored and intel-lab-lkp committed Aug 16, 2021
  5. iio: st_sensors: disable regulators after device unregistration

    Up until commit ea7e586 ("iio: st_sensors: move regulator retrieveal
    to core") only the ST pressure driver seems to have had any regulator
    disable. After that commit, the regulator handling was moved into the
    common st_sensors logic.
    
    In all instances of this regulator handling, the regulators were disabled
    before unregistering the IIO device.
    This can cause issues where the device would be powered down and still be
    available to userspace, allowing it to send invalid/garbage data.
    
    This change moves the st_sensors_power_disable() after the common probe
    functions. These common probe functions also handle unregistering the IIO
    device.
    
    Fixes: 7744876 ("iio: pressure-core: st: Provide support for the Vdd power supply")
    Fixes: ea7e586 ("iio: st_sensors: move regulator retrieveal to core")
    Cc: Lee Jones <lee.jones@linaro.org>
    Cc: Denis CIOCCA <denis.ciocca@st.com>
    Cc: Linus Walleij <linus.walleij@linaro.org>
    Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
    commodo authored and intel-lab-lkp committed Aug 16, 2021

Commits on Aug 15, 2021

  1. Merge tag 'iio-for-5.15a' of https://git.kernel.org/pub/scm/linux/ker…

    …nel/git/jic23/iio into staging-next
    
    Jonathan writes:
    
    First set of new IIO and counter device support, cleanups and features for 5.15
    
    Usual mix of cleanups and new device support.
    
    Counter
    ======
    
    Cleanups and refactoring:
    * treewide
      - Ensure attempts to set invalid modes result in -EINVAL return.
      - Rename counter_count_function to counter_function as the middle count
        is redundant.
      - Standardize error returns when limits are exceeded.
    * 104-quad:
      - Document the lock.
      - Return an error if attempt to set the ceiling value in a mode that
        doesn't support it.
    * intel-qep
      - Drop unused bitops.h include
    
    IIO
    ===
    
    New device support
    * bma255
      - Add support fo the bosch,bmc156_accel which oddly only exposes the INT2
        interrupt pin and not INT1. Patch set includes enabling use of INT2.
    * ingenic_adc
      - Add support for JZ4760 and similar and update bindings
      - Add support for JZ4760B and update bindings
    * rockchip_saradc
      - Add support for rk3568 ADC (separate channel array as more channels)
    * sgp40 gas sensor used to measure air quality
      - New driver including binding and ABI documentation.
    
    Bindings
    --------
    
    * Add missing bindings for many DACs where the binding was effectively
      implicit due to fallback probe methods in I2C and SPI.
      adi,ad5064
      adi,ad5360
      adi,ad5380
      adi,ad5421
      adi,ad5449
      adi,ad5504
      adi,ad5624r
      adi,ad5686 / adi,ad5696
      adi,ad5761
      adi,ad5764
      adi,ad5791
      adi,ad8801
      capella,cm3323 (also add explicit of_device_id table)
      microchip,mcp4922
    * bosch,bma255
      - Interrupt type in example was opposite of what the device expects.
        It's possible that a particular board had an inverter, but we
        definitely don't want the example to suggest this would be normal.
      - Add interrupt-names to allow for cases where only INT2 is connected.
      - Sort compatibles
      - Merge in very similar bosch,bma180 binding.
    
    New feature
    -----------
    
    * Devices only allowed to provide either extended_name or a label for given
      channel. If extend_name is used (generally discouraged but can't be
      removed as it would be a userspaece ABI change), then the label sysfs
      attribute will provide the extended_name. This allows some userspace
      parser simplications and hardening.
    * hid-sensors-pres
      - Add a timestamp channel (either from hardware, or locally filled).
    * vcnl3020
      - Add periodic sensor mode used to provide IIO events.
    
    Cleanups / minor fixes
    ----------------------
    
    * core/buffers
      - Avoid unnecessary zeroing of bitmaps that are immediately overwritten.
      - Move a sanity check earlier to simplify error path.
    * Quite a few cases of refactors to use devm_* for all of probe and drop
      remove
      - adjd_s311
      - adxl345
      - bma220
      - da280
      - dmard10
      - ds311
      - max5481
      - max5821
      - rfd77402
      - tcs3414
      - tmp006
    * ad5624r
      - Fix incorrect handling of a regulator that was preventing use of
        internal regulators.
    * adjd_s311
      - Allocate a buffer as part of iio_priv() structure as maximum size
        is small enough, no significant advantage in making it flexible sized.
    * bma220
      - Make handling of suspend and resume closer to the probe() wrt to the
        rather odd interface, that suspend mode is entered by reading a register.
    * ep93xx
      - Prepare clock before using (part of conversion to CCF)
    * fsl-imx25-gcq
      - Use local device pointer.
      - Adjust handling of platform_get_irq() to not check for 0 as an error.
        The function is documented as never returning it.
    * hid-sensors
      - Use devm_kmemdup() consistently across all drivers to simplify channel
        structure allocation management.
    * meson-saradc
      - Drop BL30 integration on G12A and newer SoCs as not used.
      - Whitespace fixes.
    * mpu6050
      - Add per device type startup times. This avoids an issue with having
        to dsicard initial data from gyroscopes when they were still stabilizing.
    * rfd77402
      - Change from passing private data, to passing i2c_client where only
        that is needed, reducing back and forth in pm functions.
    * si1145
      - Drop pointless continue
    * st-sensors
      - Cleanup of includes to remove unused and add missing headers that are used.
      - Use some devm functions to simplify probe() and remove() - gets us part way
        towards a fully device managed driver.
    * sx9310
      - Switch from of to generic properties to enable ACPI bindings.
    * vcnl3020
      - Add DMA safe buffer for bulk transfers.
      - Drop use of iio_claim_direct() in a driver that has no mode changes.
        A local lock is more appropriate.
    
    * tag 'iio-for-5.15a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (77 commits)
      counter: 104-quad-8: Describe member 'lock' in 'quad8'
      iio: hid-sensor-press: Add timestamp channel
      counter: Rename counter_count_function to counter_function
      counter: Rename counter_signal_value to counter_signal_level
      counter: Standardize to ERANGE for limit exceeded errors
      counter: Return error code on invalid modes
      counter: 104-quad-8: Return error when invalid mode during ceiling_write
      iio: accel: bmc150: Add support for BMC156
      iio: accel: bmc150: Make it possible to configure INT2 instead of INT1
      dt-bindings: iio: accel: bma255: Add bosch,bmc156_accel
      dt-bindings: iio: accel: bma255: Add interrupt-names
      iio: light: cm3323: Add of_device_id table
      dt-bindings: Add bindings for Capella cm3323 Ambient Light Sensor
      iio: chemical: Add driver support for sgp40
      dt-bindings: iio: chemical: Add trivial DT binding for sgp40
      iio: ep93xx: Prepare clock before using it
      iio: adc: fsl-imx25-gcq: adjust irq check to match docs and simplify code
      iio: dac: max5821: convert device register to device managed function
      dt-bindings: iio/adc: ingenic: add the JZ4760(B) socs to the sadc Documentation
      iio/adc: ingenic: add JZ4760B support to the sadc driver
      ...
    gregkh committed Aug 15, 2021

Commits on Aug 13, 2021

  1. staging: r8188eu: Reorganize error handling in rtw_drv_init()

    After commit 987219a ("staging: r8188eu: remove lines from Makefile
    that silence build warnings"), clang warns:
    
    drivers/staging/r8188eu/os_dep/usb_intf.c:726:6: warning: variable
    'status' is used uninitialized whenever 'if' condition is true
    [-Wsometimes-uninitialized]
            if (!if1) {
                ^~~~
    drivers/staging/r8188eu/os_dep/usb_intf.c:741:6: note: uninitialized use
    occurs here
            if (status != _SUCCESS)
                ^~~~~~
    drivers/staging/r8188eu/os_dep/usb_intf.c:726:2: note: remove the 'if'
    if its condition is always false
            if (!if1) {
            ^~~~~~~~~~~
    drivers/staging/r8188eu/os_dep/usb_intf.c:714:12: note: initialize the
    variable 'status' to silence this warning
            int status;
                      ^
                       = 0
    1 warning generated.
    
    status is not initialized if the call to usb_dvobj_init() or
    rtw_usb_if1_init() fails.
    
    Looking at the error function as a whole, the error handling is odd
    compared to the rest of the kernel, which prefers to set error codes on
    goto paths, rather than a global "status" variable which determines the
    error code at the end of the function and function calls in the case of
    error.
    
    Rearrange the error handling of this function to bring it more inline
    with how the kernel does it in most cases, which helps readability.
    
    The call to rtw_usb_if1_deinit() is eliminated because it is not
    possible to ever hit it; if rtw_usb_if1_init() fails, the goto call
    jumps over the call to rtw_usb_if1_deinit() and in the success case,
    status is set to _SUCCESS.
    
    Acked-by: Phillip Potter <phil@philpotter.co.uk>
    Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
    Signed-off-by: Nathan Chancellor <nathan@kernel.org>
    Link: https://lore.kernel.org/r/20210812204027.338872-4-nathan@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    nathanchance authored and gregkh committed Aug 13, 2021
  2. staging: r8188eu: Remove uninitialized use of ether_type in portctrl()

    After commit 987219a ("staging: r8188eu: remove lines from Makefile
    that silence build warnings"), clang warns:
    
    drivers/staging/r8188eu/core/rtw_recv.c:499:8: warning: variable
    'ether_type' is uninitialized when used here [-Wuninitialized]
                            if (ether_type == eapol_type)
                                ^~~~~~~~~~
    drivers/staging/r8188eu/core/rtw_recv.c:458:16: note: initialize the
    variable 'ether_type' to silence this warning
            u16     ether_type;
                              ^
                               = 0
    1 warning generated.
    
    This if statement sets the exact same assignment as above so just remove
    it.
    
    Acked-by: Phillip Potter <phil@philpotter.co.uk>
    Signed-off-by: Nathan Chancellor <nathan@kernel.org>
    Link: https://lore.kernel.org/r/20210812204027.338872-3-nathan@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    nathanchance authored and gregkh committed Aug 13, 2021
  3. staging: r8188eu: Remove unused static inline functions in rtw_recv.h

    After commit 987219a ("staging: r8188eu: remove lines from Makefile
    that silence build warnings"), clang warns several times:
    
    In file included from
    drivers/staging/r8188eu/os_dep/../include/drv_types.h:22:
    drivers/staging/r8188eu/os_dep/../include/rtw_recv.h:395:9: warning:
    variable 'buf_desc' is uninitialized when used here [-Wuninitialized]
            return buf_desc;
                   ^~~~~~~~
    drivers/staging/r8188eu/os_dep/../include/rtw_recv.h:391:25: note:
    initialize the variable 'buf_desc' to silence this warning
            unsigned char *buf_desc;
                                   ^
                                    = NULL
    drivers/staging/r8188eu/os_dep/../include/rtw_recv.h:412:52: warning:
    variable 'buf_star' is uninitialized when used here [-Wuninitialized]
            precv_frame = rxmem_to_recvframe((unsigned char *)buf_star);
                                                              ^~~~~~~~
    drivers/staging/r8188eu/os_dep/../include/rtw_recv.h:410:14: note:
    initialize the variable 'buf_star' to silence this warning
            u8 *buf_star;
                        ^
                         = NULL
    2 warnings generated.
    
    The functions that these warnings come from are not used or are called
    from functions that are not used so just remove them to remove the
    warnings.
    
    Acked-by: Phillip Potter <phil@philpotter.co.uk>
    Signed-off-by: Nathan Chancellor <nathan@kernel.org>
    Link: https://lore.kernel.org/r/20210812204027.338872-2-nathan@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    nathanchance authored and gregkh committed Aug 13, 2021
  4. staging: r8188eu: replace custom hwaddr_aton_i() with mac_pton()

    Replace custom hwaddr_aton_i() with mac_pton() in core/ioctl_linux.c
    and remove the now unused functions hwaddr_aton_i() and hex2num_i().
    
    Acked-by: Phillip Potter <phil@philpotter.co.uk>
    Signed-off-by: Michael Straube <straube.linux@gmail.com>
    Link: https://lore.kernel.org/r/20210812132057.22579-1-straube.linux@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    MichaelStraube authored and gregkh committed Aug 13, 2021

Commits on Aug 12, 2021

  1. staging: r8188eu: scheduling in atomic in rtw_createbss_cmd()

    A couple of the callers are holding spinlocks so this allocation has to
    be atomic.  One spinlock is in rtw_set_802_11_connect() but the simpler
    spinlock to review is when this function is called from
    rtw_surveydone_event_callback().
    
    Fixes: 1586512 ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Link: https://lore.kernel.org/r/20210812065852.GB31863@kili
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    error27 authored and gregkh committed Aug 12, 2021
  2. staging: r8188eu: Fix a couple scheduling in atomic bugs

    These allocations are sometimes done while holding a spin_lock so they
    have to be atomic.  The call tree looks like this:
    
    -> rtw_set_802_11_connect() <- takes a spin_lock
       -> rtw_do_join()
          -> rtw_sitesurvey_cmd()  <-- does a GFP_ATOMIC allocation
             -> p2p_ps_wk_cmd()
    
    Fixes: 1586512 ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Link: https://lore.kernel.org/r/20210812065710.GA31863@kili
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    error27 authored and gregkh committed Aug 12, 2021
  3. staging: r8188eu: Fix smatch warnings in os_dep/*.c

    Smatch shows the following:
    
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:1478 rtw_wx_set_essid() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:1479 rtw_wx_set_essid() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:1481 rtw_wx_set_essid() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:1555 rtw_wx_set_rate() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:2596 rtw_wps_start() warn: variable dereferenced before check 'pdata' (see line 2590)
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:2790 rtw_p2p_profilefound() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:4846 rtw_set_encryption() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:5628 rtw_mp_efuse_get() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:7251 rtw_mp_set() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:7255 rtw_mp_set() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:7310 rtw_mp_get() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:7345 rtw_mp_get() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:7349 rtw_mp_get() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/mlme_linux.c:106 rtw_os_indicate_disconnect() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/os_intfs.c:1118 ips_netdrv_open() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/osdep_service.c:37 rtw_atoi() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/recv_linux.c:65 rtw_os_recvbuf_resource_free() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/usb_intf.c:338 rtw_hw_suspend() warn: variable dereferenced before check 'padapter' (see line 327)
    drivers/staging/r8188eu/os_dep/usb_intf.c:381 rtw_hw_suspend() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/usb_intf.c:394 rtw_hw_resume() warn: variable dereferenced before check 'padapter' (see line 391)
    drivers/staging/r8188eu/os_dep/usb_intf.c:506 rtw_resume() warn: inconsistent indenting
    
    Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
    Link: https://lore.kernel.org/r/20210812015232.23784-4-Larry.Finger@lwfinger.net
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    lwfinger authored and gregkh committed Aug 12, 2021
  4. staging: r8188eu: Fix smatch problems in hal/*.c

    Smatch detects the folloring:
    
    drivers/staging/r8188eu/hal/HalHWImg8188E_RF.c:199 ODM_ReadAndConfig_RadioA_1T_8188E() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/HalPwrSeqCmd.c:65 HalPwrSeqCmdParsing() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/odm.c:225 ODM_DMWatchdog() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/odm.c:485 ODM_Write_DIG() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/odm.c:485 ODM_Write_DIG() warn: if statement not indented
    drivers/staging/r8188eu/hal/odm.c:491 ODM_Write_DIG() warn: if statement not indented
    drivers/staging/r8188eu/hal/odm.c:493 ODM_Write_DIG() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/odm.c:496 ODM_Write_DIG() warn: if statement not indented
    drivers/staging/r8188eu/hal/odm.c:498 ODM_Write_DIG() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/odm.c:501 ODM_Write_DIG() warn: if statement not indented
    drivers/staging/r8188eu/hal/odm.c:551 odm_DIGbyRSSI_LPS() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/Hal8188ERateAdaptive.c:360 odm_ARFBRefresh_8188E() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/odm_HWConfig.c:268 odm_RxPhyStatus92CSeries_Parsing() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/rtl8188e_hal_init.c:726 hal_EfusePowerSwitch_RTL8188E() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/rtl8188e_mp.c:60 Hal_mpt_SwitchRfSetting() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:547 wpa_set_encryption() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:1478 rtw_wx_set_essid() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:1479 rtw_wx_set_essid() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:1481 rtw_wx_set_essid() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:1555 rtw_wx_set_rate() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:2596 rtw_wps_start() warn: variable dereferenced before check 'pdata' (see line 2590)
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:2790 rtw_p2p_profilefound() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:4846 rtw_set_encryption() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:5628 rtw_mp_efuse_get() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:7055 rtw_mp_thermal() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:7251 rtw_mp_set() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:7255 rtw_mp_set() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:7310 rtw_mp_get() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:7345 rtw_mp_get() warn: inconsistent indenting
    drivers/staging/r8188eu/os_dep/ioctl_linux.c:7349 rtw_mp_get() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/usb_halinit.c:856 rtl8188eu_hal_init() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/usb_halinit.c:859 rtl8188eu_hal_init() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/usb_halinit.c:862 rtl8188eu_hal_init() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/usb_halinit.c:887 rtl8188eu_hal_init() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/usb_halinit.c:915 rtl8188eu_hal_init() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/usb_halinit.c:925 rtl8188eu_hal_init() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/usb_halinit.c:929 rtl8188eu_hal_init() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/usb_ops_linux.c:263 usb_writeN() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/usb_ops_linux.c:568 usb_read_port() warn: inconsistent indenting
    `
    
    Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
    drivers/staging/r8188eu/hal/usb_halinit.c:1887:17: warning: mixing declarations and code
    drivers/staging/r8188eu/hal/usb_ops_linux.c:519:25: error: typename in expression
    Link: https://lore.kernel.org/r/20210812015232.23784-3-Larry.Finger@lwfinger.net
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    lwfinger authored and gregkh committed Aug 12, 2021
  5. staging: r8188eu: Fix Smatch warnings for core/*.c

    Smatch reports the following problems:
    drivers/staging/r8188eu/core/rtw_br_ext.c:655 nat25_db_handle() warn: if statement not indented
    drivers/staging/r8188eu/core/rtw_cmd.c:436 rtw_sitesurvey_cmd() warn: if statement not indented
    drivers/staging/r8188eu/core/rtw_cmd.c:450 rtw_sitesurvey_cmd() warn: if statement not indented
    drivers/staging/r8188eu/core/rtw_led.c:330 SwLedBlink2() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_led.c:359 SwLedBlink2() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_led.c:538 SwLedBlink4() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_led.c:567 SwLedBlink4() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_led.c:685 SwLedBlink5() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_led.c:771 SwLedControlMode1() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_led.c:819 SwLedControlMode1() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_led.c:845 SwLedControlMode1() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_led.c:1574 LedControl8188eu() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_mlme.c:420 is_same_network() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_mlme.c:986 rtw_joinbss_update_stainfo() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_mlme.c:1162 rtw_joinbss_event_prehandle() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_mlme.c:1858 rtw_restruct_sec_ie() error: uninitialized symbol 'authmode'.
    drivers/staging/r8188eu/core/rtw_mlme.c:1869 rtw_restruct_sec_ie() error: uninitialized symbol 'authmode'.
    drivers/staging/r8188eu/core/rtw_mlme_ext.c:401 _mgt_dispatcher() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_mlme_ext.c:3210 is_matched_in_profilelist() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_mlme_ext.c:4351 dump_mgntframe_and_wait() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_mlme_ext.c:4374 dump_mgntframe_and_wait_ack() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_mlme_ext.c:7378 _linked_rx_signal_strehgth_display() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_mp.c:694 SetPacketTx() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_mp.c:900 _rtw_mp_xmit_priv() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_p2p.c:1130 process_p2p_group_negotation_req() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_recv.c:188 rtw_free_recvframe() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_recv.c:499 portctrl() error: uninitialized symbol 'ether_type'.
    drivers/staging/r8188eu/core/rtw_recv.c:507 portctrl() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_recv.c:722 sta2sta_data_frame() warn: if statement not indented
    drivers/staging/r8188eu/core/rtw_recv.c:1601 amsdu_to_msdu() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_security.c:283 rtw_seccalctkipmic() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_security.c:1116 aes_cipher() warn: for statement not indented
    drivers/staging/r8188eu/core/rtw_security.c:1213 rtw_aes_encrypt() warn: inconsistent indenting
    rivers/staging/r8188eu/core/rtw_sta_mgt.c:18 _rtw_init_stainfo() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_sta_mgt.c:475 rtw_get_bcmc_stainfo() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_wlan_util.c:65 cckratesonly_included() warn: if statement not indented
    drivers/staging/r8188eu/core/rtw_wlan_util.c:1150 should_forbid_n_rate() warn: if statement not indented
    drivers/staging/r8188eu/core/rtw_wlan_util.c:1401 check_assoc_AP() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_wlan_util.c:1403 check_assoc_AP() warn: inconsistent indenting
    drivers/staging/r8188eu/core/rtw_xmit.c:805 rtw_make_wlanhdr() warn: if statement not indented
    drivers/staging/r8188eu/core/rtw_xmit.c:1691 rtw_br_client_tx() warn: inconsistent indenting
    drivers/staging/r8188eu/hal/HalHWImg8188E_RF.c:199 ODM_ReadAndConfig_RadioA_1T_8188E() warn: inconsistent indenting
    
    Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
    Link: https://lore.kernel.org/r/20210812015232.23784-2-Larry.Finger@lwfinger.net
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    lwfinger authored and gregkh committed Aug 12, 2021
  6. staging: r8188eu: Remove no more necessary definitions and code

    Remove no more necessary further 5GHz related code, along with no
    more used definitions of macro and variables.
    
    Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
    Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
    Link: https://lore.kernel.org/r/20210812002519.23678-4-fmdefrancesco@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    xp4ns3 authored and gregkh committed Aug 12, 2021
  7. staging: r8188eu: Remove code related to unsupported channels

    Remove all code related to unsupported channel
    bandwidths. rtl8188eu* NICs work only on 20 and
    40 Mhz channels.
    
    Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
    Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
    Link: https://lore.kernel.org/r/20210812002519.23678-3-fmdefrancesco@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    xp4ns3 authored and gregkh committed Aug 12, 2021
  8. staging: r8188eu: Remove all 5GHz network types

    Remove all 5Ghz network types. r8188eu works on
    802.11bgn standards and on 2.4Ghz band.
    
    Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
    Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
    Link: https://lore.kernel.org/r/20210812002519.23678-2-fmdefrancesco@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    xp4ns3 authored and gregkh committed Aug 12, 2021
  9. staging: r8188eu: remove CONFIG_USB_HCI from Makefile

    We already depend on USB. There's no need to set CONFIG_USB_HCI in the
    Makefile.
    
    Some other Realtek drivers use #ifdef CONFIG_USB_HCI in their code, the
    r8188 driver doesn't.
    
    Acked-by: Phillip Potter <phil@philpotter.co.uk>
    Signed-off-by: Martin Kaiser <martin@kaiser.cx>
    Link: https://lore.kernel.org/r/20210811201450.31366-5-martin@kaiser.cx
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    martin-kaiser authored and gregkh committed Aug 12, 2021
  10. staging: r8188eu: use proper way to build a module

    It seems that for now, we can only build this driver as a module.
    
    Use the same mechanism as other drivers (such as rtl8723bs or the
    deprecated rtl8188eu) to enforce building as a module, i.e. depend on m
    in Kconfig instead of setting CONFIG_R8188EU = m in the Makefile.
    
    If we set CONFIG_R8188EU in the Makefile, this setting will not be visible
    in .config.
    
    Acked-by: Phillip Potter <phil@philpotter.co.uk>
    Signed-off-by: Martin Kaiser <martin@kaiser.cx>
    Link: https://lore.kernel.org/r/20210811201450.31366-4-martin@kaiser.cx
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    martin-kaiser authored and gregkh committed Aug 12, 2021
  11. staging: r8188eu: (trivial) remove a duplicate debug print

    Keep the one that shows the wakeup capability.
    
    Signed-off-by: Martin Kaiser <martin@kaiser.cx>
    Link: https://lore.kernel.org/r/20210811201450.31366-3-martin@kaiser.cx
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    martin-kaiser authored and gregkh committed Aug 12, 2021
  12. staging: r8188eu: remove unused function parameters

    rtw_usb_if1_init and chip_by_usb_id do not need a
    struct usb_device_id parameter.
    
    Acked-by: Phillip Potter <phil@philpotter.co.uk>
    Signed-off-by: Martin Kaiser <martin@kaiser.cx>
    Link: https://lore.kernel.org/r/20210811201450.31366-2-martin@kaiser.cx
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    martin-kaiser authored and gregkh committed Aug 12, 2021
  13. staging: r8188eu: remove unused efuse hal components

    struct hal_data_8188e contains some components related to efuses which
    are not used for rl8188eu.
    
    Acked-by: Phillip Potter <phil@philpotter.co.uk>
    Signed-off-by: Martin Kaiser <martin@kaiser.cx>
    Link: https://lore.kernel.org/r/20210811201450.31366-1-martin@kaiser.cx
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    martin-kaiser authored and gregkh committed Aug 12, 2021
  14. staging: gdm724x: Place macro argument within parentheses

    Place the macro arguments within parentheses to avoid precedence issues.
    This solves the following checkpatch.pl warnings
    
    CHECK: Macro argument 'len' may be better as '(len)' to avoid precedence issues
    +#define ND_NLMSG_S_LEN(len)    (len + ND_IFINDEX_LEN)
    
    CHECK: Macro argument 'nlh' may be better as '(nlh)' to avoid precedence issues
    +#define ND_NLMSG_R_LEN(nlh)    (nlh->nlmsg_len - ND_IFINDEX_LEN)
    
    Signed-off-by: Dee-Jay Anthony Logozzo <dj@djl.id.au>
    Link: https://lore.kernel.org/r/20210811134132.5240-1-dj@djl.id.au
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    DjLogozzo authored and gregkh committed Aug 12, 2021

Commits on Aug 11, 2021

  1. staging: rtl8192e: rtl_core: Fix possible null-pointer dereference in…

    … _rtl92e_pci_disconnect()
    
    The variable dev is checked in:
      if (dev)
    
    This indicates that it can be NULL. If so, a null-pointer dereference will
    occur:
      priv = rtllib_priv(dev);
    
    However, the value of priv is not used in the remaining part of this
    function. Thus the else-branch can be removed to fix this posible
    null-pointer dereference.
    
    Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
    Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Tuo Li <islituo@gmail.com>
    Link: https://lore.kernel.org/r/20210811031135.4110-1-islituo@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    lituo1996 authored and gregkh committed Aug 11, 2021
  2. staging: r8188eu: os_dep: Hoist vmalloc.h include into osdep_service.h

    After commit 71f09c5 ("staging: r8188eu: Remove wrapper around
    vfree"), the driver fails to build on Hexagon due to an implicit
    declaration in several different files:
    
    drivers/staging/r8188eu/core/rtw_mlme.c:129:3: error: implicit
    declaration of function 'vfree'
    [-Werror,-Wimplicit-function-declaration]
                    vfree(pmlmepriv->free_bss_buf);
                    ^
    1 error generated.
    
    Previously, vfree() was only called in osdep_service.c, which includes
    vmalloc.h for vmalloc() and vfree(). Now, the driver relies on vfree()
    getting implicitly included from another file.
    
    Hoist the vmalloc.h include from osdep_service.c to osdep_service.h so
    that the driver continues to build fine on all architectures.
    
    Fixes: 71f09c5 ("staging: r8188eu: Remove wrapper around vfree")
    Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
    Signed-off-by: Nathan Chancellor <nathan@kernel.org>
    Link: https://lore.kernel.org/r/20210811005505.3953122-1-nathan@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    nathanchance authored and gregkh committed Aug 11, 2021
  3. staging: r8188eu: Use GFP_ATOMIC under spin lock

    A spin lock is taken in __nat25_db_network_insert() and
    update_BCNTIM() is called under spin lock so we should
    use GFP_ATOMIC in both place.
    
    Fixes: 1586512 ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
    Reported-by: Hulk Robot <hulkci@huawei.com>
    Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
    Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
    Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
    Link: https://lore.kernel.org/r/20210810125314.2182112-1-yangyingliang@huawei.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Yang Yingliang authored and gregkh committed Aug 11, 2021
  4. staging: r8188eu: Replace BITn with BIT(n)

    The driver uses BITn instead of BIT(n). All such usage is converted.
    
    Note that this patch does not address any warnings that checkpatch
    will find. These include missing space around operators and lines
    that are too long. These problems will be addressed in a separate
    patch.
    
    Acked-by: Phillip Potter <phil@philpotter.co.uk>
    Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
    Link: https://lore.kernel.org/r/20210810180511.8986-1-Larry.Finger@lwfinger.net
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    lwfinger authored and gregkh committed Aug 11, 2021
  5. staging: r8188eu: remove lines from Makefile that silence build warnings

    Remove the several lines from the Makefile that append EXTRA_CFLAGS options
    to silence build warnings about unused variables, unused functions and such
    like. This will enable cleanup of missed warnings, and easier spotting
    of future such problems.
    
    Acked-by: Michael Straube <straube.linux@gmail.com>
    Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
    Link: https://lore.kernel.org/r/20210810235047.177883-9-phil@philpotter.co.uk
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    PhilPotter authored and gregkh committed Aug 11, 2021
  6. staging: r8188eu: remove unused variable from rtw_init_recv_timer

    Remove unused variable from rtw_init_recv_timer function in
    os_dep/recv_linux.c
    
    Acked-by: Michael Straube <straube.linux@gmail.com>
    Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
    Link: https://lore.kernel.org/r/20210810235047.177883-8-phil@philpotter.co.uk
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    PhilPotter authored and gregkh committed Aug 11, 2021
  7. staging: r8188eu: remove unused variable from rtw_init_drv_sw

    Remove unused variable from rtw_init_drv_sw function in
    os_dep/os_intfs.c
    
    Acked-by: Michael Straube <straube.linux@gmail.com>
    Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
    Link: https://lore.kernel.org/r/20210810235047.177883-7-phil@philpotter.co.uk
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    PhilPotter authored and gregkh committed Aug 11, 2021
  8. staging: r8188eu: remove unused variable from rtl8188e_init_dm_priv

    Remove unused variable from the rtl8188e_init_dm_priv function in
    hal/rtl8188e_dm.c
    
    Acked-by: Michael Straube <straube.linux@gmail.com>
    Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
    Link: https://lore.kernel.org/r/20210810235047.177883-6-phil@philpotter.co.uk
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    PhilPotter authored and gregkh committed Aug 11, 2021
  9. staging: r8188eu: remove rtw_mfree_sta_priv_lock function

    Remove rtw_mfree_sta_priv_lock function from rtw_sta_mgt.c, as it does
    nothing and contains an unused variable.
    
    Acked-by: Michael Straube <straube.linux@gmail.com>
    Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
    Link: https://lore.kernel.org/r/20210810235047.177883-5-phil@philpotter.co.uk
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    PhilPotter authored and gregkh committed Aug 11, 2021
  10. staging: r8188eu: remove unused label from recv_indicatepkt_reorder

    Remove unused goto label from recv_indicatepkt_reorder function in
    core/rtw_recv.c
    
    Acked-by: Michael Straube <straube.linux@gmail.com>
    Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
    Link: https://lore.kernel.org/r/20210810235047.177883-4-phil@philpotter.co.uk
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    PhilPotter authored and gregkh committed Aug 11, 2021
  11. staging: r8188eu: remove unused oid_null_function function

    Remove unused oid_null_function function from include/rtw_ioctl.h
    
    Acked-by: Michael Straube <straube.linux@gmail.com>
    Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
    Link: https://lore.kernel.org/r/20210810235047.177883-3-phil@philpotter.co.uk
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    PhilPotter authored and gregkh committed Aug 11, 2021
Older