summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-04-23staging: rtl8192u: Replace GFP_ATOMIC with GFP_KERNEL in ieee80211_softmac_initJia-Ju Bai
ieee80211_softmac_init() is never called in atomic context. The call chains ending up at ieee80211_softmac_init() is: [1] ieee80211_softmac_init() <- alloc_ieee80211_rsl() <- rtl8192_usb_probe() rtl8192_usb_probe() is set as ".probe" in struct usb_driver. Despite never getting called from atomic context, ieee80211_softmac_init() calls kzalloc() with GFP_ATOMIC, which does not sleep for allocation. GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL, which can sleep and improve the possibility of sucessful allocation. This is found by a static analysis tool named DCNS written by myself. And I also manually check it. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: rtl8192u: Replace GFP_ATOMIC with GFP_KERNEL in prism2_wep_initJia-Ju Bai
prism2_wep_init() is never called in atomic context. prism2_wep_init() is only set as ".init" in struct ieee80211_crypto_ops. The call chains ending up at "->init" function are: [1] ->init() <- ieee80211_wpa_set_encryption() <- ieee80211_wpa_supplicant_ioctl() [2] ->init() <- ieee80211_wx_set_encode_ext_rsl() <- r8192_wx_set_enc_ext() [3] ->init() <- ieee80211_wx_set_encode_rsl() <- r8192_wx_set_enc() ieee80211_wpa_supplicant_ioctl(), r8192_wx_set_enc_ext() and r8192_wx_set_enc() call mutex_lock(), which indicates these functions are not called in atomic context. Despite never getting called from atomic context, prism2_wep_init() calls kzalloc() with GFP_ATOMIC, which does not sleep for allocation. GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL, which can sleep and improve the possibility of sucessful allocation. This is found by a static analysis tool named DCNS written by myself. And I also manually check it Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: rtl8192u: Replace GFP_ATOMIC with GFP_KERNEL in ieee80211_tkip_initJia-Ju Bai
ieee80211_tkip_init() is never called in atomic context. ieee80211_tkip_init() is only set as ".init" in struct ieee80211_crypto_ops. The call chains ending up at "->init" function are: [1] ->init() <- ieee80211_wpa_set_encryption() <- ieee80211_wpa_supplicant_ioctl() [2] ->init() <- ieee80211_wx_set_encode_ext_rsl() <- r8192_wx_set_enc_ext() [3] ->init() <- ieee80211_wx_set_encode_rsl() <- r8192_wx_set_enc() ieee80211_wpa_supplicant_ioctl(), r8192_wx_set_enc_ext() and r8192_wx_set_enc() call mutex_lock(), which indicates these functions are not called in atomic context. Despite never getting called from atomic context, ieee80211_tkip_init() calls kzalloc() with GFP_ATOMIC, which does not sleep for allocation. GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL, which can sleep and improve the possibility of sucessful allocation. This is found by a static analysis tool named DCNS written by myself. And I also manually check it. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: rtl8192u: Replace GFP_ATOMIC with GFP_KERNEL in ieee80211_ccmp_initJia-Ju Bai
ieee80211_ccmp_init() is never called in atomic context. ieee80211_ccmp_init() is only set as ".init" in struct ieee80211_crypto_ops. The call chains ending up at "->init" function are: [1] ->init() <- ieee80211_wpa_set_encryption() <- ieee80211_wpa_supplicant_ioctl() [2] ->init() <- ieee80211_wx_set_encode_ext_rsl() <- r8192_wx_set_enc_ext() [3] ->init() <- ieee80211_wx_set_encode_rsl() <- r8192_wx_set_enc() ieee80211_wpa_supplicant_ioctl(), r8192_wx_set_enc_ext() and r8192_wx_set_enc() call mutex_lock(), which indicates these functions are not called in atomic context. Despite never getting called from atomic context, ieee80211_ccmp_init() calls kzalloc() with GFP_ATOMIC, which does not sleep for allocation. GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL, which can sleep and improve the possibility of sucessful allocation. This is found by a static analysis tool named DCNS written by myself. And I also manually check it. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: rtl8192e: Fixed coding style around a plus signJoao Dalben
Added blank spaces between a plus sign in order to standardize the coding style. Signed-off-by: Joao Dalben <jhdalben@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: comedi: cb_pcidas64: fix alignment of function parametersGabriel Francisco Mandaji
Fix most checkpatch.pl issues of type: CHECK: Alignment should match open parenthesis Signed-off-by: Gabriel Francisco Mandaji <gfmandaji@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: vc04_services: Remove depends on HAS_DMA in case of platform dependencyGeert Uytterhoeven
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their dependencies on HAS_DMA, to prevent compiling subsystems or drivers that cannot work anyway. This simplifies the dependencies, and allows to improve compile-testing. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Mark Brown <broonie@kernel.org> Acked-by: Robin Murphy <robin.murphy@arm.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: vchiq_core: Free kthreads in error caseStefan Wahren
We need to free the kthreads in error case before leaving vchiq_init_state() otherwise we leak resources. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: vchiq_core: Move all wake-ups to one pointStefan Wahren
Move all calls of wake_up_process to one point, whichs makes the following implementation of clean-up code easier. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: vchiq_arm: Avoid long udelayStefan Wahren
vchiq_initialise() is used in non-interrupt context, so we can replace udelay with usleep_range as suggested by timers-howto.txt. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: vchiq_arm: Fix multiline dereferencesStefan Wahren
Multiline dereferences aren't nice to review. So fix this checkpatch warning. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: vc04_services: Use __func__ macroStefan Wahren
It's better to use the __func__ macro instead of open-code the function name. This fixes the following checkpatch warning: WARNING: Prefer using '"%s...", __func__' to using 'x', this function's name, in a string Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: vchiq_core: remove BITSET_ZEROStefan Wahren
Hiding memset behind a macro isn't the best, because it relies on that the parameter is not a pointer. Luckily all user has been removed, so we can remove BITSET_ZERO too. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: vchiq_core: Remove stackhog in process_free_queueStefan Wahren
This removes the stackhog in process_free_queue by allocating the necessary memory within the recycle thread main function instead of the stack. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: vchiq_core: Fix missing semaphore release in error caseStefan Wahren
The bail out branch in case of a invalid tx_pos missed a semaphore release. Dan Carpenter found this with a static checker. Fixes: d1eab9dec610 ("staging: vchiq_core: Bail out in case of invalid tx_pos") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: vboxvideo: Fix line size exceeding 80 columns.Daniel Junho
This patch fixes the checkpatch.pl warning: WARNING: line over 80 characters + vbva = (void __force *)vbox->vbva_buffers + i * VBVA_MIN_BUFFER_SIZE; Signed-off-by: Daniel Junho <djunho@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: wilc1000: Remove unnecessary braces {} around single statement blockEyal Ilsar
Remove unnecessary braces {} around an 'if' statement block with a single statement. Issue found by checkpatch. Signed-off-by: Eyal Ilsar <edilsar@gmail.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23Staging: most: Move comments to the end of lineIan Liu Rodrigues
Signed-off-by: Ian Liu Rodrigues <ian.liu88@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: pi433: Fixed typos and grammar in documentationShannon Booth
Some typos and grammar issues were found in the documentation. These mistakes were fixed. Signed-off-by: Shannon Booth <shannon.ml.booth@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: pi433: use help in Kconfig descriptionValentin Vidic
Fixes checkpatch warning: WARNING: prefer 'help' over '---help---' for new help texts Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: pi433: break long lines in rf69.cSimon Sandström
Breaks long lines in rf69.c, fixing checkpatch.pl warnings: "WARNING: line over 80 characters" Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: pi433: break long linesSimon Sandström
Breaks long lines in rf69.h, fixing checkpatch.pl warnings: "WARNING: line over 80 characters" Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: pi433: cleanup tx_fifo lockingValentin Vidic
pi433_write requires locking due to multiple writers. After acquiring the lock check if enough free space is available in the kfifo to write the whole message. This check should prevent partial writes to tx_fifo so kfifo_reset is not needed anymore. pi433_tx_thread is the only reader so it does not require locking after kfifo_reset is removed. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Reviewed-by: Marcus Wolf <marcus.wolf@wolf-entwicklungen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: greybus: simplify getting .drvdataWolfram Sang
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: greybus: Fix warning to limit chars per lineGaurav Dhingra
Wrap comment to fix warning "prefer a maximum 75 chars per line" Signed-off-by: Gaurav Dhingra <gauravdhingra.gxyd@gmail.com> Acked-by: Vaibhav Agarwal <vaibhav.sr@gmail.com> Reviewed-by: Mark Greer <mgreer@animalcreek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Remove unused field dma_addr of msdc_hostChristian Lütke-Stetzkamp
The dma_addr field of msdc_host is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Remove unused field cmd_rsp_done of msdc_hostChristian Lütke-Stetzkamp
The cmd_rsp_done field of msdc_host is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Remove unused field cmd_r1b_done in msdc_hostChristian Lütke-Stetzkamp
The field cmd_r1b_done in msdc_host is unused, so remove it. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Remove unused field dma_left_size of msdc_hostChristian Lütke-Stetzkamp
The dma_left_size field of msdc_host is never used, remove it. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621:mmc: Remove unused field reserved from msdc_hostChristian Lütke-Stetzkamp
The reserved field of msdc_host is never used and msdc_host is also never exposed to hardware, so remove that field. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Remove unused field starttime from msdc_hostChristian Lütke-Stetzkamp
The starttime field of msdc_host is never used, remove it. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Change default transfer mode to DMAChristian Lütke-Stetzkamp
The current default transfer is to use DMA or not depending on the size of the data. The upstream driver mtk-sd uses DMA all times, change the standard mode here to DMA for testing, if there are any performance problems with DMA for small data sizes. If not, the option for transfer mode should be removed in the future, Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Refactor msdc_init_gpd_bdChristian Lütke-Stetzkamp
The msdc_init_gpd_bd function is currently hard to read, because of old, commented out code and a while loop, where a for loop is much easier to read. Refactor it to make the code more readable. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Remove unused field xfersz from msdc_dmaChristian Lütke-Stetzkamp
The xfersz field of msdc_dma is only set to host->xfer_size and this is also available at the (few) positions, where dma.xfersz is used, so it is removed. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Remove flags from msdc_dmaChristian Lütke-Stetzkamp
The flags of msdc_dma are set to a constant value, so block and dword padding are disabled and checksum is enabled. By removing the field the code is easier to read and the difference to the mtk-sd driver is smaller. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Remove unused fields from msdc_dmaChristian Lütke-Stetzkamp
The fields used_gpd|bd in struct msdc_dma are only set and reset, but never used, so remove them. The other removed fields are never used, so they were removed either. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Start cleanup of msdc_dma_configChristian Lütke-Stetzkamp
Currently the msdc_dma_config function has some variables, that are not needed, uses the macro msdc_init_bd that is only used here and does not use the for_each_sg iterator. That last fact could cause a bug if the scatterlist is chained. The function is changed to remove these things, but none of the changes should change the behavior of it (despite the case of a linked scatterlist). Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Remove unused function msdc_dma_dumpChristian Lütke-Stetzkamp
The msdc_dma_dump function is disabled by a preprocessor macro, was only used in the msdc_dma_setup function. The code also contains no information about the device, it only dumps some memory for debug. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Remove unused field burstsz from msdc_dmaChristian Lütke-Stetzkamp
The burstsz field in msdc_dma is set to a constant value and later only used two times, using the constant directly in that places allows to remove the field and improves readability. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Remove unused field data_offset from msdc_hwChristian Lütke-Stetzkamp
The data_offset field in msdc_hw is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Relax cpu while waiting for stable clockChristian Lütke-Stetzkamp
Current code just busy waits with nop for clock becoming stable, relaxing the cpu here improves readability and portability and also removes a unnecessary difference with the mtk-sd driver. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Remove code for not existent configChristian Lütke-Stetzkamp
The MT7621|7628_FPGA config flags are non existent in the tree, so code guarded by this flags can be removed. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Refactor and rename msdc_reset to msdc_reset_hwChristian Lütke-Stetzkamp
In the current code the hardware reset is realised via a macro and does only wait for a certain ammount of time for the controller to come out of reset state, but it should wait until it IS out of reset state. So it is refactored to improve this, it is also changed from a macro to a function and renamed to msdc_reset_hw to match the mtk-sd driver. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Remove power callbacks from msdc_hwChristian Lütke-Stetzkamp
The ext_power_on|off fields of msdc_hw are never set, and only once checked for not being zero, so they can just be removed. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Fix null pointer deref if ext sdio irq enabledChristian Lütke-Stetzkamp
The enable|disable_sdio_irq() fields of msdc_hw are never set, so when they are called, they are null pointer. In case of the MSDC_EXT_SDIO_IRQ flag set in msdc0_hw, this happens. But because these fields are never set, they can simply be removed. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Remove unused field disable_cd_eirqChristian Lütke-Stetzkamp
The disable_cd_eirq() field of msdc_hw is never set and only once checked for being non zero, so it is deleted. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Remove unused field enable_cd_eirq from msdc_hwChristian Lütke-Stetzkamp
The enable_cd_eirq() field of msdc_hw is never set and only once checked for not being zero, so it is removed. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Remove unused field get_cd_status from msdc_hwChristian Lütke-Stetzkamp
The get_cd_status() field of msdc_hw is never set and there is only one check for it being non zero, so it is deleted. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-mmc: Remove unused code from board.hChristian Lütke-Stetzkamp
The board.h file contins lot of never used code, to clean up the driver, this code is removed. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-spi: Remove redundant owner assignmentChristian Lütke-Stetzkamp
Remove the owner assignment form the platform driver as platform_driver_register() already initializes the owner. Found using coccinelle. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>