aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2021-08-05Revert "wwan: mhi: Fix build."David S. Miller1-1/+1
This reverts commit ab996c420508761f3313c15c5f72d06ca7dc1a5b. Only aplicable when net is merged into net-next. Signed-off-by: David S. Miller <davem@davemloft.net>
2021-08-05s390/sclp: replace deprecated CPU-hotplug functionsSebastian Andrzej Siewior1-2/+2
The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Link: https://lore.kernel.org/r/20210803141621.780504-6-bigeasy@linutronix.de Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2021-08-05wwan: mhi: Fix build.David S. Miller1-1/+1
Reported-by: Mark Brown <broonie@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2021-08-05serial: 8250_omap: Handle optional overrun-throttle-ms propertyTony Lindgren1-1/+24
Handle optional overrun-throttle-ms property as done for 8250_fsl in commit 6d7f677a2afa ("serial: 8250: Rate limit serial port rx interrupts during input overruns"). This can be used to rate limit the UART interrupts on noisy lines that end up producing messages like the following: ttyS ttyS2: 4 input overrun(s) At least on droid4, the multiplexed USB and UART port is left to UART mode by the bootloader for a debug console, and if a USB charger is connected on boot, we get noise on the UART until the PMIC related drivers for PHY and charger are loaded. With this patch and overrun-throttle-ms = <500> we avoid the extra rx interrupts. Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Cc: Sebastian Reichel <sre@kernel.org> Cc: Vignesh Raghavendra <vigneshr@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/20210727103533.51547-2-tony@atomide.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05mfd: Don't use irq_create_mapping() to resolve a mappingMarc Zyngier4-5/+5
Although irq_create_mapping() is able to deal with duplicate mappings, it really isn't supposed to be a substitute for irq_find_mapping(), and can result in allocations that take place in atomic context if the mapping didn't exist. Fix the handful of MFD drivers that use irq_create_mapping() in interrupt context by using irq_find_mapping() instead. Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Lee Jones <lee.jones@linaro.org> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com> Cc: Alexandre Torgue <alexandre.torgue@foss.st.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-08-05staging: r8188eu: core: Remove rtw_mfree_all_stainfo()Fabio M. De Francesco1-22/+0
Remove rtw_mfree_all_stainfo() and the only line of code that calls it. This function simply takes a spinlock and iterates over a list with no purpose. That iteration has no side effects. Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Acked-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20210802005517.12815-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: Fix cast between incompatible function typeFabio M. De Francesco5-6/+6
Fix sparse warnings of casts between incompatible function types from ‘void (*)(void *)’ to ‘void (*)(long unsigned int)’ [-Wcast-function-type]. Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Link: https://lore.kernel.org/r/20210804143218.13665-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging/fbtft: Fix braces coding styleLen Baker1-1/+3
Add braces to the "for" loop. This way, the kernel coding style is followed. Signed-off-by: Len Baker <len.baker@gmx.com> Link: https://lore.kernel.org/r/20210801085155.3170-4-len.baker@gmx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging/fbtft: Remove unnecessary variable initializationLen Baker1-1/+1
Remove the initialization of the variable "i" since it is written a few lines later. Signed-off-by: Len Baker <len.baker@gmx.com> Link: https://lore.kernel.org/r/20210801085155.3170-3-len.baker@gmx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging/fbtft: Remove all strcpy() usesLen Baker1-11/+6
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() but in this case it is simpler to use the "%*ph" format specifier. Moreover, with the "0x%02X " in the sprintf followed by the strcat, the msg buffer (now removed) can print 128/5 values (25 hex values). So, the "%*ph" replacement won't cut output earlier than requested since this format specifier can print up to 64 bytes. Signed-off-by: Len Baker <len.baker@gmx.com> Link: https://lore.kernel.org/r/20210801085155.3170-2-len.baker@gmx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: rtl8723bs: remove unused BT structuresBryan Brattlof2-12/+0
remove static BT debugging structures no longer in use. Signed-off-by: Bryan Brattlof <hello@bryanbrattlof.com> Link: https://lore.kernel.org/r/20210804144812.715695-1-hello@bryanbrattlof.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: rtl8723bs: Remove initialisation of globals to 0Scott J. Crouch1-2/+2
This fixes the following checkpatch.pl errors: ERROR: do not initialise globals to {0,NULL} Signed-off-by: Scott J. Crouch <scottjcrouch@gmail.com> Link: https://lore.kernel.org/r/20210804001335.16742-1-scottjcrouch@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05PCI: xgene-msi: Remove redundant dev_err() call in xgene_msi_probe()ErKun Yang1-1/+0
devm_ioremap_resource() internally calls __devm_ioremap_resource() which is where error checking and handling is actually taking place. i Therefore, the dev_err() call in xgene_msi_probe() is redundant. Remove it. Link: https://lore.kernel.org/r/20210408132751.1198171-1-yangerkun@huawei.com Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: ErKun Yang <yangerkun@huawei.com> [lorenzo.pieralisi@arm.com: commit log] Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Reviewed-by: Krzysztof Wilczyński <kw@linux.com>
2021-08-05staging: r8188eu: remove RT_TRACE calls from hal/usb_ops_linux.cPhillip Potter1-35/+3
Remove RT_TRACE macro calls from hal/usb_ops_linux.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210803230535.74254-9-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: remove RT_TRACE calls from hal/usb_halinit.cPhillip Potter1-25/+2
Remove RT_TRACE macro calls from hal/usb_halinit.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210803230535.74254-8-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: remove RT_TRACE calls from hal/rtl8188e_mp.cPhillip Potter1-39/+4
Remove RT_TRACE macro calls from hal/rtl8188e_mp.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210803230535.74254-7-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: remove RT_TRACE calls from hal/rtl8188e_hal_init.cPhillip Potter1-25/+0
Remove RT_TRACE macro calls from hal/rtl8188e_hal_init.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210803230535.74254-6-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: remove RT_TRACE calls from hal/hal_intf.cPhillip Potter1-3/+0
Remove RT_TRACE macro calls from hal/hal_intf.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210803230535.74254-5-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: remove RT_TRACE calls from hal/HalPwrSeqCmd.cPhillip Potter1-20/+0
Remove RT_TRACE macro calls from hal/HalPwrSeqCmd.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210803230535.74254-4-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: remove RT_TRACE calls from hal/rtl8188eu_recv.cPhillip Potter1-1/+0
Remove RT_TRACE macro calls from hal/rtl8188eu_recv.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210803230535.74254-3-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: remove RT_TRACE calls from hal/rtl8188eu_xmit.cPhillip Potter1-9/+0
Remove RT_TRACE macro calls from hal/rtl8188eu_xmit.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210803230535.74254-2-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: Remove some bit manipulation macrosLarry Finger5-101/+41
This driver defines a set of macros that get or set a bitfield in the RX and TX descriptors. Most of these have been replaced by the appropriate use of the system macros BIT() or GENMASK(). While reworking these routines, I also fixed camel case variables and missing spaces. Some comments were also converted to the drivers/net/wireless preferred format. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Link: https://lore.kernel.org/r/20210803135223.12543-11-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: Remove some unused and ugly macrosLarry Finger1-39/+0
This driver contains a number of macros that are intended to do endian conversion. The first step in getting rid of them is to delete the ones that are not used. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Link: https://lore.kernel.org/r/20210803135223.12543-10-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: Remove wrapper around do_divLarry Finger3-8/+2
Wrapper routine rtw_modular64() contains only a call to do_div() and is used once in the code. Remove the wrapper. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Link: https://lore.kernel.org/r/20210803135223.12543-9-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: Remove rtw_division64()Larry Finger2-7/+0
This wrapper is never used. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Link: https://lore.kernel.org/r/20210803135223.12543-8-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05firmware: arm_scmi: Free mailbox channels if probe failsRishabh Bhatnagar1-11/+24
Mailbox channels for the base protocol are setup during probe. There can be a scenario where probe fails to acquire the base protocol due to a timeout leading to cleaning up of all device managed memory including the scmi_mailbox structure setup during mailbox_chan_setup function. | arm-scmi soc:qcom,scmi: timed out in resp(caller: version_get+0x84/0x140) | arm-scmi soc:qcom,scmi: unable to communicate with SCMI | arm-scmi: probe of soc:qcom,scmi failed with error -110 Now when a message arrives at cpu slightly after the timeout, the mailbox controller will try to call the rx_callback of the client and might end up accessing freed memory. | rx_callback+0x24/0x160 | mbox_chan_received_data+0x44/0x94 | __handle_irq_event_percpu+0xd4/0x240 This patch frees the mailbox channels setup during probe and adds some more error handling in case the probe fails. Link: https://lore.kernel.org/r/1628111999-21595-1-git-send-email-rishabhb@codeaurora.org Tested-by: Cristian Marussi <cristian.marussi@arm.com> Reviewed-by: Cristian Marussi <cristian.marussi@arm.com> Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2021-08-05staging: r8188eu: Remove 4 empty routines from os_sep/service.cLarry Finger4-27/+0
Routines rtw_suspend_lock_init(), rtw_suspend_lock_uninit(), rtw_lock_suspend(), and rtw_unlock_suspend() do not conti=ain any code. Simplify by removing them. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Link: https://lore.kernel.org/r/20210802192721.23110-5-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: Remove wrappers for atomic operationsLarry Finger8-77/+13
These wrappers were useful when this driver had the hooks for Windows, but are no longer needed. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Link: https://lore.kernel.org/r/20210802192721.23110-4-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: include: Remove unused const definitionsFabio M. De Francesco1-77/+0
Remove unused const definitions. Issues detected by sparse. Remove the '#ifdef' and '#endif' preprocessor directives that surround them. Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Link: https://lore.kernel.org/r/20210802011025.23887-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: Remove set but unused variablesFabio M. De Francesco2-6/+1
Remove set but unused variables. Issues detected by sparse. Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Link: https://lore.kernel.org/r/20210802010056.20543-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: remove empty function odm_DynamicPrimaryCCA()Michael Straube3-7/+0
Function odm_DynamicPrimaryCCA() does nothing, remove it. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20210801210354.25218-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: remove return from void functionsMichael Straube10-52/+0
Remove return from void functions to clear checkpatch warnings. WARNING: void function return statements are not generally useful Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20210801210354.25218-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05Revert "staging: r8188eu: Fix different base types in assignments and parameters"Greg Kroah-Hartman1-36/+10
This reverts commit 56febcc2595e2bf2546c5bb4c35740ce883771a2. It's not correct and instead of fixing it up, let's just revert it for now. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: Fabio M. De Francesco <fmdefrancesco@gmail.com> Link: https://lore.kernel.org/r/20210802203020.9679-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: remove RT_TRACE calls from core/rtw_mp_ioctl.cPhillip Potter1-168/+8
Remove RT_TRACE macro calls from core/rtw_mp_ioctl.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210801190437.82017-15-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: remove RT_TRACE calls from core/rtw_led.cPhillip Potter1-70/+12
Remove RT_TRACE macro calls from core/rtw_led.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210801190437.82017-14-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: remove RT_TRACE calls from core/rtw_io.cPhillip Potter1-10/+2
Remove RT_TRACE macro calls from core/rtw_io.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210801190437.82017-6-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: remove RT_TRACE calls from core/rtw_ieee80211.cPhillip Potter1-61/+6
Remove RT_TRACE macro calls from core/rtw_ieee80211.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210801190437.82017-5-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: remove RT_TRACE calls from core/rtw_wlan_util.cPhillip Potter1-22/+3
Remove RT_TRACE macro calls from core/rtw_wlan_util.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210801190437.82017-4-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: remove RT_TRACE calls from core/rtw_pwrctrl.cPhillip Potter1-24/+3
Remove RT_TRACE macro calls from core/rtw_pwrctrl.c, so that ultimately the macro definition itself can eventually be removed. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210801190437.82017-3-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05PCI: tegra: make const array err_msg staticChristophe JAILLET1-1/+1
Don't populate the array err_msg on the stack but instead make it static. Makes the object code smaller by 64 bytes. While at it, add a missing const, as reported by checkpatch. Compiled with gcc 11.0.1 Before: $ size drivers/pci/controller/pci-tegra.o text data bss dec hex filename 25623 2844 32 28499 6f53 drivers/pci/controller/pci-tegra.o After: $ size drivers/pci/controller/pci-tegra.o text data bss dec hex filename 25559 2844 32 28435 6f13 drivers/pci/controller/pci-tegra.o Link: https://lore.kernel.org/r/5f3f35296b944b94546cc7d1e9cc6186484620d8.1620148539.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Reviewed-by: Vidya Sagar <vidyas@nvidia.com>
2021-08-05PCI: tegra: Use 'seq_puts' instead of 'seq_printf'Christophe JAILLET1-5/+5
As spotted by checkpatch, use 'seq_puts' instead of 'seq_printf' when possible. It is slightly more efficient. Link: https://lore.kernel.org/r/7bdedb342b9221169ab085540cf25d1992e8b97a.1620148539.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Reviewed-by: Vidya Sagar <vidyas@nvidia.com>
2021-08-05PCI: tegra: Fix OF node reference leakChristophe JAILLET1-5/+8
Commit 9e38e690ace3 ("PCI: tegra: Fix OF node reference leak") has fixed some node reference leaks in this function but missed some of them. In fact, having 'port' referenced in the 'rp' structure is not enough to prevent the leak, until 'rp' is actually added in the 'pcie->ports' list. Add the missing 'goto err_node_put' accordingly. Link: https://lore.kernel.org/r/55b11e9a7fa2987fbc0869d68ae59888954d65e2.1620148539.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Reviewed-by: Vidya Sagar <vidyas@nvidia.com>
2021-08-05staging: rtl8723bs: remove unused macrosFabio Aiuto26-93/+0
remove unused macros detected by -Wunused-macros gcc option. Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/20210801134629.23433-1-fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: clean up comparsions to NULL in core directoryMichael Straube17-280/+280
Clean up comparsions to NULL in the core directory reported by checkpatch. x == NULL -> !x x != NULL -> x Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20210801084614.4328-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: r8188eu: clean up comparsions to NULL in hal directoryMichael Straube13-29/+29
Clean up comparsions to NULL in the hal directory reported by checkpatch. x == NULL -> !x x != NULL -> x Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20210801084614.4328-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05usb: xhci-mtk: relax TT periodic bandwidth allocationIkjoon Jang1-7/+13
Currently xhci-mtk needs software-managed bandwidth allocation for periodic endpoints, it allocates the microframe index for the first start-split packet for each endpoint. As this index allocation logic should avoid the conflicts with other full/low-speed periodic endpoints, it uses the worst case byte budgets on high-speed bus bandwidth For example, for an isochronos IN endpoint with 192 bytes budget, it will consume the whole 4 u-frames(188 * 4) while the actual full-speed bus budget should be just 192bytes. This patch changes the low/full-speed bandwidth allocation logic to use "approximate" best case budget for lower speed bandwidth management. For the same endpoint from the above example, the approximate best case budget is now reduced to (188 * 2) bytes. Without this patch, many usb audio headsets with 3 interfaces (audio input, audio output, and HID) cannot be configured on xhci-mtk. Signed-off-by: Ikjoon Jang <ikjn@chromium.org> Link: https://lore.kernel.org/r/20210805133937.1.Ia8174b875bc926c12ce427a5a1415dea31cc35ae@changeid Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05usb: xhci-mtk: Do not use xhci's virt_dev in drop_endpointIkjoon Jang2-69/+86
xhci-mtk depends on xhci's internal virt_dev when it retrieves its internal data from usb_host_endpoint both in add_endpoint and drop_endpoint callbacks. But when setup packet was retired by transaction errors in xhci_setup_device() path, a virt_dev for the slot is newly created with real_port 0. This leads to xhci-mtks's NULL pointer dereference from drop_endpoint callback as xhci-mtk assumes that virt_dev's real_port is always started from one. The similar problems were addressed by [1] but that can't cover the failure cases from setup_device. This patch drops the usages of xhci's virt_dev in xhci-mtk's drop_endpoint callback by adopting rhashtable for searching mtk's schedule entity from a given usb_host_endpoint pointer instead of searching a linked list. So mtk's drop_endpoint callback doesn't have to rely on virt_dev at all. [1] https://lore.kernel.org/r/1617179142-2681-2-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Ikjoon Jang <ikjn@chromium.org> Link: https://lore.kernel.org/r/20210805133731.1.Icc0f080e75b1312692d4c7c7d25e7df9fe1a05c2@changeid Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05usb: gadget: f_uac2: remove redundant assignments to pointer i_featureColin Ian King1-8/+4
Pointer i_feature is being initialized with a value and then immediately re-assigned a new value in the next statement. Fix this by replacing the the redundant initialization with the following assigned value. Acked-by: Felipe Balbi <balbi@kernel.org> Signed-off-by: Colin Ian King <colin.king@canonical.com> Addresses-Coverity: ("Unused value") Link: https://lore.kernel.org/r/20210804125907.111654-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05usb: misc: adutux: use swap()Salah Triki1-4/+1
Use swap() in order to make code cleaner. Issue found by coccinelle. Signed-off-by: Salah Triki <salah.triki@gmail.com> Link: https://lore.kernel.org/r/20210803005343.GA1578854@pc Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05usb: gadget: remove useless castSalah Triki1-1/+1
Remove the cast done by ERR_PTR() and PTR_ERR() since data is of type char * and fss_prepare_buffer() should returns a value of this type. Acked-by: Felipe Balbi <balbi@kernel.org> Signed-off-by: Salah Triki <salah.triki@gmail.com> Link: https://lore.kernel.org/r/20210731171838.GA912463@pc Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>